All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing
@ 2020-02-09 18:03 Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols Romain Naour
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

This new iteration take into account the previous review with
some additional rework [1] [2].

This series start by removing useless host-qemu build for
m68k_q800, enable serial console for x86/x86_64.

Add host-qemu for qemu_pcc_mac99 defconfig that was added rencently.

Theses preliminary patches (1 to 4) can be applied separately from
the series. The series really start from path 5:
0005-board-qemu-add-defconfig-file-name-as-tag-before-the.patch

Based on the Yann's review during the Buildroot Developper meeting
FOSDEM 2020 [2], add a tag in each readme file to easily retrieve
the qemu command line to be used for runtime testing in gitlab.

This tag is used by a post-image script to generate a script
called start-qemu.sh that can be used by users or by a new python
script for running the test in gitlab but only when a Qemu
defconfig is built.

Finally add this new python script to .gitlab-ci.yml.

This series has been tested on Gitlab [3], please ignore the
failing test related to missing host-python3 modules needed by
optee-os package [4].

[1] http://lists.busybox.net/pipermail/buildroot/2019-May/249432.html
[2] http://lists.busybox.net/pipermail/buildroot/2020-February/273189.html
[3] https://gitlab.com/kubu93/buildroot/pipelines/116298701
[4] http://lists.busybox.net/pipermail/buildroot/2020-February/273738.html

Cc: Yann E. MORIN <yann.morin.1998@free.fr>

Jugurtha BELKALEM (2):
  support/scripts/boot-qemu-image.py: boot Qemu images with Qemu-system.
  gitlab.yml.in*: enable Qemu gitlab testing

Romain Naour (7):
  configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig
    symbols
  configs/qemu_pcc_mac99: build host-qemu for runtime testing
  configs/qemu_m68k_q800: remove host-qemu
  configs/qemu{x86, x86_64}: add a serial console
  board/qemu: add defconfig file name as tag before the qemu command
    line
  board/qemu: add post-image script for gitlab qemu testing
  configs/qemu*: use the post-image script with "$(BR2_DEFCONFIG)" as
    argument.

 .gitlab-ci.yml                             |   7 ++
 .gitlab-ci.yml.in                          |   7 ++
 board/qemu/aarch64-virt/post-image.sh      |  40 ++++++++
 board/qemu/aarch64-virt/readme.txt         |   2 +-
 board/qemu/arm-versatile/post-image.sh     |  40 ++++++++
 board/qemu/arm-versatile/readme.txt        |   4 +-
 board/qemu/arm-vexpress-tz/post-image.sh   |  40 ++++++++
 board/qemu/arm-vexpress-tz/readme.txt      |   2 +-
 board/qemu/arm-vexpress/post-image.sh      |  40 ++++++++
 board/qemu/arm-vexpress/readme.txt         |   2 +-
 board/qemu/csky/post-image.sh              |  40 ++++++++
 board/qemu/csky/readme.txt                 |  11 ++-
 board/qemu/m68k-mcf5208/post-image.sh      |  40 ++++++++
 board/qemu/m68k-mcf5208/readme.txt         |   2 +-
 board/qemu/m68k-q800/post-image.sh         |  40 ++++++++
 board/qemu/m68k-q800/readme.txt            |   2 +-
 board/qemu/microblazebe-mmu/post-image.sh  |  40 ++++++++
 board/qemu/microblazebe-mmu/readme.txt     |   2 +-
 board/qemu/microblazeel-mmu/post-image.sh  |  40 ++++++++
 board/qemu/microblazeel-mmu/readme.txt     |   2 +-
 board/qemu/mips32r2-malta/post-image.sh    |  40 ++++++++
 board/qemu/mips32r2-malta/readme.txt       |   2 +-
 board/qemu/mips32r2el-malta/post-image.sh  |  40 ++++++++
 board/qemu/mips32r2el-malta/readme.txt     |   2 +-
 board/qemu/mips32r6-malta/post-image.sh    |  40 ++++++++
 board/qemu/mips32r6-malta/readme.txt       |   2 +-
 board/qemu/mips32r6el-malta/post-image.sh  |  40 ++++++++
 board/qemu/mips32r6el-malta/readme.txt     |   2 +-
 board/qemu/mips64-malta/post-image.sh      |  40 ++++++++
 board/qemu/mips64-malta/readme.txt         |   2 +-
 board/qemu/mips64el-malta/post-image.sh    |  40 ++++++++
 board/qemu/mips64el-malta/readme.txt       |   2 +-
 board/qemu/mips64r6-malta/post-image.sh    |  40 ++++++++
 board/qemu/mips64r6-malta/readme.txt       |   2 +-
 board/qemu/mips64r6el-malta/post-image.sh  |  40 ++++++++
 board/qemu/mips64r6el-malta/readme.txt     |   2 +-
 board/qemu/nios2-10m50/post-image.sh       |  40 ++++++++
 board/qemu/nios2-10m50/readme.txt          |   2 +-
 board/qemu/or1k/post-image.sh              |  40 ++++++++
 board/qemu/or1k/readme.txt                 |   2 +-
 board/qemu/ppc-g3beige/post-image.sh       |  40 ++++++++
 board/qemu/ppc-g3beige/readme.txt          |   2 +-
 board/qemu/ppc-mac99/post-image.sh         |  40 ++++++++
 board/qemu/ppc-mac99/readme.txt            |   2 +-
 board/qemu/ppc-mpc8544ds/post-image.sh     |  40 ++++++++
 board/qemu/ppc-mpc8544ds/readme.txt        |   2 +-
 board/qemu/ppc-virtex-ml507/post-image.sh  |  40 ++++++++
 board/qemu/ppc-virtex-ml507/readme.txt     |   2 +-
 board/qemu/ppc64-e5500/post-image.sh       |  40 ++++++++
 board/qemu/ppc64-e5500/readme.txt          |   2 +-
 board/qemu/ppc64-pseries/post-image.sh     |  40 ++++++++
 board/qemu/ppc64-pseries/readme.txt        |   2 +-
 board/qemu/ppc64le-pseries/post-image.sh   |  40 ++++++++
 board/qemu/ppc64le-pseries/readme.txt      |   2 +-
 board/qemu/riscv32-virt/post-image.sh      |  40 ++++++++
 board/qemu/riscv32-virt/readme.txt         |   2 +-
 board/qemu/riscv64-virt/post-image.sh      |  40 ++++++++
 board/qemu/riscv64-virt/readme.txt         |   2 +-
 board/qemu/sh4-r2d/post-image.sh           |  41 ++++++++
 board/qemu/sh4-r2d/readme.txt              |   2 +-
 board/qemu/sh4eb-r2d/post-image.sh         |  41 ++++++++
 board/qemu/sh4eb-r2d/readme.txt            |   2 +-
 board/qemu/sparc-ss10/post-image.sh        |  40 ++++++++
 board/qemu/sparc-ss10/readme.txt           |   2 +-
 board/qemu/sparc64-sun4u/post-image.sh     |  40 ++++++++
 board/qemu/sparc64-sun4u/readme.txt        |   2 +-
 board/qemu/x86/post-build.sh               |  11 +++
 board/qemu/x86/post-image.sh               |  40 ++++++++
 board/qemu/x86/readme.txt                  |   2 +-
 board/qemu/x86_64/post-build.sh            |  11 +++
 board/qemu/x86_64/post-image.sh            |  40 ++++++++
 board/qemu/x86_64/readme.txt               |   2 +-
 board/qemu/xtensa-lx60/post-image.sh       |  40 ++++++++
 board/qemu/xtensa-lx60/readme.txt          |   4 +-
 configs/qemu_aarch64_virt_defconfig        |   4 +
 configs/qemu_arm_versatile_defconfig       |   4 +
 configs/qemu_arm_versatile_nommu_defconfig |   4 +
 configs/qemu_arm_vexpress_defconfig        |   4 +
 configs/qemu_arm_vexpress_tz_defconfig     |   4 +
 configs/qemu_csky610_virt_defconfig        |   4 +
 configs/qemu_csky807_virt_defconfig        |   4 +
 configs/qemu_csky810_virt_defconfig        |   4 +
 configs/qemu_csky860_virt_defconfig        |   4 +
 configs/qemu_m68k_mcf5208_defconfig        |   4 +
 configs/qemu_m68k_q800_defconfig           |   8 +-
 configs/qemu_microblazebe_mmu_defconfig    |   4 +
 configs/qemu_microblazeel_mmu_defconfig    |   4 +
 configs/qemu_mips32r2_malta_defconfig      |   4 +
 configs/qemu_mips32r2el_malta_defconfig    |   4 +
 configs/qemu_mips32r6_malta_defconfig      |   4 +
 configs/qemu_mips32r6el_malta_defconfig    |   4 +
 configs/qemu_mips64_malta_defconfig        |   4 +
 configs/qemu_mips64el_malta_defconfig      |   4 +
 configs/qemu_mips64r6_malta_defconfig      |   4 +
 configs/qemu_mips64r6el_malta_defconfig    |   4 +
 configs/qemu_nios2_10m50_defconfig         |   4 +
 configs/qemu_or1k_defconfig                |   4 +
 configs/qemu_ppc64_e5500_defconfig         |   4 +
 configs/qemu_ppc64_pseries_defconfig       |   4 +
 configs/qemu_ppc64le_pseries_defconfig     |   4 +
 configs/qemu_ppc_g3beige_defconfig         |   4 +
 configs/qemu_ppc_mac99_defconfig           |  21 ++++-
 configs/qemu_ppc_mpc8544ds_defconfig       |   4 +
 configs/qemu_ppc_virtex_ml507_defconfig    |   4 +
 configs/qemu_riscv32_virt_defconfig        |   4 +
 configs/qemu_riscv64_virt_defconfig        |   4 +
 configs/qemu_sh4_r2d_defconfig             |   4 +
 configs/qemu_sh4eb_r2d_defconfig           |   4 +
 configs/qemu_sparc64_sun4u_defconfig       |   4 +
 configs/qemu_sparc_ss10_defconfig          |   4 +
 configs/qemu_x86_64_defconfig              |   8 +-
 configs/qemu_x86_defconfig                 |   8 +-
 configs/qemu_xtensa_lx60_defconfig         |   4 +
 configs/qemu_xtensa_lx60_nommu_defconfig   |   4 +
 support/scripts/boot-qemu-image.py         | 105 +++++++++++++++++++++
 115 files changed, 1769 insertions(+), 46 deletions(-)
 create mode 100755 board/qemu/aarch64-virt/post-image.sh
 create mode 100755 board/qemu/arm-versatile/post-image.sh
 create mode 100755 board/qemu/arm-vexpress-tz/post-image.sh
 create mode 100755 board/qemu/arm-vexpress/post-image.sh
 create mode 100755 board/qemu/csky/post-image.sh
 create mode 100755 board/qemu/m68k-mcf5208/post-image.sh
 create mode 100755 board/qemu/m68k-q800/post-image.sh
 create mode 100755 board/qemu/microblazebe-mmu/post-image.sh
 create mode 100755 board/qemu/microblazeel-mmu/post-image.sh
 create mode 100755 board/qemu/mips32r2-malta/post-image.sh
 create mode 100755 board/qemu/mips32r2el-malta/post-image.sh
 create mode 100755 board/qemu/mips32r6-malta/post-image.sh
 create mode 100755 board/qemu/mips32r6el-malta/post-image.sh
 create mode 100755 board/qemu/mips64-malta/post-image.sh
 create mode 100755 board/qemu/mips64el-malta/post-image.sh
 create mode 100755 board/qemu/mips64r6-malta/post-image.sh
 create mode 100755 board/qemu/mips64r6el-malta/post-image.sh
 create mode 100755 board/qemu/nios2-10m50/post-image.sh
 create mode 100755 board/qemu/or1k/post-image.sh
 create mode 100755 board/qemu/ppc-g3beige/post-image.sh
 create mode 100755 board/qemu/ppc-mac99/post-image.sh
 create mode 100755 board/qemu/ppc-mpc8544ds/post-image.sh
 create mode 100755 board/qemu/ppc-virtex-ml507/post-image.sh
 create mode 100755 board/qemu/ppc64-e5500/post-image.sh
 create mode 100755 board/qemu/ppc64-pseries/post-image.sh
 create mode 100755 board/qemu/ppc64le-pseries/post-image.sh
 create mode 100755 board/qemu/riscv32-virt/post-image.sh
 create mode 100755 board/qemu/riscv64-virt/post-image.sh
 create mode 100755 board/qemu/sh4-r2d/post-image.sh
 create mode 100755 board/qemu/sh4eb-r2d/post-image.sh
 create mode 100755 board/qemu/sparc-ss10/post-image.sh
 create mode 100755 board/qemu/sparc64-sun4u/post-image.sh
 create mode 100755 board/qemu/x86/post-build.sh
 create mode 100755 board/qemu/x86/post-image.sh
 create mode 100755 board/qemu/x86_64/post-build.sh
 create mode 100755 board/qemu/x86_64/post-image.sh
 create mode 100755 board/qemu/xtensa-lx60/post-image.sh
 create mode 100755 support/scripts/boot-qemu-image.py

-- 
2.24.1

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-10  2:32   ` Joel Stanley
  2020-02-16 21:22   ` Peter Korsgaard
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing Romain Naour
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

This defconfig was generated by savedefconfig but we usually
use a manually modified defconfig to add some comments for
Kconfig symbols.

No content change intended.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Joel Stanley <joel@jms.id.au>
---
 configs/qemu_ppc_mac99_defconfig | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/configs/qemu_ppc_mac99_defconfig b/configs/qemu_ppc_mac99_defconfig
index 9a33c3d82c..4a7c7ce599 100644
--- a/configs/qemu_ppc_mac99_defconfig
+++ b/configs/qemu_ppc_mac99_defconfig
@@ -1,8 +1,14 @@
+# Architecture
 BR2_powerpc=y
 BR2_powerpc_7400=y
-BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+
+# System
 BR2_SYSTEM_DHCP="eth0"
+
+# Linux headers same as kernel, a 5.2 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_2=y
+
+# Kernel
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.2.4"
@@ -10,6 +16,11 @@ BR2_LINUX_KERNEL_DEFCONFIG="pmac32"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/ppc-mac99/linux.fragment"
 BR2_LINUX_KERNEL_VMLINUX=y
 BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+
+# Serial port config
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+
+# Filesystem
 BR2_TARGET_ROOTFS_CPIO=y
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-10  2:31   ` Joel Stanley
  2020-02-16 21:23   ` Peter Korsgaard
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu Romain Naour
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

The commit [1] added host-qemu package for each qemu defconfig
for gitlab runtime testing.

[1] 29e1cb88844614c40846540e22cf83aa9e52674f

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Joel Stanley <joel@jms.id.au>
---
 configs/qemu_ppc_mac99_defconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configs/qemu_ppc_mac99_defconfig b/configs/qemu_ppc_mac99_defconfig
index 4a7c7ce599..496b0fb2a4 100644
--- a/configs/qemu_ppc_mac99_defconfig
+++ b/configs/qemu_ppc_mac99_defconfig
@@ -24,3 +24,7 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 BR2_TARGET_ROOTFS_CPIO=y
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
+
+# host-qemu for gitlab testing
+BR2_PACKAGE_HOST_QEMU=y
+BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-09 18:12   ` Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 4/9] configs/qemu{x86, x86_64}: add a serial console Romain Naour
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

Building upstream host-qemu for m68k_q800 is useless
since it doesn't support the q800 machine:

qemu-system-m68k: -M q800: unsupported machine type

This defconfig must be used with the QEMU fork from [1]
using q800-v2.11.0 branch.

[1] https://github.com/vivier/qemu-m68k

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 configs/qemu_m68k_q800_defconfig | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/configs/qemu_m68k_q800_defconfig b/configs/qemu_m68k_q800_defconfig
index 2ef73d1dd6..e2a5f27431 100644
--- a/configs/qemu_m68k_q800_defconfig
+++ b/configs/qemu_m68k_q800_defconfig
@@ -23,7 +23,3 @@ BR2_LINUX_KERNEL_VMLINUX=y
 # Serial port config
 BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
-
-# host-qemu for gitlab testing
-BR2_PACKAGE_HOST_QEMU=y
-BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 4/9] configs/qemu{x86, x86_64}: add a serial console
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
                   ` (2 preceding siblings ...)
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-16 21:28   ` Peter Korsgaard
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line Romain Naour
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

The current Buildroot defconfigs for qemu_x86 and qemu_x86_64
instantiate a console on tty1, which appears on QEMU's
graphical window. Add a console on the serial port (ttyS0) to
be used later for gitlab testing.

This change is need since the script used for gitlab testing
needs to use a serial output with pexpect.

This change is similar to the one made for raspberrypi [1] to
handle HDMI and serial console:

This requires three changes:
 1. have two 'console=' entries in the kernel command line: tty1,
    then ttyS0;
 2. change BR2_TARGET_GENERIC_GETTY_PORT to "console", so it starts
    a getty on the last console= passed to the kernel, ttyS0;
 3. add a new getty on tty1 to the generated inittab.

Step 2 is actually obtained by removing BR2_TARGET_GENERIC_GETTY_PORT
entirely from the defconfigs, since "console" is the default value.

Step 3 requires a post-build script since the Buildroot makefiles can
configure only one console.

Note: instead of simply adding a new getty on ttyS0 (which would
work) this patch actually changes BR2_TARGET_GENERIC_GETTY_PORT to
instantiate a console on UART, then adds back tty1 via
post-build.sh. This is done only to avoid the "GENERIC_SERIAL" comment
where we instantiate a console on QEMU graphical window, then
instantiate a really-serial console on another line.

The result is these two inittab lines:

  console::respawn:/sbin/getty -L  console 0 vt100 # GENERIC_SERIAL
  tty1::respawn:/sbin/getty -L  tty1 0 vt100 # QEMU graphical window

[1] 20878a1017e2bf7eb8c5f870dc6d2641493cb0f9

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 board/qemu/x86/post-build.sh    | 11 +++++++++++
 board/qemu/x86/readme.txt       |  2 +-
 board/qemu/x86_64/post-build.sh | 11 +++++++++++
 board/qemu/x86_64/readme.txt    |  2 +-
 configs/qemu_x86_64_defconfig   |  4 +++-
 configs/qemu_x86_defconfig      |  4 +++-
 6 files changed, 30 insertions(+), 4 deletions(-)
 create mode 100755 board/qemu/x86/post-build.sh
 create mode 100755 board/qemu/x86_64/post-build.sh

diff --git a/board/qemu/x86/post-build.sh b/board/qemu/x86/post-build.sh
new file mode 100755
index 0000000000..bf83a002c2
--- /dev/null
+++ b/board/qemu/x86/post-build.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -u
+set -e
+
+# Add a console on tty1
+if [ -e ${TARGET_DIR}/etc/inittab ]; then
+    grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
+	sed -i '/GENERIC_SERIAL/a\
+tty1::respawn:/sbin/getty -L  tty1 0 vt100 # QEMU graphical window' ${TARGET_DIR}/etc/inittab
+fi
diff --git a/board/qemu/x86/readme.txt b/board/qemu/x86/readme.txt
index 42fc2439da..3bbafecf91 100644
--- a/board/qemu/x86/readme.txt
+++ b/board/qemu/x86/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda" -net nic,model=virtio -net user
+  qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
 
 Optionally add -smp N to emulate a SMP system with N CPUs.
 
diff --git a/board/qemu/x86_64/post-build.sh b/board/qemu/x86_64/post-build.sh
new file mode 100755
index 0000000000..bf83a002c2
--- /dev/null
+++ b/board/qemu/x86_64/post-build.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -u
+set -e
+
+# Add a console on tty1
+if [ -e ${TARGET_DIR}/etc/inittab ]; then
+    grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
+	sed -i '/GENERIC_SERIAL/a\
+tty1::respawn:/sbin/getty -L  tty1 0 vt100 # QEMU graphical window' ${TARGET_DIR}/etc/inittab
+fi
diff --git a/board/qemu/x86_64/readme.txt b/board/qemu/x86_64/readme.txt
index 4a1c0c0ff5..93ac22a947 100644
--- a/board/qemu/x86_64/readme.txt
+++ b/board/qemu/x86_64/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda" -net nic,model=virtio -net user
+  qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
 
 Optionally add -smp N to emulate a SMP system with N CPUs.
 
diff --git a/configs/qemu_x86_64_defconfig b/configs/qemu_x86_64_defconfig
index cbd0413a90..b561e42e51 100644
--- a/configs/qemu_x86_64_defconfig
+++ b/configs/qemu_x86_64_defconfig
@@ -3,12 +3,14 @@ BR2_x86_64=y
 
 # System
 BR2_SYSTEM_DHCP="eth0"
-BR2_TARGET_GENERIC_GETTY_PORT="tty1"
 
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_x86_defconfig b/configs/qemu_x86_defconfig
index 6ca3ab9627..52f1744344 100644
--- a/configs/qemu_x86_defconfig
+++ b/configs/qemu_x86_defconfig
@@ -4,12 +4,14 @@ BR2_x86_pentiumpro=y
 
 # System
 BR2_SYSTEM_DHCP="eth0"
-BR2_TARGET_GENERIC_GETTY_PORT="tty1"
 
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86/post-build.sh"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
                   ` (3 preceding siblings ...)
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 4/9] configs/qemu{x86, x86_64}: add a serial console Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-10 13:08   ` Thomas Petazzoni
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing Romain Naour
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

This commit add the name of the Qemu defconfig file before each
qemu command line in order to retrieve it easily.

Since a readme.txt can be shared between several Qemu defconfig, we
need at least one qemu command line in readme.txt for each defconfig.

[1] http://lists.busybox.net/pipermail/buildroot/2020-February/273189.html

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 board/qemu/aarch64-virt/readme.txt     |  2 +-
 board/qemu/arm-versatile/readme.txt    |  4 ++--
 board/qemu/arm-vexpress-tz/readme.txt  |  2 +-
 board/qemu/arm-vexpress/readme.txt     |  2 +-
 board/qemu/csky/readme.txt             | 11 +++++++----
 board/qemu/m68k-mcf5208/readme.txt     |  2 +-
 board/qemu/m68k-q800/readme.txt        |  2 +-
 board/qemu/microblazebe-mmu/readme.txt |  2 +-
 board/qemu/microblazeel-mmu/readme.txt |  2 +-
 board/qemu/mips32r2-malta/readme.txt   |  2 +-
 board/qemu/mips32r2el-malta/readme.txt |  2 +-
 board/qemu/mips32r6-malta/readme.txt   |  2 +-
 board/qemu/mips32r6el-malta/readme.txt |  2 +-
 board/qemu/mips64-malta/readme.txt     |  2 +-
 board/qemu/mips64el-malta/readme.txt   |  2 +-
 board/qemu/mips64r6-malta/readme.txt   |  2 +-
 board/qemu/mips64r6el-malta/readme.txt |  2 +-
 board/qemu/nios2-10m50/readme.txt      |  2 +-
 board/qemu/or1k/readme.txt             |  2 +-
 board/qemu/ppc-g3beige/readme.txt      |  2 +-
 board/qemu/ppc-mac99/readme.txt        |  2 +-
 board/qemu/ppc-mpc8544ds/readme.txt    |  2 +-
 board/qemu/ppc-virtex-ml507/readme.txt |  2 +-
 board/qemu/ppc64-e5500/readme.txt      |  2 +-
 board/qemu/ppc64-pseries/readme.txt    |  2 +-
 board/qemu/ppc64le-pseries/readme.txt  |  2 +-
 board/qemu/riscv32-virt/readme.txt     |  2 +-
 board/qemu/riscv64-virt/readme.txt     |  2 +-
 board/qemu/sh4-r2d/readme.txt          |  2 +-
 board/qemu/sh4eb-r2d/readme.txt        |  2 +-
 board/qemu/sparc-ss10/readme.txt       |  2 +-
 board/qemu/sparc64-sun4u/readme.txt    |  2 +-
 board/qemu/x86/readme.txt              |  2 +-
 board/qemu/x86_64/readme.txt           |  2 +-
 board/qemu/xtensa-lx60/readme.txt      |  4 +++-
 35 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/board/qemu/aarch64-virt/readme.txt b/board/qemu/aarch64-virt/readme.txt
index f868905d91..3443de05a8 100644
--- a/board/qemu/aarch64-virt/readme.txt
+++ b/board/qemu/aarch64-virt/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
+qemu_aarch64_virt_defconfig: qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/arm-versatile/readme.txt b/board/qemu/arm-versatile/readme.txt
index f3a9e1ab47..cdc08acf5a 100644
--- a/board/qemu/arm-versatile/readme.txt
+++ b/board/qemu/arm-versatile/readme.txt
@@ -1,10 +1,10 @@
 Run the emulation with:
 
-  qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -drive file=output/images/rootfs.ext2,if=scsi,format=raw -append "rootwait root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user
+qemu_arm_versatile_defconfig: qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -drive file=output/images/rootfs.ext2,if=scsi,format=raw -append "rootwait root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user
 
 Or for the noMMU emulation:
 
-  qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -append "console=ttyAMA0,115200" -serial stdio -net user -net nic,model=smc91c111
+qemu_arm_versatile_nommu_defconfig: qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -append "console=ttyAMA0,115200" -serial stdio -net user -net nic,model=smc91c111
 
 The login prompt will appear in the terminal that started Qemu. The
 graphical window is the framebuffer.
diff --git a/board/qemu/arm-vexpress-tz/readme.txt b/board/qemu/arm-vexpress-tz/readme.txt
index 35ff018aec..64127f4dd1 100644
--- a/board/qemu/arm-vexpress-tz/readme.txt
+++ b/board/qemu/arm-vexpress-tz/readme.txt
@@ -12,7 +12,7 @@ QEMU platform is quite specific for that in TF-A and one needs to
 run the emulation from the image directory for TF-A to boot the
 secure and non-secure worlds.
 
-  cd output/images && ../host/bin/qemu-system-arm \
+qemu_arm_vexpress_tz_defconfig: qemu-system-arm \
 	-machine virt -machine secure=on -cpu cortex-a15 \
 	-smp 1 -s -m 1024 -d unimp \
 	-serial stdio \
diff --git a/board/qemu/arm-vexpress/readme.txt b/board/qemu/arm-vexpress/readme.txt
index 7f7b43a3b3..16f9baf7c9 100644
--- a/board/qemu/arm-vexpress/readme.txt
+++ b/board/qemu/arm-vexpress/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-arm -M vexpress-a9 -smp 1 -m 256 -kernel output/images/zImage -dtb output/images/vexpress-v2p-ca9.dtb -drive file=output/images/rootfs.ext2,if=sd,format=raw -append "console=ttyAMA0,115200 rootwait root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user
+qemu_arm_vexpress_defconfig: qemu-system-arm -M vexpress-a9 -smp 1 -m 256 -kernel output/images/zImage -dtb output/images/vexpress-v2p-ca9.dtb -drive file=output/images/rootfs.ext2,if=sd,format=raw -append "console=ttyAMA0,115200 rootwait root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user
 
 The login prompt will appear in the terminal that started Qemu. The
 graphical window is the framebuffer.
diff --git a/board/qemu/csky/readme.txt b/board/qemu/csky/readme.txt
index 89d68aafb8..c92960299d 100644
--- a/board/qemu/csky/readme.txt
+++ b/board/qemu/csky/readme.txt
@@ -1,12 +1,15 @@
 Run with qemu:
 
 For ck860 smp:
- qemu-system-cskyv2 -M virt -cpu ck860 -smp 2 -nographic -kernel vmlinux
+qemu_csky860_virt_defconfig: qemu-system-cskyv2 -M virt -cpu ck860 -smp 2 -nographic -kernel vmlinux
 
-For ck810/ck807:
- qemu-system-cskyv2 -M virt -nographic -kernel vmlinux
+For ck807:
+qemu_csky807_virt_defconfig: qemu-system-cskyv2 -M virt -nographic -kernel vmlinux
+
+For ck810:
+qemu_csky810_virt_defconfig: qemu-system-cskyv2 -M virt -nographic -kernel vmlinux
 
 For ck610:
- qemu-system-cskyv1 -M virt -nographic -kernel vmlinux
+qemu_csky610_virt_defconfig: qemu-system-cskyv1 -M virt -nographic -kernel vmlinux
 
 The login prompt will appear in the terminal that started Qemu. Username is root and no password.
diff --git a/board/qemu/m68k-mcf5208/readme.txt b/board/qemu/m68k-mcf5208/readme.txt
index d1c9086805..514e537806 100644
--- a/board/qemu/m68k-mcf5208/readme.txt
+++ b/board/qemu/m68k-mcf5208/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-m68k -M mcf5208evb -cpu m5208 -kernel output/images/vmlinux -nographic
+qemu_m68k_mcf5208_defconfig: qemu-system-m68k -M mcf5208evb -cpu m5208 -kernel output/images/vmlinux -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/m68k-q800/readme.txt b/board/qemu/m68k-q800/readme.txt
index b516bacdff..12696562a7 100644
--- a/board/qemu/m68k-q800/readme.txt
+++ b/board/qemu/m68k-q800/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-m68k -M q800 -kernel output/images/vmlinux -nographic -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/sda console=ttyS0"
+qemu_m68k_q800_defconfig: qemu-system-m68k -M q800 -kernel output/images/vmlinux -nographic -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/sda console=ttyS0"
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/microblazebe-mmu/readme.txt b/board/qemu/microblazebe-mmu/readme.txt
index 4f52baff1f..cd0221924f 100644
--- a/board/qemu/microblazebe-mmu/readme.txt
+++ b/board/qemu/microblazebe-mmu/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-microblaze -M petalogix-s3adsp1800 -kernel output/images/linux.bin -serial stdio
+qemu_microblazebe_mmu_defconfig: qemu-system-microblaze -M petalogix-s3adsp1800 -kernel output/images/linux.bin -serial stdio
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/microblazeel-mmu/readme.txt b/board/qemu/microblazeel-mmu/readme.txt
index 0b0f330a5e..346da3caa6 100644
--- a/board/qemu/microblazeel-mmu/readme.txt
+++ b/board/qemu/microblazeel-mmu/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-microblazeel -M petalogix-s3adsp1800 -kernel output/images/linux.bin -serial stdio
+qemu_microblazeel_mmu_defconfig: qemu-system-microblazeel -M petalogix-s3adsp1800 -kernel output/images/linux.bin -serial stdio
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/mips32r2-malta/readme.txt b/board/qemu/mips32r2-malta/readme.txt
index 9ff3c4b810..fdab1d5244 100644
--- a/board/qemu/mips32r2-malta/readme.txt
+++ b/board/qemu/mips32r2-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-mips -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user
+qemu_mips32r2_malta_defconfig: qemu-system-mips -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user
 
 The login prompt will appear in the terminal that started Qemu. The
 graphical window is the framebuffer. No keyboard support has been
diff --git a/board/qemu/mips32r2el-malta/readme.txt b/board/qemu/mips32r2el-malta/readme.txt
index 745bfea608..1609fc7427 100644
--- a/board/qemu/mips32r2el-malta/readme.txt
+++ b/board/qemu/mips32r2el-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-mipsel -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user
+qemu_mips32r2el_malta_defconfig: qemu-system-mipsel -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user
 
 The login prompt will appear in the terminal that started Qemu. The
 graphical window is the framebuffer. No keyboard support has been
diff --git a/board/qemu/mips32r6-malta/readme.txt b/board/qemu/mips32r6-malta/readme.txt
index 6a026b2165..3f7e4f5e66 100644
--- a/board/qemu/mips32r6-malta/readme.txt
+++ b/board/qemu/mips32r6-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-qemu-system-mips -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic
+qemu_mips32r6_malta_defconfig: qemu-system-mips -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/mips32r6el-malta/readme.txt b/board/qemu/mips32r6el-malta/readme.txt
index f69fd21af1..6212e5e0ca 100644
--- a/board/qemu/mips32r6el-malta/readme.txt
+++ b/board/qemu/mips32r6el-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-qemu-system-mipsel -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user -nographic
+qemu_mips32r6el_malta_defconfig: qemu-system-mipsel -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/mips64-malta/readme.txt b/board/qemu/mips64-malta/readme.txt
index ea3a92541e..d7ee4ec660 100644
--- a/board/qemu/mips64-malta/readme.txt
+++ b/board/qemu/mips64-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-mips64 -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda"
+qemu_mips64_malta_defconfig: qemu-system-mips64 -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda"
 
 The login prompt will appear in the terminal that started Qemu. The
 graphical window is the framebuffer.
diff --git a/board/qemu/mips64el-malta/readme.txt b/board/qemu/mips64el-malta/readme.txt
index 144da93839..65ad238b2d 100644
--- a/board/qemu/mips64el-malta/readme.txt
+++ b/board/qemu/mips64el-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-mips64el -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda"
+qemu_mips64el_malta_defconfig: qemu-system-mips64el -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda"
 
 The login prompt will appear in the terminal that started Qemu. The
 graphical window is the framebuffer.
diff --git a/board/qemu/mips64r6-malta/readme.txt b/board/qemu/mips64r6-malta/readme.txt
index cfa16fd863..42fe49d7ef 100644
--- a/board/qemu/mips64r6-malta/readme.txt
+++ b/board/qemu/mips64r6-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-mips64 -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic
+qemu_mips64r6_malta_defconfig: qemu-system-mips64 -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/mips64r6el-malta/readme.txt b/board/qemu/mips64r6el-malta/readme.txt
index 61a6ceb5f4..bf4b839d52 100644
--- a/board/qemu/mips64r6el-malta/readme.txt
+++ b/board/qemu/mips64r6el-malta/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-mips64el -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic
+qemu_mips64r6el_malta_defconfig: qemu-system-mips64el -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/nios2-10m50/readme.txt b/board/qemu/nios2-10m50/readme.txt
index 44cbcb08a2..067f604d6c 100644
--- a/board/qemu/nios2-10m50/readme.txt
+++ b/board/qemu/nios2-10m50/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-nios2 -kernel output/images/vmlinux -nographic
+qemu_nios2_10m50_defconfig: qemu-system-nios2 -kernel output/images/vmlinux -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/or1k/readme.txt b/board/qemu/or1k/readme.txt
index df6b467e82..3ffd1069ea 100644
--- a/board/qemu/or1k/readme.txt
+++ b/board/qemu/or1k/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-or1k -kernel output/images/vmlinux -nographic
+qemu_or1k_defconfig: qemu-system-or1k -kernel output/images/vmlinux -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/ppc-g3beige/readme.txt b/board/qemu/ppc-g3beige/readme.txt
index 608814ee3b..206db3544d 100644
--- a/board/qemu/ppc-g3beige/readme.txt
+++ b/board/qemu/ppc-g3beige/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-ppc -M g3beige -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "console=ttyS0 rootwait root=/dev/hda" -serial stdio -net nic,model=rtl8139 -net user
+qemu_ppc_g3beige_defconfig: qemu-system-ppc -M g3beige -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "console=ttyS0 rootwait root=/dev/hda" -serial stdio -net nic,model=rtl8139 -net user
 
 The login prompt will appear in the terminal that started Qemu. The
 graphical window is the framebuffer.
diff --git a/board/qemu/ppc-mac99/readme.txt b/board/qemu/ppc-mac99/readme.txt
index a8a18db5b9..1e2976f7c9 100644
--- a/board/qemu/ppc-mac99/readme.txt
+++ b/board/qemu/ppc-mac99/readme.txt
@@ -1,5 +1,5 @@
 Run the emulation with:
 
-  qemu-system-ppc -nographic -vga none -M mac99 -cpu g4 -m 1G -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -net nic,model=sungem -net user -append "root=/dev/sda"
+qemu_ppc_mac99_defconfig: qemu-system-ppc -nographic -vga none -M mac99 -cpu g4 -m 1G -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -net nic,model=sungem -net user -append "root=/dev/sda"
 
 Tested with QEMU 3.1.0
diff --git a/board/qemu/ppc-mpc8544ds/readme.txt b/board/qemu/ppc-mpc8544ds/readme.txt
index 172aad5626..dd24aa2445 100644
--- a/board/qemu/ppc-mpc8544ds/readme.txt
+++ b/board/qemu/ppc-mpc8544ds/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-ppc -M mpc8544ds -kernel output/images/vmlinux -serial stdio -net nic,model=e1000 -net user
+qemu_ppc_mpc8544ds_defconfig: qemu-system-ppc -M mpc8544ds -kernel output/images/vmlinux -serial stdio -net nic,model=e1000 -net user
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/ppc-virtex-ml507/readme.txt b/board/qemu/ppc-virtex-ml507/readme.txt
index 6178ace816..0cc458872d 100644
--- a/board/qemu/ppc-virtex-ml507/readme.txt
+++ b/board/qemu/ppc-virtex-ml507/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-ppc -M virtex-ml507 -kernel output/images/vmlinux -m 256 -nographic -append "console=ttyS0" -dtb output/images/virtex440-ml507.dtb
+qemu_ppc_virtex_ml507_defconfig: qemu-system-ppc -M virtex-ml507 -kernel output/images/vmlinux -m 256 -nographic -append "console=ttyS0" -dtb output/images/virtex440-ml507.dtb
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/ppc64-e5500/readme.txt b/board/qemu/ppc64-e5500/readme.txt
index 8080766984..072ee098f9 100644
--- a/board/qemu/ppc64-e5500/readme.txt
+++ b/board/qemu/ppc64-e5500/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-ppc64 -M ppce500 -cpu e5500 -m 256 -kernel output/images/uImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "console=ttyS0 rootwait root=/dev/vda" -serial mon:stdio -nographic
+qemu_ppc64_e5500_defconfig: qemu-system-ppc64 -M ppce500 -cpu e5500 -m 256 -kernel output/images/uImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "console=ttyS0 rootwait root=/dev/vda" -serial mon:stdio -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/ppc64-pseries/readme.txt b/board/qemu/ppc64-pseries/readme.txt
index 6a3e96a2e5..a75d883cc6 100644
--- a/board/qemu/ppc64-pseries/readme.txt
+++ b/board/qemu/ppc64-pseries/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
- qemu-system-ppc64 -M pseries -cpu POWER7 -m 256 -kernel output/images/vmlinux -append "console=hvc0 rootwait root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses
+qemu_ppc64_pseries_defconfig: qemu-system-ppc64 -M pseries -cpu POWER7 -m 256 -kernel output/images/vmlinux -append "console=hvc0 rootwait root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/ppc64le-pseries/readme.txt b/board/qemu/ppc64le-pseries/readme.txt
index 2728675df2..8e0fc4a94f 100644
--- a/board/qemu/ppc64le-pseries/readme.txt
+++ b/board/qemu/ppc64le-pseries/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-qemu-system-ppc64 -M pseries -cpu POWER8 -m 256 -kernel output/images/vmlinux -append "console=hvc0 rootwait root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses
+qemu_ppc64le_pseries_defconfig: qemu-system-ppc64 -M pseries -cpu POWER8 -m 256 -kernel output/images/vmlinux -append "console=hvc0 rootwait root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses
 
 The login prompt will appear in the terminal window.
 
diff --git a/board/qemu/riscv32-virt/readme.txt b/board/qemu/riscv32-virt/readme.txt
index 5d7c1988d2..18803023f7 100644
--- a/board/qemu/riscv32-virt/readme.txt
+++ b/board/qemu/riscv32-virt/readme.txt
@@ -1,6 +1,6 @@
 Run Linux in emulation with:
 
-  qemu-system-riscv32 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80400000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
+qemu_riscv32_virt_defconfig: qemu-system-riscv32 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80400000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/riscv64-virt/readme.txt b/board/qemu/riscv64-virt/readme.txt
index c075cc464d..41154da7c6 100644
--- a/board/qemu/riscv64-virt/readme.txt
+++ b/board/qemu/riscv64-virt/readme.txt
@@ -1,6 +1,6 @@
 Run Linux in emulation with:
 
-  qemu-system-riscv64 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80200000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
+qemu_riscv64_virt_defconfig: qemu-system-riscv64 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80200000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/sh4-r2d/readme.txt b/board/qemu/sh4-r2d/readme.txt
index dd80953b97..86778a7e0b 100644
--- a/board/qemu/sh4-r2d/readme.txt
+++ b/board/qemu/sh4-r2d/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-sh4 -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "rootwait root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user
+qemu_sh4_r2d_defconfig: qemu-system-sh4 -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "rootwait root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user
 
 The login prompt will appear in the terminal that started Qemu.
 The graphical window is the framebuffer.
diff --git a/board/qemu/sh4eb-r2d/readme.txt b/board/qemu/sh4eb-r2d/readme.txt
index e71a9bce90..4ee690e9cc 100644
--- a/board/qemu/sh4eb-r2d/readme.txt
+++ b/board/qemu/sh4eb-r2d/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-sh4eb -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "rootwait root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user
+qemu_sh4eb_r2d_defconfig: qemu-system-sh4eb -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "rootwait root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user
 
 The login prompt will appear in the terminal that started Qemu.
 The graphical window is the framebuffer.
diff --git a/board/qemu/sparc-ss10/readme.txt b/board/qemu/sparc-ss10/readme.txt
index 33833c2d33..a79f0935a7 100644
--- a/board/qemu/sparc-ss10/readme.txt
+++ b/board/qemu/sparc-ss10/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-sparc -M SS-10 -kernel output/images/zImage -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/sda console=ttyS0,115200" -serial stdio -net nic,model=lance -net user
+qemu_sparc_ss10_defconfig: qemu-system-sparc -M SS-10 -kernel output/images/zImage -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/sda console=ttyS0,115200" -serial stdio -net nic,model=lance -net user
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/sparc64-sun4u/readme.txt b/board/qemu/sparc64-sun4u/readme.txt
index f2e6e81a86..7d35e1a74c 100644
--- a/board/qemu/sparc64-sun4u/readme.txt
+++ b/board/qemu/sparc64-sun4u/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-sparc64 -M sun4u -kernel output/images/vmlinux -append "rootwait root=/dev/sda console=ttyS0,115200" -serial stdio -drive file=output/images/rootfs.ext2,format=raw -net nic,model=e1000 -net user
+qemu_sparc64_sun4u_defconfig: qemu-system-sparc64 -M sun4u -kernel output/images/vmlinux -append "rootwait root=/dev/sda console=ttyS0,115200" -serial stdio -drive file=output/images/rootfs.ext2,format=raw -net nic,model=e1000 -net user
 
 The login prompt will appear in the terminal that started Qemu.
 
diff --git a/board/qemu/x86/readme.txt b/board/qemu/x86/readme.txt
index 3bbafecf91..79ed04b287 100644
--- a/board/qemu/x86/readme.txt
+++ b/board/qemu/x86/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
+qemu_x86_defconfig: qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
 
 Optionally add -smp N to emulate a SMP system with N CPUs.
 
diff --git a/board/qemu/x86_64/readme.txt b/board/qemu/x86_64/readme.txt
index 93ac22a947..e5031106df 100644
--- a/board/qemu/x86_64/readme.txt
+++ b/board/qemu/x86_64/readme.txt
@@ -1,6 +1,6 @@
 Run the emulation with:
 
-  qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
+qemu_x86_64_defconfig: qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
 
 Optionally add -smp N to emulate a SMP system with N CPUs.
 
diff --git a/board/qemu/xtensa-lx60/readme.txt b/board/qemu/xtensa-lx60/readme.txt
index 4287e1f09e..9a7f45e5ad 100644
--- a/board/qemu/xtensa-lx60/readme.txt
+++ b/board/qemu/xtensa-lx60/readme.txt
@@ -1,6 +1,8 @@
 Run the emulation with:
 
- qemu-system-xtensa -M lx60 -cpu dc233c -monitor null -nographic -kernel output/images/Image.elf
+qemu_xtensa_lx60_defconfig: qemu-system-xtensa -M lx60 -cpu dc233c -monitor null -nographic -kernel output/images/Image.elf
+
+qemu_xtensa_lx60_nommu_defconfig: qemu-system-xtensa -M lx60 -cpu dc233c -monitor null -nographic -kernel output/images/Image.elf
 
 The login prompt will appear in the terminal that started Qemu.
 
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
                   ` (4 preceding siblings ...)
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-10 13:09   ` Thomas Petazzoni
  2020-02-10 13:13   ` Thomas Petazzoni
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 7/9] configs/qemu*: use the post-image script with "$(BR2_DEFCONFIG)" as argument Romain Naour
                   ` (2 subsequent siblings)
  8 siblings, 2 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

This commit add the same post-image script for each qemu board
in order to generate start-qemu.sh in BINARIES_DIR.
The start-qemu.sh script can be used by Buildroot user to start
Qemu or by a gitlab CI.

To find the correct qemu command line in the readme.txt, we use
the second post script argument which must contain "$(BR2_DEFCONFIG)"

  BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"

Doing a basename allow to retrieve the name of the defconfig
file (ex: qemu_aarch64_virt_defconfig) that should match
on on the "tag" previously introduced in the readme.txt.

The script start-qemu.sh is able to modify the qemu command
line if CI_JOB_NAME defined in the environment. This allow
to disable the graphical output and redirect serial I/Os to
console.

Only sh4/sh4eb needs a special handling by adding
"-serial stdio -display none" instead of "-display none".

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 board/qemu/aarch64-virt/post-image.sh     | 40 ++++++++++++++++++++++
 board/qemu/arm-versatile/post-image.sh    | 40 ++++++++++++++++++++++
 board/qemu/arm-vexpress-tz/post-image.sh  | 40 ++++++++++++++++++++++
 board/qemu/arm-vexpress/post-image.sh     | 40 ++++++++++++++++++++++
 board/qemu/csky/post-image.sh             | 40 ++++++++++++++++++++++
 board/qemu/m68k-mcf5208/post-image.sh     | 40 ++++++++++++++++++++++
 board/qemu/m68k-q800/post-image.sh        | 40 ++++++++++++++++++++++
 board/qemu/microblazebe-mmu/post-image.sh | 40 ++++++++++++++++++++++
 board/qemu/microblazeel-mmu/post-image.sh | 40 ++++++++++++++++++++++
 board/qemu/mips32r2-malta/post-image.sh   | 40 ++++++++++++++++++++++
 board/qemu/mips32r2el-malta/post-image.sh | 40 ++++++++++++++++++++++
 board/qemu/mips32r6-malta/post-image.sh   | 40 ++++++++++++++++++++++
 board/qemu/mips32r6el-malta/post-image.sh | 40 ++++++++++++++++++++++
 board/qemu/mips64-malta/post-image.sh     | 40 ++++++++++++++++++++++
 board/qemu/mips64el-malta/post-image.sh   | 40 ++++++++++++++++++++++
 board/qemu/mips64r6-malta/post-image.sh   | 40 ++++++++++++++++++++++
 board/qemu/mips64r6el-malta/post-image.sh | 40 ++++++++++++++++++++++
 board/qemu/nios2-10m50/post-image.sh      | 40 ++++++++++++++++++++++
 board/qemu/or1k/post-image.sh             | 40 ++++++++++++++++++++++
 board/qemu/ppc-g3beige/post-image.sh      | 40 ++++++++++++++++++++++
 board/qemu/ppc-mac99/post-image.sh        | 40 ++++++++++++++++++++++
 board/qemu/ppc-mpc8544ds/post-image.sh    | 40 ++++++++++++++++++++++
 board/qemu/ppc-virtex-ml507/post-image.sh | 40 ++++++++++++++++++++++
 board/qemu/ppc64-e5500/post-image.sh      | 40 ++++++++++++++++++++++
 board/qemu/ppc64-pseries/post-image.sh    | 40 ++++++++++++++++++++++
 board/qemu/ppc64le-pseries/post-image.sh  | 40 ++++++++++++++++++++++
 board/qemu/riscv32-virt/post-image.sh     | 40 ++++++++++++++++++++++
 board/qemu/riscv64-virt/post-image.sh     | 40 ++++++++++++++++++++++
 board/qemu/sh4-r2d/post-image.sh          | 41 +++++++++++++++++++++++
 board/qemu/sh4eb-r2d/post-image.sh        | 41 +++++++++++++++++++++++
 board/qemu/sparc-ss10/post-image.sh       | 40 ++++++++++++++++++++++
 board/qemu/sparc64-sun4u/post-image.sh    | 40 ++++++++++++++++++++++
 board/qemu/x86/post-image.sh              | 40 ++++++++++++++++++++++
 board/qemu/x86_64/post-image.sh           | 40 ++++++++++++++++++++++
 board/qemu/xtensa-lx60/post-image.sh      | 40 ++++++++++++++++++++++
 35 files changed, 1402 insertions(+)
 create mode 100755 board/qemu/aarch64-virt/post-image.sh
 create mode 100755 board/qemu/arm-versatile/post-image.sh
 create mode 100755 board/qemu/arm-vexpress-tz/post-image.sh
 create mode 100755 board/qemu/arm-vexpress/post-image.sh
 create mode 100755 board/qemu/csky/post-image.sh
 create mode 100755 board/qemu/m68k-mcf5208/post-image.sh
 create mode 100755 board/qemu/m68k-q800/post-image.sh
 create mode 100755 board/qemu/microblazebe-mmu/post-image.sh
 create mode 100755 board/qemu/microblazeel-mmu/post-image.sh
 create mode 100755 board/qemu/mips32r2-malta/post-image.sh
 create mode 100755 board/qemu/mips32r2el-malta/post-image.sh
 create mode 100755 board/qemu/mips32r6-malta/post-image.sh
 create mode 100755 board/qemu/mips32r6el-malta/post-image.sh
 create mode 100755 board/qemu/mips64-malta/post-image.sh
 create mode 100755 board/qemu/mips64el-malta/post-image.sh
 create mode 100755 board/qemu/mips64r6-malta/post-image.sh
 create mode 100755 board/qemu/mips64r6el-malta/post-image.sh
 create mode 100755 board/qemu/nios2-10m50/post-image.sh
 create mode 100755 board/qemu/or1k/post-image.sh
 create mode 100755 board/qemu/ppc-g3beige/post-image.sh
 create mode 100755 board/qemu/ppc-mac99/post-image.sh
 create mode 100755 board/qemu/ppc-mpc8544ds/post-image.sh
 create mode 100755 board/qemu/ppc-virtex-ml507/post-image.sh
 create mode 100755 board/qemu/ppc64-e5500/post-image.sh
 create mode 100755 board/qemu/ppc64-pseries/post-image.sh
 create mode 100755 board/qemu/ppc64le-pseries/post-image.sh
 create mode 100755 board/qemu/riscv32-virt/post-image.sh
 create mode 100755 board/qemu/riscv64-virt/post-image.sh
 create mode 100755 board/qemu/sh4-r2d/post-image.sh
 create mode 100755 board/qemu/sh4eb-r2d/post-image.sh
 create mode 100755 board/qemu/sparc-ss10/post-image.sh
 create mode 100755 board/qemu/sparc64-sun4u/post-image.sh
 create mode 100755 board/qemu/x86/post-image.sh
 create mode 100755 board/qemu/x86_64/post-image.sh
 create mode 100755 board/qemu/xtensa-lx60/post-image.sh

diff --git a/board/qemu/aarch64-virt/post-image.sh b/board/qemu/aarch64-virt/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/aarch64-virt/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/arm-versatile/post-image.sh b/board/qemu/arm-versatile/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/arm-versatile/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/arm-vexpress-tz/post-image.sh b/board/qemu/arm-vexpress-tz/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/arm-vexpress-tz/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/arm-vexpress/post-image.sh b/board/qemu/arm-vexpress/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/arm-vexpress/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/csky/post-image.sh b/board/qemu/csky/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/csky/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/m68k-mcf5208/post-image.sh b/board/qemu/m68k-mcf5208/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/m68k-mcf5208/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/m68k-q800/post-image.sh b/board/qemu/m68k-q800/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/m68k-q800/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/microblazebe-mmu/post-image.sh b/board/qemu/microblazebe-mmu/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/microblazebe-mmu/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/microblazeel-mmu/post-image.sh b/board/qemu/microblazeel-mmu/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/microblazeel-mmu/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips32r2-malta/post-image.sh b/board/qemu/mips32r2-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips32r2-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips32r2el-malta/post-image.sh b/board/qemu/mips32r2el-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips32r2el-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips32r6-malta/post-image.sh b/board/qemu/mips32r6-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips32r6-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips32r6el-malta/post-image.sh b/board/qemu/mips32r6el-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips32r6el-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips64-malta/post-image.sh b/board/qemu/mips64-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips64-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips64el-malta/post-image.sh b/board/qemu/mips64el-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips64el-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips64r6-malta/post-image.sh b/board/qemu/mips64r6-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips64r6-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/mips64r6el-malta/post-image.sh b/board/qemu/mips64r6el-malta/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/mips64r6el-malta/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/nios2-10m50/post-image.sh b/board/qemu/nios2-10m50/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/nios2-10m50/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/or1k/post-image.sh b/board/qemu/or1k/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/or1k/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/ppc-g3beige/post-image.sh b/board/qemu/ppc-g3beige/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/ppc-g3beige/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/ppc-mac99/post-image.sh b/board/qemu/ppc-mac99/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/ppc-mac99/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/ppc-mpc8544ds/post-image.sh b/board/qemu/ppc-mpc8544ds/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/ppc-mpc8544ds/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/ppc-virtex-ml507/post-image.sh b/board/qemu/ppc-virtex-ml507/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/ppc-virtex-ml507/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/ppc64-e5500/post-image.sh b/board/qemu/ppc64-e5500/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/ppc64-e5500/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/ppc64-pseries/post-image.sh b/board/qemu/ppc64-pseries/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/ppc64-pseries/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/ppc64le-pseries/post-image.sh b/board/qemu/ppc64le-pseries/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/ppc64le-pseries/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/riscv32-virt/post-image.sh b/board/qemu/riscv32-virt/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/riscv32-virt/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/riscv64-virt/post-image.sh b/board/qemu/riscv64-virt/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/riscv64-virt/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/sh4-r2d/post-image.sh b/board/qemu/sh4-r2d/post-image.sh
new file mode 100755
index 0000000000..a9fd8254db
--- /dev/null
+++ b/board/qemu/sh4-r2d/post-image.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        # Special case for SH4
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -serial stdio -display none"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/sh4eb-r2d/post-image.sh b/board/qemu/sh4eb-r2d/post-image.sh
new file mode 100755
index 0000000000..a9fd8254db
--- /dev/null
+++ b/board/qemu/sh4eb-r2d/post-image.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        # Special case for SH4
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -serial stdio -display none"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/sparc-ss10/post-image.sh b/board/qemu/sparc-ss10/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/sparc-ss10/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/sparc64-sun4u/post-image.sh b/board/qemu/sparc64-sun4u/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/sparc64-sun4u/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/x86/post-image.sh b/board/qemu/x86/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/x86/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/x86_64/post-image.sh b/board/qemu/x86_64/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/x86_64/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
diff --git a/board/qemu/xtensa-lx60/post-image.sh b/board/qemu/xtensa-lx60/post-image.sh
new file mode 100755
index 0000000000..6b73b75feb
--- /dev/null
+++ b/board/qemu/xtensa-lx60/post-image.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+DEFCONFIG_NAME="$(basename $2)"
+README_FILE="${BOARD_DIR}/readme.txt"
+START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh"
+
+if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then
+    # Not a Qemu defconfig, can't test.
+    return
+fi
+
+if [ -f $README_FILE ]; then
+    QEMU_CMD_LINE=$(cat $README_FILE | sed -r "/^${DEFCONFIG_NAME}: /!d; :a; /\\$/N; s/\\\n//; ta; s/^[^:]+://")
+
+    if [ -z "$QEMU_CMD_LINE" ]; then
+    # No Qemu cmd line found, can't test.
+    return
+    fi
+
+    # Replace output/images path by ${IMAGE_DIR} since the script
+    # will be in the same directory as the kernel and the rootfs images.
+    QEMU_CMD_LINE=${QEMU_CMD_LINE//output\/images/\${IMAGE_DIR\}}
+
+    # Test if we are running in gitlab
+    if [ -n "$CI_JOB_NAME" ]; then
+        # Remove -serial stdio if present
+        QEMU_CMD_LINE=${QEMU_CMD_LINE//-serial stdio/}
+        # Disable graphical output and redirect serial I/Os to console
+        QEMU_CMD_LINE="$QEMU_CMD_LINE -nographic"
+    fi
+
+    cat << EOF > $START_QEMU_SCRIPT
+#!/bin/sh
+IMAGE_DIR="\$(dirname \$0)"
+
+$QEMU_CMD_LINE
+EOF
+    chmod +x $START_QEMU_SCRIPT
+fi
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 7/9] configs/qemu*: use the post-image script with "$(BR2_DEFCONFIG)" as argument.
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
                   ` (5 preceding siblings ...)
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 8/9] support/scripts/boot-qemu-image.py: boot Qemu images with Qemu-system Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 9/9] gitlab.yml.in*: enable Qemu gitlab testing Romain Naour
  8 siblings, 0 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

This commit allow to use the post-image script previously added
for each qemu board.

Add "$(BR2_DEFCONFIG)" as post-image script argument to retried
the qemu command line.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 configs/qemu_aarch64_virt_defconfig        | 4 ++++
 configs/qemu_arm_versatile_defconfig       | 4 ++++
 configs/qemu_arm_versatile_nommu_defconfig | 4 ++++
 configs/qemu_arm_vexpress_defconfig        | 4 ++++
 configs/qemu_arm_vexpress_tz_defconfig     | 4 ++++
 configs/qemu_csky610_virt_defconfig        | 4 ++++
 configs/qemu_csky807_virt_defconfig        | 4 ++++
 configs/qemu_csky810_virt_defconfig        | 4 ++++
 configs/qemu_csky860_virt_defconfig        | 4 ++++
 configs/qemu_m68k_mcf5208_defconfig        | 4 ++++
 configs/qemu_m68k_q800_defconfig           | 4 ++++
 configs/qemu_microblazebe_mmu_defconfig    | 4 ++++
 configs/qemu_microblazeel_mmu_defconfig    | 4 ++++
 configs/qemu_mips32r2_malta_defconfig      | 4 ++++
 configs/qemu_mips32r2el_malta_defconfig    | 4 ++++
 configs/qemu_mips32r6_malta_defconfig      | 4 ++++
 configs/qemu_mips32r6el_malta_defconfig    | 4 ++++
 configs/qemu_mips64_malta_defconfig        | 4 ++++
 configs/qemu_mips64el_malta_defconfig      | 4 ++++
 configs/qemu_mips64r6_malta_defconfig      | 4 ++++
 configs/qemu_mips64r6el_malta_defconfig    | 4 ++++
 configs/qemu_nios2_10m50_defconfig         | 4 ++++
 configs/qemu_or1k_defconfig                | 4 ++++
 configs/qemu_ppc64_e5500_defconfig         | 4 ++++
 configs/qemu_ppc64_pseries_defconfig       | 4 ++++
 configs/qemu_ppc64le_pseries_defconfig     | 4 ++++
 configs/qemu_ppc_g3beige_defconfig         | 4 ++++
 configs/qemu_ppc_mac99_defconfig           | 4 ++++
 configs/qemu_ppc_mpc8544ds_defconfig       | 4 ++++
 configs/qemu_ppc_virtex_ml507_defconfig    | 4 ++++
 configs/qemu_riscv32_virt_defconfig        | 4 ++++
 configs/qemu_riscv64_virt_defconfig        | 4 ++++
 configs/qemu_sh4_r2d_defconfig             | 4 ++++
 configs/qemu_sh4eb_r2d_defconfig           | 4 ++++
 configs/qemu_sparc64_sun4u_defconfig       | 4 ++++
 configs/qemu_sparc_ss10_defconfig          | 4 ++++
 configs/qemu_x86_64_defconfig              | 4 ++++
 configs/qemu_x86_defconfig                 | 4 ++++
 configs/qemu_xtensa_lx60_defconfig         | 4 ++++
 configs/qemu_xtensa_lx60_nommu_defconfig   | 4 ++++
 40 files changed, 160 insertions(+)

diff --git a/configs/qemu_aarch64_virt_defconfig b/configs/qemu_aarch64_virt_defconfig
index 6a9bc25bea..e80d536e65 100644
--- a/configs/qemu_aarch64_virt_defconfig
+++ b/configs/qemu_aarch64_virt_defconfig
@@ -11,6 +11,10 @@ BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-virt/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_arm_versatile_defconfig b/configs/qemu_arm_versatile_defconfig
index 42d29e3bf3..c6904827bf 100644
--- a/configs/qemu_arm_versatile_defconfig
+++ b/configs/qemu_arm_versatile_defconfig
@@ -10,6 +10,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/arm-versatile/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_arm_versatile_nommu_defconfig b/configs/qemu_arm_versatile_nommu_defconfig
index 6e4de0a0dd..60115c9edb 100644
--- a/configs/qemu_arm_versatile_nommu_defconfig
+++ b/configs/qemu_arm_versatile_nommu_defconfig
@@ -21,6 +21,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/arm-versatile/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_arm_vexpress_defconfig b/configs/qemu_arm_vexpress_defconfig
index 188fd72014..ac62f4c894 100644
--- a/configs/qemu_arm_vexpress_defconfig
+++ b/configs/qemu_arm_vexpress_defconfig
@@ -13,6 +13,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/arm-vexpress/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_arm_vexpress_tz_defconfig b/configs/qemu_arm_vexpress_tz_defconfig
index ccc0dca3ec..ebc8653e69 100644
--- a/configs/qemu_arm_vexpress_tz_defconfig
+++ b/configs/qemu_arm_vexpress_tz_defconfig
@@ -12,6 +12,10 @@ BR2_TARGET_ROOTFS_CPIO=y
 BR2_TARGET_ROOTFS_CPIO_GZIP=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/arm-vexpress-tz/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 BR2_LINUX_KERNEL=y
diff --git a/configs/qemu_csky610_virt_defconfig b/configs/qemu_csky610_virt_defconfig
index f337bd7eb4..d01b6e5129 100644
--- a/configs/qemu_csky610_virt_defconfig
+++ b/configs/qemu_csky610_virt_defconfig
@@ -5,6 +5,10 @@ BR2_ck610=y
 # System
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/csky/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # linux kernel header, the same version with linux kernel
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_0=y
 
diff --git a/configs/qemu_csky807_virt_defconfig b/configs/qemu_csky807_virt_defconfig
index c4a10b8ade..442ebbf725 100644
--- a/configs/qemu_csky807_virt_defconfig
+++ b/configs/qemu_csky807_virt_defconfig
@@ -5,6 +5,10 @@ BR2_ck807=y
 # System
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/csky/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # linux kernel header, the same version with linux kernel
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_0=y
 
diff --git a/configs/qemu_csky810_virt_defconfig b/configs/qemu_csky810_virt_defconfig
index 56efe8a6ae..c5d53a904e 100644
--- a/configs/qemu_csky810_virt_defconfig
+++ b/configs/qemu_csky810_virt_defconfig
@@ -5,6 +5,10 @@ BR2_ck810=y
 # System
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/csky/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # linux kernel header, the same version with linux kernel
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_0=y
 
diff --git a/configs/qemu_csky860_virt_defconfig b/configs/qemu_csky860_virt_defconfig
index 9ec8f633af..2cc3f2d76e 100644
--- a/configs/qemu_csky860_virt_defconfig
+++ b/configs/qemu_csky860_virt_defconfig
@@ -5,6 +5,10 @@ BR2_ck860=y
 # System
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/csky/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # linux kernel header, the same version with linux kernel
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_0=y
 
diff --git a/configs/qemu_m68k_mcf5208_defconfig b/configs/qemu_m68k_mcf5208_defconfig
index a2cadffa92..fab80a494d 100644
--- a/configs/qemu_m68k_mcf5208_defconfig
+++ b/configs/qemu_m68k_mcf5208_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_INITRAMFS=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/m68k-mcf5208/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_m68k_q800_defconfig b/configs/qemu_m68k_q800_defconfig
index e2a5f27431..e20901de71 100644
--- a/configs/qemu_m68k_q800_defconfig
+++ b/configs/qemu_m68k_q800_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/m68k-q800/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_microblazebe_mmu_defconfig b/configs/qemu_microblazebe_mmu_defconfig
index 2bcf13e085..15223efd32 100644
--- a/configs/qemu_microblazebe_mmu_defconfig
+++ b/configs/qemu_microblazebe_mmu_defconfig
@@ -10,6 +10,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyUL0"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/microblazebe-mmu/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_microblazeel_mmu_defconfig b/configs/qemu_microblazeel_mmu_defconfig
index 4352ad6873..79fddee223 100644
--- a/configs/qemu_microblazeel_mmu_defconfig
+++ b/configs/qemu_microblazeel_mmu_defconfig
@@ -10,6 +10,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyUL0"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/microblazeel-mmu/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips32r2_malta_defconfig b/configs/qemu_mips32r2_malta_defconfig
index baacc3cc83..7453c09c3a 100644
--- a/configs/qemu_mips32r2_malta_defconfig
+++ b/configs/qemu_mips32r2_malta_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips32r2-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips32r2el_malta_defconfig b/configs/qemu_mips32r2el_malta_defconfig
index 35ad64368e..23e4ae46bb 100644
--- a/configs/qemu_mips32r2el_malta_defconfig
+++ b/configs/qemu_mips32r2el_malta_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips32r2el-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips32r6_malta_defconfig b/configs/qemu_mips32r6_malta_defconfig
index a0553ed964..f3bcdf05eb 100644
--- a/configs/qemu_mips32r6_malta_defconfig
+++ b/configs/qemu_mips32r6_malta_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips32r6-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips32r6el_malta_defconfig b/configs/qemu_mips32r6el_malta_defconfig
index aaace9540b..b6f6bea26c 100644
--- a/configs/qemu_mips32r6el_malta_defconfig
+++ b/configs/qemu_mips32r6el_malta_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips32r6el-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips64_malta_defconfig b/configs/qemu_mips64_malta_defconfig
index 2a8b50a18f..b989468b0b 100644
--- a/configs/qemu_mips64_malta_defconfig
+++ b/configs/qemu_mips64_malta_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips64-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips64el_malta_defconfig b/configs/qemu_mips64el_malta_defconfig
index 1d9d0807d0..f17ecd5e3e 100644
--- a/configs/qemu_mips64el_malta_defconfig
+++ b/configs/qemu_mips64el_malta_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips64el-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips64r6_malta_defconfig b/configs/qemu_mips64r6_malta_defconfig
index ed42042292..6ecda76440 100644
--- a/configs/qemu_mips64r6_malta_defconfig
+++ b/configs/qemu_mips64r6_malta_defconfig
@@ -10,6 +10,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips64r6-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_mips64r6el_malta_defconfig b/configs/qemu_mips64r6el_malta_defconfig
index 7f4f28a708..d0e59ec46e 100644
--- a/configs/qemu_mips64r6el_malta_defconfig
+++ b/configs/qemu_mips64r6el_malta_defconfig
@@ -10,6 +10,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/mips64r6el-malta/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_nios2_10m50_defconfig b/configs/qemu_nios2_10m50_defconfig
index 48d1513846..39b592dde7 100644
--- a/configs/qemu_nios2_10m50_defconfig
+++ b/configs/qemu_nios2_10m50_defconfig
@@ -6,6 +6,10 @@ BR2_LINUX_KERNEL_DEFCONFIG="10m50"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/nios2-10m50/linux.fragment"
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/nios2-10m50/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_or1k_defconfig b/configs/qemu_or1k_defconfig
index 60147acd4b..b24bd0a92f 100644
--- a/configs/qemu_or1k_defconfig
+++ b/configs/qemu_or1k_defconfig
@@ -5,6 +5,10 @@ BR2_or1k=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/or1k/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4,19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_ppc64_e5500_defconfig b/configs/qemu_ppc64_e5500_defconfig
index 3c71c17e0a..665c0865cc 100644
--- a/configs/qemu_ppc64_e5500_defconfig
+++ b/configs/qemu_ppc64_e5500_defconfig
@@ -5,6 +5,10 @@ BR2_powerpc_e5500=y
 # Serial port config
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/ppc64-e5500/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as the kernel
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_ppc64_pseries_defconfig b/configs/qemu_ppc64_pseries_defconfig
index 42856a52b7..f01cab68b6 100644
--- a/configs/qemu_ppc64_pseries_defconfig
+++ b/configs/qemu_ppc64_pseries_defconfig
@@ -10,6 +10,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/ppc64-pseries/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_ppc64le_pseries_defconfig b/configs/qemu_ppc64le_pseries_defconfig
index 653d111953..84948111f9 100644
--- a/configs/qemu_ppc64le_pseries_defconfig
+++ b/configs/qemu_ppc64le_pseries_defconfig
@@ -10,6 +10,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/ppc64le-pseries/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_ppc_g3beige_defconfig b/configs/qemu_ppc_g3beige_defconfig
index acb9d86fb6..cedc06d624 100644
--- a/configs/qemu_ppc_g3beige_defconfig
+++ b/configs/qemu_ppc_g3beige_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/ppc-g3beige/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_ppc_mac99_defconfig b/configs/qemu_ppc_mac99_defconfig
index 496b0fb2a4..f211b0fd42 100644
--- a/configs/qemu_ppc_mac99_defconfig
+++ b/configs/qemu_ppc_mac99_defconfig
@@ -25,6 +25,10 @@ BR2_TARGET_ROOTFS_CPIO=y
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/ppc-mac99/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # host-qemu for gitlab testing
 BR2_PACKAGE_HOST_QEMU=y
 BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
diff --git a/configs/qemu_ppc_mpc8544ds_defconfig b/configs/qemu_ppc_mpc8544ds_defconfig
index 66bc1d2089..91fa00320c 100644
--- a/configs/qemu_ppc_mpc8544ds_defconfig
+++ b/configs/qemu_ppc_mpc8544ds_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/ppc-mpc8544ds/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_ppc_virtex_ml507_defconfig b/configs/qemu_ppc_virtex_ml507_defconfig
index c7c324d5e8..9cbf3e4513 100644
--- a/configs/qemu_ppc_virtex_ml507_defconfig
+++ b/configs/qemu_ppc_virtex_ml507_defconfig
@@ -6,6 +6,10 @@ BR2_powerpc_440=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/ppc-virtex-ml507/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_riscv32_virt_defconfig b/configs/qemu_riscv32_virt_defconfig
index 914eada004..c2f9df554d 100644
--- a/configs/qemu_riscv32_virt_defconfig
+++ b/configs/qemu_riscv32_virt_defconfig
@@ -11,6 +11,10 @@ BR2_GLOBAL_PATCH_DIR="board/qemu/riscv32-virt/patches/"
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/riscv32-virt/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 5.1 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_1=y
 
diff --git a/configs/qemu_riscv64_virt_defconfig b/configs/qemu_riscv64_virt_defconfig
index 5c52f7a0f8..3685f709c3 100644
--- a/configs/qemu_riscv64_virt_defconfig
+++ b/configs/qemu_riscv64_virt_defconfig
@@ -10,6 +10,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/riscv64-virt/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 5.1 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_1=y
 
diff --git a/configs/qemu_sh4_r2d_defconfig b/configs/qemu_sh4_r2d_defconfig
index c7c5126bf9..2fbc7ef7bd 100644
--- a/configs/qemu_sh4_r2d_defconfig
+++ b/configs/qemu_sh4_r2d_defconfig
@@ -11,6 +11,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttySC1"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/sh4-r2d/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_sh4eb_r2d_defconfig b/configs/qemu_sh4eb_r2d_defconfig
index 4d9559a387..1b0735c852 100644
--- a/configs/qemu_sh4eb_r2d_defconfig
+++ b/configs/qemu_sh4eb_r2d_defconfig
@@ -10,6 +10,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttySC1"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/sh4eb-r2d/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_sparc64_sun4u_defconfig b/configs/qemu_sparc64_sun4u_defconfig
index d7be664cbf..bc9edf01df 100644
--- a/configs/qemu_sparc64_sun4u_defconfig
+++ b/configs/qemu_sparc64_sun4u_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/sparc64-sun4u/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_sparc_ss10_defconfig b/configs/qemu_sparc_ss10_defconfig
index dada40d469..67008de9c6 100644
--- a/configs/qemu_sparc_ss10_defconfig
+++ b/configs/qemu_sparc_ss10_defconfig
@@ -9,6 +9,10 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_ROOTFS_EXT2=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/sparc-ss10/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_x86_64_defconfig b/configs/qemu_x86_64_defconfig
index b561e42e51..0b58d4f25f 100644
--- a/configs/qemu_x86_64_defconfig
+++ b/configs/qemu_x86_64_defconfig
@@ -11,6 +11,10 @@ BR2_TARGET_ROOTFS_EXT2=y
 # Image
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh"
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/x86_64/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_x86_defconfig b/configs/qemu_x86_defconfig
index 52f1744344..da24806a0b 100644
--- a/configs/qemu_x86_defconfig
+++ b/configs/qemu_x86_defconfig
@@ -12,6 +12,10 @@ BR2_TARGET_ROOTFS_EXT2=y
 # Image
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86/post-build.sh"
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/x86/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_xtensa_lx60_defconfig b/configs/qemu_xtensa_lx60_defconfig
index 7cf8c41fd4..11e598ef28 100644
--- a/configs/qemu_xtensa_lx60_defconfig
+++ b/configs/qemu_xtensa_lx60_defconfig
@@ -11,6 +11,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/xtensa-lx60/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
diff --git a/configs/qemu_xtensa_lx60_nommu_defconfig b/configs/qemu_xtensa_lx60_nommu_defconfig
index 8cb93f2d3d..25263432e7 100644
--- a/configs/qemu_xtensa_lx60_nommu_defconfig
+++ b/configs/qemu_xtensa_lx60_nommu_defconfig
@@ -15,6 +15,10 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_INITRAMFS=y
 
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/xtensa-lx60/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
 # Linux headers same as kernel, a 4.19 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 8/9] support/scripts/boot-qemu-image.py: boot Qemu images with Qemu-system.
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
                   ` (6 preceding siblings ...)
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 7/9] configs/qemu*: use the post-image script with "$(BR2_DEFCONFIG)" as argument Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 9/9] gitlab.yml.in*: enable Qemu gitlab testing Romain Naour
  8 siblings, 0 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

From: Jugurtha BELKALEM <jugurtha.belkalem@smile.fr>

This script is intended to be used by gitlab CI to test
at runtime Qemu images generated by Buildroot's Qemu defconfigs.

This allows to troubleshoot different issues that may be
associated with defective builds by lanching a qemu machine,
sending root password, waiting for login shell and then perform
a shutdown.

This script is inspired by toolchain builder [1] and the Buildroot
testing infrastructure.

Usage: boot-qemu-image.py <qemu_arch_defconfig>

The gitlab CI will call this script for each defconfig build but
only Qemu defconfig will be runtime tested, all others defconfig are
ignored. The script retrieve the qemu command line from start-qemu.sh
script. The start-qemu.sh script is no executed directly since we
want to handle the serial output with pexpect to detect the
shell, enter the password and powerdown the system.
If the script is missing, error out with a message in the log.

The script check is the corresponding Qemu binary (qemu-system) is
available, either built by Buildroot or available from the host.
Some Qemu defconfig must be used with a specific Qemu version (fork)
that is not always available. The script doesn't error out when
qemu-system is missing but a message is added in the log.

Finally, the script start Qemu like it's done for the Buildroot
testing infrastructure (using pexpect).

Note:
We noticed some timeout issues with pexpect when the Qemu machine is
powered off. That's because Qemu process doesn't stop even if the
system is halted (after "System halted"). So the script doesn't error
out when such timeout occure. The behaviour depends on the architecture
emulated by Qemu.

[1] https://github.com/bootlin/toolchains-builder/blob/master/build.sh

Signed-off-by: Jugurtha BELKALEM <jugurtha.belkalem@smile.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>

wip
---
 support/scripts/boot-qemu-image.py | 105 +++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100755 support/scripts/boot-qemu-image.py

diff --git a/support/scripts/boot-qemu-image.py b/support/scripts/boot-qemu-image.py
new file mode 100755
index 0000000000..abaf88d446
--- /dev/null
+++ b/support/scripts/boot-qemu-image.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+
+# This script expect to run from the Buildroot top directory.
+
+import pexpect
+import sys
+import os
+import re
+import shlex
+import shutil
+import subprocess
+
+argc = len(sys.argv)
+if not (argc == 2):
+    print("Error: incorrect number of arguments")
+    print("""Usage: boot-qemu-image.py <qemu_arch_defconfig>""")
+    sys.exit(1)
+
+defconfig_filename = sys.argv[1]
+
+# Ignore non Qemu defconfig
+if defconfig_filename.startswith('qemu_') is False:
+    sys.exit(0)
+
+qemu_start_script_filepath = os.path.join(os.getcwd(), 'output/images/start-qemu.sh')
+
+# Ignore if start-qemu.sh is missing, we can't test.
+if not os.path.exists(qemu_start_script_filepath):
+    print("Error: " + qemu_start_script_filepath) + " file is missing."
+    sys.exit(1)
+
+qemu_cmd = ""
+
+with open(qemu_start_script_filepath, 'r') as script_file:
+    for line in script_file:
+        if re.search("qemu-system", line):
+            qemu_cmd = line
+            break
+
+if not qemu_cmd:
+    print("Error: No QEMU command line found in " + qemu_start_script_filepath)
+    sys.exit(1)
+
+# Replace bashism
+qemu_cmd = line.replace("${IMAGE_DIR}", "output/images")
+
+# pexpect needs a list, convert a sting to a list and escape quoted substring.
+qemu_cmd = shlex.split(qemu_cmd)
+
+# Use host Qemu if provided by Buildroot.
+os.environ["PATH"] = os.getcwd() + "/output/host/bin" + os.pathsep + os.environ["PATH"]
+
+# Ignore when no Qemu emulation is available
+if not shutil.which(qemu_cmd[0]):
+    print("No " + qemu_cmd[0] + " binary available, THIS DEFCONFIG CAN NOT BE TESTED!")
+    sys.exit(0)
+
+
+def main():
+    global child
+
+    try:
+        child.expect(["buildroot login:", pexpect.TIMEOUT], timeout=60)
+    except pexpect.EOF:
+        print("Connection problem, exiting.")
+        sys.exit(1)
+    except pexpect.TIMEOUT:
+        print("System did not boot in time, exiting.")
+        sys.exit(1)
+
+    child.sendline("root\r")
+
+    try:
+        child.expect(["# ", pexpect.TIMEOUT], timeout=60)
+    except pexpect.EOF:
+        print("Cannot connect to shell")
+        sys.exit(1)
+    except pexpect.TIMEOUT:
+        print("Timeout while waiting for shell")
+        sys.exit(1)
+
+    child.sendline("poweroff\r")
+
+    try:
+        child.expect(["System halted", pexpect.TIMEOUT], timeout=60)
+        child.expect(pexpect.EOF)
+    except pexpect.EOF:
+        sys.exit(0)
+    except pexpect.TIMEOUT:
+        print("Cannot halt machine")
+        # Qemu may not exit properly after "System halted", ignore.
+        sys.exit(0)
+
+
+# Log the Qemu version
+subprocess.call([qemu_cmd[0], "--version"])
+
+# Log the Qemu command line
+print(qemu_cmd)
+
+child = pexpect.spawn(qemu_cmd[0], qemu_cmd[1:], timeout=5, encoding='utf-8',
+                      env={"QEMU_AUDIO_DRV": "none", 'PATH': os.environ["PATH"]})
+# We want only stdout into the log to avoid double echo
+child.logfile = sys.stdout
+main()
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 9/9] gitlab.yml.in*: enable Qemu gitlab testing
  2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
                   ` (7 preceding siblings ...)
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 8/9] support/scripts/boot-qemu-image.py: boot Qemu images with Qemu-system Romain Naour
@ 2020-02-09 18:03 ` Romain Naour
  8 siblings, 0 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:03 UTC (permalink / raw)
  To: buildroot

From: Jugurtha BELKALEM <jugurtha.belkalem@smile.fr>

Used to launch qemu tests for various qemu architectures.
Neverthless to say that this file skips any other job
different from qemu (only qemu configurations are
runtime tested).

Add the log generated by Qemu to the build artefacts.

Signed-off-by: Jugurtha BELKALEM <jugurtha.belkalem@smile.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 .gitlab-ci.yml    | 7 +++++++
 .gitlab-ci.yml.in | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a6436a8417..6341f6463a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -54,6 +54,12 @@ check-package:
                 tail -200 build.log
                 exit 1
             }
+        - |
+            ./support/scripts/boot-qemu-image.py "${DEFCONFIG_NAME}" > >(tee runtime-test.log) 2>&1 || {
+                echo 'Failed runtime test last output'
+                tail -200 runtime-test.log
+                exit 1
+            }
     artifacts:
         when: always
         expire_in: 2 weeks
@@ -64,6 +70,7 @@ check-package:
             - output/build/build-time.log
             - output/build/packages-file-list.txt
             - output/build/*/.config
+            - runtime-test.log
 
 .defconfig:
     extends: .defconfig_base
diff --git a/.gitlab-ci.yml.in b/.gitlab-ci.yml.in
index 7e6a7598ae..6b09730a65 100644
--- a/.gitlab-ci.yml.in
+++ b/.gitlab-ci.yml.in
@@ -54,6 +54,12 @@ check-package:
                 tail -200 build.log
                 exit 1
             }
+        - |
+            ./support/scripts/boot-qemu-image.py "${DEFCONFIG_NAME}" > >(tee runtime-test.log) 2>&1 || {
+                echo 'Failed runtime test last output'
+                tail -200 runtime-test.log
+                exit 1
+            }
     artifacts:
         when: always
         expire_in: 2 weeks
@@ -64,6 +70,7 @@ check-package:
             - output/build/build-time.log
             - output/build/packages-file-list.txt
             - output/build/*/.config
+            - runtime-test.log
 
 .defconfig:
     extends: .defconfig_base
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu Romain Naour
@ 2020-02-09 18:12   ` Romain Naour
  2020-02-09 18:49     ` Romain Naour
  0 siblings, 1 reply; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:12 UTC (permalink / raw)
  To: buildroot

Hi,

Le 09/02/2020 ? 19:03, Romain Naour a ?crit?:
> Building upstream host-qemu for m68k_q800 is useless
> since it doesn't support the q800 machine:
> 
> qemu-system-m68k: -M q800: unsupported machine type
> 
> This defconfig must be used with the QEMU fork from [1]
> using q800-v2.11.0 branch.
> 
> [1] https://github.com/vivier/qemu-m68k

This patch has been sent for the first time almost one year ago, since then
m68k_q800 port has been merged upstream and released with Qemu 4.2.0 [1]

I still need to check if it really work with our qemu defconfig.

[1]
https://git.qemu.org/?p=qemu.git;a=commit;h=04e7ca8d0f15a1c185f7b4b5c0de797730c2ed86

Best regards,
Romain

> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> ---
>  configs/qemu_m68k_q800_defconfig | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/configs/qemu_m68k_q800_defconfig b/configs/qemu_m68k_q800_defconfig
> index 2ef73d1dd6..e2a5f27431 100644
> --- a/configs/qemu_m68k_q800_defconfig
> +++ b/configs/qemu_m68k_q800_defconfig
> @@ -23,7 +23,3 @@ BR2_LINUX_KERNEL_VMLINUX=y
>  # Serial port config
>  BR2_TARGET_GENERIC_GETTY=y
>  BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
> -
> -# host-qemu for gitlab testing
> -BR2_PACKAGE_HOST_QEMU=y
> -BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu
  2020-02-09 18:12   ` Romain Naour
@ 2020-02-09 18:49     ` Romain Naour
  2020-02-16 21:24       ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: Romain Naour @ 2020-02-09 18:49 UTC (permalink / raw)
  To: buildroot

Le 09/02/2020 ? 19:12, Romain Naour a ?crit?:
> Hi,
> 
> Le 09/02/2020 ? 19:03, Romain Naour a ?crit?:
>> Building upstream host-qemu for m68k_q800 is useless
>> since it doesn't support the q800 machine:
>>
>> qemu-system-m68k: -M q800: unsupported machine type
>>
>> This defconfig must be used with the QEMU fork from [1]
>> using q800-v2.11.0 branch.
>>
>> [1] https://github.com/vivier/qemu-m68k
> 
> This patch has been sent for the first time almost one year ago, since then
> m68k_q800 port has been merged upstream and released with Qemu 4.2.0 [1]
> 
> I still need to check if it really work with our qemu defconfig.

Yes, our qemu m68k Q800 defconfig works well with qemu-system-m68k v4.2.0 :)

This patch can be dropped as soon as qemu 4.2.0 is merged in Buildroot.

Best regards,
Romain

> 
> [1]
> https://git.qemu.org/?p=qemu.git;a=commit;h=04e7ca8d0f15a1c185f7b4b5c0de797730c2ed86
> 
> Best regards,
> Romain
> 
>>
>> Signed-off-by: Romain Naour <romain.naour@smile.fr>
>> ---
>>  configs/qemu_m68k_q800_defconfig | 4 ----
>>  1 file changed, 4 deletions(-)
>>
>> diff --git a/configs/qemu_m68k_q800_defconfig b/configs/qemu_m68k_q800_defconfig
>> index 2ef73d1dd6..e2a5f27431 100644
>> --- a/configs/qemu_m68k_q800_defconfig
>> +++ b/configs/qemu_m68k_q800_defconfig
>> @@ -23,7 +23,3 @@ BR2_LINUX_KERNEL_VMLINUX=y
>>  # Serial port config
>>  BR2_TARGET_GENERIC_GETTY=y
>>  BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
>> -
>> -# host-qemu for gitlab testing
>> -BR2_PACKAGE_HOST_QEMU=y
>> -BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
>>
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing Romain Naour
@ 2020-02-10  2:31   ` Joel Stanley
  2020-02-16 21:23   ` Peter Korsgaard
  1 sibling, 0 replies; 26+ messages in thread
From: Joel Stanley @ 2020-02-10  2:31 UTC (permalink / raw)
  To: buildroot

On Sun, 9 Feb 2020 at 18:03, Romain Naour <romain.naour@smile.fr> wrote:
>
> The commit [1] added host-qemu package for each qemu defconfig
> for gitlab runtime testing.
>
> [1] 29e1cb88844614c40846540e22cf83aa9e52674f
>
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> Cc: Joel Stanley <joel@jms.id.au>

Acked-by: Joel Stanley <joel@jms.id.au>

> ---
>  configs/qemu_ppc_mac99_defconfig | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/configs/qemu_ppc_mac99_defconfig b/configs/qemu_ppc_mac99_defconfig
> index 4a7c7ce599..496b0fb2a4 100644
> --- a/configs/qemu_ppc_mac99_defconfig
> +++ b/configs/qemu_ppc_mac99_defconfig
> @@ -24,3 +24,7 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
>  BR2_TARGET_ROOTFS_CPIO=y
>  BR2_TARGET_ROOTFS_EXT2=y
>  # BR2_TARGET_ROOTFS_TAR is not set
> +
> +# host-qemu for gitlab testing
> +BR2_PACKAGE_HOST_QEMU=y
> +BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
> --
> 2.24.1
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols Romain Naour
@ 2020-02-10  2:32   ` Joel Stanley
  2020-02-16 21:22   ` Peter Korsgaard
  1 sibling, 0 replies; 26+ messages in thread
From: Joel Stanley @ 2020-02-10  2:32 UTC (permalink / raw)
  To: buildroot

On Sun, 9 Feb 2020 at 18:03, Romain Naour <romain.naour@smile.fr> wrote:
>
> This defconfig was generated by savedefconfig but we usually
> use a manually modified defconfig to add some comments for
> Kconfig symbols.
>
> No content change intended.
>
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> Cc: Joel Stanley <joel@jms.id.au>

I dislike this is as it means the file must be manually updated, but
if this is preferred then ok.

Acked-by: Joel Stanley <joel@jms.id.au>

> ---
>  configs/qemu_ppc_mac99_defconfig | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/configs/qemu_ppc_mac99_defconfig b/configs/qemu_ppc_mac99_defconfig
> index 9a33c3d82c..4a7c7ce599 100644
> --- a/configs/qemu_ppc_mac99_defconfig
> +++ b/configs/qemu_ppc_mac99_defconfig
> @@ -1,8 +1,14 @@
> +# Architecture
>  BR2_powerpc=y
>  BR2_powerpc_7400=y
> -BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
> +
> +# System
>  BR2_SYSTEM_DHCP="eth0"
> +
> +# Linux headers same as kernel, a 5.2 series
>  BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_2=y
> +
> +# Kernel
>  BR2_LINUX_KERNEL=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.2.4"
> @@ -10,6 +16,11 @@ BR2_LINUX_KERNEL_DEFCONFIG="pmac32"
>  BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/ppc-mac99/linux.fragment"
>  BR2_LINUX_KERNEL_VMLINUX=y
>  BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +
> +# Serial port config
> +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
> +
> +# Filesystem
>  BR2_TARGET_ROOTFS_CPIO=y
>  BR2_TARGET_ROOTFS_EXT2=y
>  # BR2_TARGET_ROOTFS_TAR is not set
> --
> 2.24.1
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line Romain Naour
@ 2020-02-10 13:08   ` Thomas Petazzoni
  2020-02-10 13:37     ` Romain Naour
  0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2020-02-10 13:08 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  9 Feb 2020 19:03:23 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> diff --git a/board/qemu/aarch64-virt/readme.txt b/board/qemu/aarch64-virt/readme.txt
> index f868905d91..3443de05a8 100644
> --- a/board/qemu/aarch64-virt/readme.txt
> +++ b/board/qemu/aarch64-virt/readme.txt
> @@ -1,6 +1,6 @@
>  Run the emulation with:
>  
> -  qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
> +qemu_aarch64_virt_defconfig: qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0

While I understand the idea, I believe this will potentially cause some
confusing for newcomers just getting started with Buildroot, and
potentially not too familiar with Linux.

Indeed, when one sees:

"""
Run the emulation with:

SOME COMPLICATED COMMAND
"""

One will clearly copy/paste "SOME COMPLICATED COMMAND", and here it
won't work anymore. So I understand that adding this metadata helps you
grepping through the readme.txt file to find the right command, but it
makes the instructions less directly usable by their original target:
newcomers to Buildroot.

One less bad option is to do it like this:

qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 # qemu_aarch64_virt_defconfig

This way, the information is still encoded on the same line, but it's a
comment, so if a newcomer copy/pastes that command line, it will really
work.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing Romain Naour
@ 2020-02-10 13:09   ` Thomas Petazzoni
  2020-02-10 13:47     ` Romain Naour
  2020-02-10 13:13   ` Thomas Petazzoni
  1 sibling, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2020-02-10 13:09 UTC (permalink / raw)
  To: buildroot

On Sun,  9 Feb 2020 19:03:24 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> This commit add the same post-image script for each qemu board
> in order to generate start-qemu.sh in BINARIES_DIR.
> The start-qemu.sh script can be used by Buildroot user to start
> Qemu or by a gitlab CI.
> 
> To find the correct qemu command line in the readme.txt, we use
> the second post script argument which must contain "$(BR2_DEFCONFIG)"
> 
>   BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
> 
> Doing a basename allow to retrieve the name of the defconfig
> file (ex: qemu_aarch64_virt_defconfig) that should match
> on on the "tag" previously introduced in the readme.txt.
> 
> The script start-qemu.sh is able to modify the qemu command
> line if CI_JOB_NAME defined in the environment. This allow
> to disable the graphical output and redirect serial I/Os to
> console.
> 
> Only sh4/sh4eb needs a special handling by adding
> "-serial stdio -display none" instead of "-display none".
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>

Why is this script copied a zillion times? This looks like a
maintenance nightmare. Why not put it in board/qemu/, and have a single
script used by all configurations ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing Romain Naour
  2020-02-10 13:09   ` Thomas Petazzoni
@ 2020-02-10 13:13   ` Thomas Petazzoni
  2020-02-10 13:49     ` Romain Naour
  1 sibling, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2020-02-10 13:13 UTC (permalink / raw)
  To: buildroot

On Sun,  9 Feb 2020 19:03:24 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> This commit add the same post-image script for each qemu board
> in order to generate start-qemu.sh in BINARIES_DIR.
> The start-qemu.sh script can be used by Buildroot user to start
> Qemu or by a gitlab CI.
> 
> To find the correct qemu command line in the readme.txt, we use
> the second post script argument which must contain "$(BR2_DEFCONFIG)"
> 
>   BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
> 
> Doing a basename allow to retrieve the name of the defconfig
> file (ex: qemu_aarch64_virt_defconfig) that should match
> on on the "tag" previously introduced in the readme.txt.
> 
> The script start-qemu.sh is able to modify the qemu command
> line if CI_JOB_NAME defined in the environment. This allow
> to disable the graphical output and redirect serial I/Os to
> console.
> 
> Only sh4/sh4eb needs a special handling by adding
> "-serial stdio -display none" instead of "-display none".
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>

Is it really a good idea to automatically start Qemu at the end of the
build of those defconfigs ? While I understand how it makes sense for
Gitlab CI, it is not very practical/convenient for normal users.

Can't we start the test under Qemu by a separate command from
.gitlab-ci.yml instead?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line
  2020-02-10 13:08   ` Thomas Petazzoni
@ 2020-02-10 13:37     ` Romain Naour
  2020-02-10 14:40       ` Thomas Petazzoni
  0 siblings, 1 reply; 26+ messages in thread
From: Romain Naour @ 2020-02-10 13:37 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Le 10/02/2020 ? 14:08, Thomas Petazzoni a ?crit?:
> Hello,
> 
> On Sun,  9 Feb 2020 19:03:23 +0100
> Romain Naour <romain.naour@smile.fr> wrote:
> 
>> diff --git a/board/qemu/aarch64-virt/readme.txt b/board/qemu/aarch64-virt/readme.txt
>> index f868905d91..3443de05a8 100644
>> --- a/board/qemu/aarch64-virt/readme.txt
>> +++ b/board/qemu/aarch64-virt/readme.txt
>> @@ -1,6 +1,6 @@
>>  Run the emulation with:
>>  
>> -  qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
>> +qemu_aarch64_virt_defconfig: qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0
> 
> While I understand the idea, I believe this will potentially cause some
> confusing for newcomers just getting started with Buildroot, and
> potentially not too familiar with Linux.
> 
> Indeed, when one sees:
> 
> """
> Run the emulation with:
> 
> SOME COMPLICATED COMMAND
> """
> 
> One will clearly copy/paste "SOME COMPLICATED COMMAND", and here it
> won't work anymore. So I understand that adding this metadata helps you
> grepping through the readme.txt file to find the right command, but it
> makes the instructions less directly usable by their original target:
> newcomers to Buildroot.
> 
> One less bad option is to do it like this:
> 
> qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 # qemu_aarch64_virt_defconfig
> 
> This way, the information is still encoded on the same line, but it's a
> comment, so if a newcomer copy/pastes that command line, it will really
> work.

Ok, I see your point.

I did this way since the qemu cmd line can be on several lines (see
board/qemu/arm-vexpress-tz/readme.txt).

Do we require that the qemu cmd line must be on one line ?

Best regards,
Romain

> 
> Best regards,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing
  2020-02-10 13:09   ` Thomas Petazzoni
@ 2020-02-10 13:47     ` Romain Naour
  2020-02-10 14:41       ` Thomas Petazzoni
  0 siblings, 1 reply; 26+ messages in thread
From: Romain Naour @ 2020-02-10 13:47 UTC (permalink / raw)
  To: buildroot

Le 10/02/2020 ? 14:09, Thomas Petazzoni a ?crit?:
> On Sun,  9 Feb 2020 19:03:24 +0100
> Romain Naour <romain.naour@smile.fr> wrote:
> 
>> This commit add the same post-image script for each qemu board
>> in order to generate start-qemu.sh in BINARIES_DIR.
>> The start-qemu.sh script can be used by Buildroot user to start
>> Qemu or by a gitlab CI.
>>
>> To find the correct qemu command line in the readme.txt, we use
>> the second post script argument which must contain "$(BR2_DEFCONFIG)"
>>
>>   BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
>>
>> Doing a basename allow to retrieve the name of the defconfig
>> file (ex: qemu_aarch64_virt_defconfig) that should match
>> on on the "tag" previously introduced in the readme.txt.
>>
>> The script start-qemu.sh is able to modify the qemu command
>> line if CI_JOB_NAME defined in the environment. This allow
>> to disable the graphical output and redirect serial I/Os to
>> console.
>>
>> Only sh4/sh4eb needs a special handling by adding
>> "-serial stdio -display none" instead of "-display none".
>>
>> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> 
> Why is this script copied a zillion times? This looks like a
> maintenance nightmare. Why not put it in board/qemu/, and have a single
> script used by all configurations ?

I'm not sure if we should share the same post-image script for several boards.
It's not clear how we should maintain theses scripts in board directory.

For example for genimage (post-image.sh) :
board/lego/ev3/post-image.sh
board/grinn/liteboard/post-image.sh
board/nexbox/a95x/post-image.sh

This is the same script.
Maybe we need something board/common/post-image.sh ?

For Qemu board, maybe add the script in board/qemu/common/post-image.sh.

There is also a special case for sh4, so I'll add a second script to add
"-serial stdio -display none" instead of "-display none"

Best regards,
Romain

> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing
  2020-02-10 13:13   ` Thomas Petazzoni
@ 2020-02-10 13:49     ` Romain Naour
  0 siblings, 0 replies; 26+ messages in thread
From: Romain Naour @ 2020-02-10 13:49 UTC (permalink / raw)
  To: buildroot

Le 10/02/2020 ? 14:13, Thomas Petazzoni a ?crit?:
> On Sun,  9 Feb 2020 19:03:24 +0100
> Romain Naour <romain.naour@smile.fr> wrote:
> 
>> This commit add the same post-image script for each qemu board
>> in order to generate start-qemu.sh in BINARIES_DIR.
>> The start-qemu.sh script can be used by Buildroot user to start
>> Qemu or by a gitlab CI.
>>
>> To find the correct qemu command line in the readme.txt, we use
>> the second post script argument which must contain "$(BR2_DEFCONFIG)"
>>
>>   BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
>>
>> Doing a basename allow to retrieve the name of the defconfig
>> file (ex: qemu_aarch64_virt_defconfig) that should match
>> on on the "tag" previously introduced in the readme.txt.
>>
>> The script start-qemu.sh is able to modify the qemu command
>> line if CI_JOB_NAME defined in the environment. This allow
>> to disable the graphical output and redirect serial I/Os to
>> console.
>>
>> Only sh4/sh4eb needs a special handling by adding
>> "-serial stdio -display none" instead of "-display none".
>>
>> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> 
> Is it really a good idea to automatically start Qemu at the end of the
> build of those defconfigs ? While I understand how it makes sense for
> Gitlab CI, it is not very practical/convenient for normal users.

Qemu is not started automatically at the end of the build.
The build process only create the script start-qemu.sh that must be called by
the user (or by the gitlab-ci).

> 
> Can't we start the test under Qemu by a separate command from
> .gitlab-ci.yml instead?

This is what this patch is doing :)

Best regards,
Romain

> 
> Thanks,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line
  2020-02-10 13:37     ` Romain Naour
@ 2020-02-10 14:40       ` Thomas Petazzoni
  0 siblings, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2020-02-10 14:40 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 10 Feb 2020 14:37:27 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> > qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 # qemu_aarch64_virt_defconfig
> > 
> > This way, the information is still encoded on the same line, but it's a
> > comment, so if a newcomer copy/pastes that command line, it will really
> > work.  
> 
> Ok, I see your point.
> 
> I did this way since the qemu cmd line can be on several lines (see
> board/qemu/arm-vexpress-tz/readme.txt).
> 
> Do we require that the qemu cmd line must be on one line ?

Is it really because it is on multiple lines that you need this marker?
Not because some readme.txt document several different defconfigs, and
you need to know which qemu command line corresponds to which defconfig
?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing
  2020-02-10 13:47     ` Romain Naour
@ 2020-02-10 14:41       ` Thomas Petazzoni
  0 siblings, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2020-02-10 14:41 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 10 Feb 2020 14:47:59 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> > Why is this script copied a zillion times? This looks like a
> > maintenance nightmare. Why not put it in board/qemu/, and have a single
> > script used by all configurations ?  
> 
> I'm not sure if we should share the same post-image script for several boards.

Why so? We already do that for NXP platforms for example.

> It's not clear how we should maintain theses scripts in board directory.
> 
> For example for genimage (post-image.sh) :
> board/lego/ev3/post-image.sh
> board/grinn/liteboard/post-image.sh
> board/nexbox/a95x/post-image.sh
> 
> This is the same script.
> Maybe we need something board/common/post-image.sh ?
> 
> For Qemu board, maybe add the script in board/qemu/common/post-image.sh.

Yes, or just board/qemu/post-image.sh is sufficient.

> There is also a special case for sh4, so I'll add a second script to add
> "-serial stdio -display none" instead of "-display none"

No, just make a small condition in your script:

case ${defconfig} in
	qemu_sh4_defconfig)
		do something here
		;;
esac

and that's it.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols Romain Naour
  2020-02-10  2:32   ` Joel Stanley
@ 2020-02-16 21:22   ` Peter Korsgaard
  1 sibling, 0 replies; 26+ messages in thread
From: Peter Korsgaard @ 2020-02-16 21:22 UTC (permalink / raw)
  To: buildroot

>>>>> "Romain" == Romain Naour <romain.naour@smile.fr> writes:

 > This defconfig was generated by savedefconfig but we usually
 > use a manually modified defconfig to add some comments for
 > Kconfig symbols.

 > No content change intended.

 > Signed-off-by: Romain Naour <romain.naour@smile.fr>
 > Cc: Joel Stanley <joel@jms.id.au>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing Romain Naour
  2020-02-10  2:31   ` Joel Stanley
@ 2020-02-16 21:23   ` Peter Korsgaard
  1 sibling, 0 replies; 26+ messages in thread
From: Peter Korsgaard @ 2020-02-16 21:23 UTC (permalink / raw)
  To: buildroot

>>>>> "Romain" == Romain Naour <romain.naour@smile.fr> writes:

 > The commit [1] added host-qemu package for each qemu defconfig
 > for gitlab runtime testing.

 > [1] 29e1cb88844614c40846540e22cf83aa9e52674f

 > Signed-off-by: Romain Naour <romain.naour@smile.fr>
 > Cc: Joel Stanley <joel@jms.id.au>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu
  2020-02-09 18:49     ` Romain Naour
@ 2020-02-16 21:24       ` Peter Korsgaard
  0 siblings, 0 replies; 26+ messages in thread
From: Peter Korsgaard @ 2020-02-16 21:24 UTC (permalink / raw)
  To: buildroot

>>>>> "Romain" == Romain Naour <romain.naour@smile.fr> writes:

 > Le 09/02/2020 ? 19:12, Romain Naour a ?crit?:
 >> Hi,
 >> 
 >> Le 09/02/2020 ? 19:03, Romain Naour a ?crit?:
 >>> Building upstream host-qemu for m68k_q800 is useless
 >>> since it doesn't support the q800 machine:
 >>> 
 >>> qemu-system-m68k: -M q800: unsupported machine type
 >>> 
 >>> This defconfig must be used with the QEMU fork from [1]
 >>> using q800-v2.11.0 branch.
 >>> 
 >>> [1] https://github.com/vivier/qemu-m68k
 >> 
 >> This patch has been sent for the first time almost one year ago, since then
 >> m68k_q800 port has been merged upstream and released with Qemu 4.2.0 [1]
 >> 
 >> I still need to check if it really work with our qemu defconfig.

 > Yes, our qemu m68k Q800 defconfig works well with qemu-system-m68k v4.2.0 :)

 > This patch can be dropped as soon as qemu 4.2.0 is merged in Buildroot.

I've merged the 4.2.0 bump, so I've marked this as rejected in
patchwork.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v4 4/9] configs/qemu{x86, x86_64}: add a serial console
  2020-02-09 18:03 ` [Buildroot] [PATCH v4 4/9] configs/qemu{x86, x86_64}: add a serial console Romain Naour
@ 2020-02-16 21:28   ` Peter Korsgaard
  0 siblings, 0 replies; 26+ messages in thread
From: Peter Korsgaard @ 2020-02-16 21:28 UTC (permalink / raw)
  To: buildroot

>>>>> "Romain" == Romain Naour <romain.naour@smile.fr> writes:

 > The current Buildroot defconfigs for qemu_x86 and qemu_x86_64
 > instantiate a console on tty1, which appears on QEMU's
 > graphical window. Add a console on the serial port (ttyS0) to
 > be used later for gitlab testing.

 > This change is need since the script used for gitlab testing
 > needs to use a serial output with pexpect.

 > This change is similar to the one made for raspberrypi [1] to
 > handle HDMI and serial console:

 > This requires three changes:
 >  1. have two 'console=' entries in the kernel command line: tty1,
 >     then ttyS0;
 >  2. change BR2_TARGET_GENERIC_GETTY_PORT to "console", so it starts
 >     a getty on the last console= passed to the kernel, ttyS0;
 >  3. add a new getty on tty1 to the generated inittab.

 > Step 2 is actually obtained by removing BR2_TARGET_GENERIC_GETTY_PORT
 > entirely from the defconfigs, since "console" is the default value.

 > Step 3 requires a post-build script since the Buildroot makefiles can
 > configure only one console.

 > Note: instead of simply adding a new getty on ttyS0 (which would
 > work) this patch actually changes BR2_TARGET_GENERIC_GETTY_PORT to
 > instantiate a console on UART, then adds back tty1 via
 > post-build.sh. This is done only to avoid the "GENERIC_SERIAL" comment
 > where we instantiate a console on QEMU graphical window, then
 > instantiate a really-serial console on another line.

 > The result is these two inittab lines:

 >   console::respawn:/sbin/getty -L  console 0 vt100 # GENERIC_SERIAL
 >   tty1::respawn:/sbin/getty -L  tty1 0 vt100 # QEMU graphical window

 > [1] 20878a1017e2bf7eb8c5f870dc6d2641493cb0f9

 > Signed-off-by: Romain Naour <romain.naour@smile.fr>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2020-02-16 21:28 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-09 18:03 [Buildroot] [PATCH v4 0/9] gitlab Qemu runtime testing Romain Naour
2020-02-09 18:03 ` [Buildroot] [PATCH v4 1/9] configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols Romain Naour
2020-02-10  2:32   ` Joel Stanley
2020-02-16 21:22   ` Peter Korsgaard
2020-02-09 18:03 ` [Buildroot] [PATCH v4 2/9] configs/qemu_pcc_mac99: build host-qemu for runtime testing Romain Naour
2020-02-10  2:31   ` Joel Stanley
2020-02-16 21:23   ` Peter Korsgaard
2020-02-09 18:03 ` [Buildroot] [PATCH v4 3/9] configs/qemu_m68k_q800: remove host-qemu Romain Naour
2020-02-09 18:12   ` Romain Naour
2020-02-09 18:49     ` Romain Naour
2020-02-16 21:24       ` Peter Korsgaard
2020-02-09 18:03 ` [Buildroot] [PATCH v4 4/9] configs/qemu{x86, x86_64}: add a serial console Romain Naour
2020-02-16 21:28   ` Peter Korsgaard
2020-02-09 18:03 ` [Buildroot] [PATCH v4 5/9] board/qemu: add defconfig file name as tag before the qemu command line Romain Naour
2020-02-10 13:08   ` Thomas Petazzoni
2020-02-10 13:37     ` Romain Naour
2020-02-10 14:40       ` Thomas Petazzoni
2020-02-09 18:03 ` [Buildroot] [PATCH v4 6/9] board/qemu: add post-image script for gitlab qemu testing Romain Naour
2020-02-10 13:09   ` Thomas Petazzoni
2020-02-10 13:47     ` Romain Naour
2020-02-10 14:41       ` Thomas Petazzoni
2020-02-10 13:13   ` Thomas Petazzoni
2020-02-10 13:49     ` Romain Naour
2020-02-09 18:03 ` [Buildroot] [PATCH v4 7/9] configs/qemu*: use the post-image script with "$(BR2_DEFCONFIG)" as argument Romain Naour
2020-02-09 18:03 ` [Buildroot] [PATCH v4 8/9] support/scripts/boot-qemu-image.py: boot Qemu images with Qemu-system Romain Naour
2020-02-09 18:03 ` [Buildroot] [PATCH v4 9/9] gitlab.yml.in*: enable Qemu gitlab testing Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.