gitlab Qemu runtime testing
Subsystems (4)
v4 cover gitlab Qemu runtime testing
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
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
Signature · 1 line
2.24.1
PATCH v4 1/9 configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols
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.
--- configs/qemu_ppc_mac99_defconfig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
configs/qemu_ppc_mac99_defconfig +12 -1
@@ -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
Signature · 1 line
2.24.1
PATCH v4 1/9 configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols
Quoted 9 lines · Romain Naour
This defconfig was generated by savedefconfig but we usually use a manually modified defconfig to add some comments for
Kconfigsymbols.No content change intended.
Signed-off-by Romain Naour <[email protected]>Cc Joel Stanley <[email protected]>
I dislike this is as it means the file must be manually updated, but if this is preferred then ok.
Quoted 39 lines
--- configs/qemu_ppc_mac99_defconfig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)configs/qemu_ppc_mac99_defconfig +12
-2@@ -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
PATCH v4 1/9 configs/qemu_ppc_mac99_defconfig: add usual comments for Kconfig symbols
In reply to Romain NaourQuoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Romain" == Romain Naour <[email protected]> writes:
This defconfig was generated by savedefconfig but we usually use a manually modified defconfig to add some comments for
Kconfigsymbols.No content change intended.
Signed-off-by Romain Naour <[email protected]>Cc Joel Stanley <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v4 2/9 configs/qemu_pcc_mac99: build host-qemu for runtime testing
In reply to Romain NaourThe commit [1] added host-qemu package for each qemu defconfig for gitlab runtime testing.
[1] 29e1cb88844614c40846540e22cf83aa9e52674f
--- configs/qemu_ppc_mac99_defconfig | 4 ++++ 1 file changed, 4 insertions(+)
configs/qemu_ppc_mac99_defconfig +4 -0
@@ -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
Signature · 1 line
2.24.1
PATCH v4 2/9 configs/qemu_pcc_mac99: build host-qemu for runtime testing
Quoted 8 lines · Romain Naour
The commit [1] added host-qemu package for each qemu defconfig for gitlab runtime testing.
[1]
29e1cb88844614c40846540e22cf83aa9e52674fSigned-off-by Romain Naour <[email protected]>Cc Joel Stanley <[email protected]>
Quoted 19 lines
--- configs/qemu_ppc_mac99_defconfig | 4 ++++ 1 file changed, 4 insertions(+)configs/qemu_ppc_mac99_defconfig +4
-1@@ -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
PATCH v4 2/9 configs/qemu_pcc_mac99: build host-qemu for runtime testing
In reply to Romain NaourQuoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Romain" == Romain Naour <[email protected]> writes:
The commit [1] added host-qemu package for each qemu defconfig for gitlab runtime testing.
[1]
29e1cb88844614c40846540e22cf83aa9e52674fSigned-off-by Romain Naour <[email protected]>Cc Joel Stanley <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v4 3/9 configs/qemu_m68k_q800: remove host-qemu
In reply to Romain NaourBuilding 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
--- configs/qemu_m68k_q800_defconfig | 4 ---- 1 file changed, 4 deletions(-)
configs/qemu_m68k_q800_defconfig +0 -4
@@ -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
Signature · 1 line
2.24.1
PATCH v4 3/9 configs/qemu_m68k_q800: remove host-qemu
Hi,
Le 09/02/2020 ? 19:03, Romain Naour a ?crit?:
Quoted 9 lines
Building upstream host-qemu for
m68k_q800is 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.
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
Quoted 19 lines
Signed-off-by Romain Naour <[email protected]>--- configs/qemu_m68k_q800_defconfig | 4 ---- 1 file changed, 4 deletions(-)configs/qemu_m68k_q800_defconfig +0
-4@@ -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
PATCH v4 3/9 configs/qemu_m68k_q800: remove host-qemu
Le 09/02/2020 ? 19:12, Romain Naour a ?crit?:
Quoted 11 lines
Hi,
Le 09/02/2020 ? 19:03, Romain Naour a ?crit?:
Quoted 8 lines
Building upstream host-qemu for
m68k_q800is 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.
Quoted 6 lines
Quoted 1 line
This patch has been sent for the first time almost one year ago, since then
m68k_q800port 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
Quoted 27 lines
[1]
https://git.qemu.org/?p=qemu.git;a=commit;h=04e7ca8d0f15a1c185f7b4b5c0de797730c2ed86Best regards,
RomainQuoted 19 lines
Signed-off-by Romain Naour <[email protected]>--- configs/qemu_m68k_q800_defconfig | 4 ---- 1 file changed, 4 deletions(-)configs/qemu_m68k_q800_defconfig +0
-4@@ -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
PATCH v4 3/9 configs/qemu_m68k_q800: remove host-qemu
Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Romain" == Romain Naour <[email protected]> writes:
Le 09/02/2020 ? 19:12, Romain Naour a ?crit?:
Quoted 13 lines
Hi,
Le 09/02/2020 ? 19:03, Romain Naour a ?crit?:
Quoted 9 lines
Building upstream host-qemu for
m68k_q800is 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.
Quoted 8 lines
Quoted 4 lines
This patch has been sent for the first time almost one year ago, since then
m68k_q800port 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.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v4 4/9 configs/qemu{x86, x86_64}: add a serial console
In reply to Romain NaourThe 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
--- 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
board/qemu/x86/post-build.sh new file +11 -0
@@ -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
board/qemu/x86/readme.txt +1 -1
@@ -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.
board/qemu/x86_64/post-build.sh new file +11 -0
@@ -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
board/qemu/x86_64/readme.txt +1 -1
@@ -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.
configs/qemu_x86_64_defconfig +3 -1
@@ -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
configs/qemu_x86_defconfig +3 -1
@@ -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
Signature · 1 line
2.24.1
PATCH v4 4/9 configs/qemu{x86, x86_64}: add a serial console
Quoted 33 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Romain" == Romain Naour <[email protected]> writes:
The current Buildroot defconfigs for
qemu_x86andqemu_x86_64instantiate 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_PORTentirely 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_PORTto instantiate a console on UART, then adds back tty1 viapost-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.
Quoted 8 lines
The result is these two inittab lines:
console::respawn:/sbin/getty -L console 0 vt100 #
GENERIC_SERIALtty1::respawn:/sbin/getty -L tty1 0 vt100 # QEMU graphical window[1]
20878a1017e2bf7eb8c5f870dc6d2641493cb0f9Signed-off-by Romain Naour <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v4 5/9 board/qemu: add defconfig file name as tag before the qemu command line
In reply to Romain NaourThis 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
--- 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(-)
board/qemu/aarch64-virt/readme.txt +1 -1
@@ -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.
board/qemu/arm-versatile/readme.txt +2 -2
@@ -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.
board/qemu/arm-vexpress-tz/readme.txt +1 -1
@@ -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 \
board/qemu/arm-vexpress/readme.txt +1 -1
@@ -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.
board/qemu/csky/readme.txt +7 -4
@@ -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.
board/qemu/m68k-mcf5208/readme.txt +1 -1
@@ -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.
board/qemu/m68k-q800/readme.txt +1 -1
@@ -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.
board/qemu/microblazebe-mmu/readme.txt +1 -1
@@ -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.
board/qemu/microblazeel-mmu/readme.txt +1 -1
@@ -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.
board/qemu/mips32r2-malta/readme.txt +1 -1
@@ -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
board/qemu/mips32r2el-malta/readme.txt +1 -1
@@ -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
board/qemu/mips32r6-malta/readme.txt +1 -1
@@ -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.
board/qemu/mips32r6el-malta/readme.txt +1 -1
@@ -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.
board/qemu/mips64-malta/readme.txt +1 -1
@@ -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.
board/qemu/mips64el-malta/readme.txt +1 -1
@@ -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.
board/qemu/mips64r6-malta/readme.txt +1 -1
@@ -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.
board/qemu/mips64r6el-malta/readme.txt +1 -1
@@ -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.
board/qemu/nios2-10m50/readme.txt +1 -1
@@ -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.
board/qemu/or1k/readme.txt +1 -1
@@ -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.
board/qemu/ppc-g3beige/readme.txt +1 -1
@@ -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.
board/qemu/ppc-mac99/readme.txt +1 -1
@@ -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
board/qemu/ppc-mpc8544ds/readme.txt +1 -1
@@ -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.
board/qemu/ppc-virtex-ml507/readme.txt +1 -1
@@ -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.
board/qemu/ppc64-e5500/readme.txt +1 -1
@@ -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.
board/qemu/ppc64-pseries/readme.txt +1 -1
@@ -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.
board/qemu/ppc64le-pseries/readme.txt +1 -1
@@ -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.
board/qemu/riscv32-virt/readme.txt +1 -1
@@ -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.
board/qemu/riscv64-virt/readme.txt +1 -1
@@ -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.
board/qemu/sh4-r2d/readme.txt +1 -1
@@ -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.
board/qemu/sh4eb-r2d/readme.txt +1 -1
@@ -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.
board/qemu/sparc-ss10/readme.txt +1 -1
@@ -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.
board/qemu/sparc64-sun4u/readme.txt +1 -1
@@ -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.
board/qemu/x86/readme.txt +1 -1
@@ -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.
board/qemu/x86_64/readme.txt +1 -1
@@ -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.
board/qemu/xtensa-lx60/readme.txt +3 -1
@@ -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.
Signature · 1 line
2.24.1
PATCH v4 5/9 board/qemu: add defconfig file name as tag before the qemu command line
Hello,
board/qemu/aarch64-virt/readme.txt line 3
Quoted 9 lines · On Sun, 9 Feb 2020 19:03:23 +0100 Romain Naour <[email protected]> wrote:
board/qemu/aarch64-virt/readme.txt +1
-1@@ -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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 5/9 board/qemu: add defconfig file name as tag before the qemu command line
Hi Thomas,
Le 10/02/2020 ? 14:08, Thomas Petazzoni a ?crit?:
Quoted 33 lines
Hello,
board/qemu/aarch64-virt/readme.txt line 3
Quoted 9 lines · On Sun, 9 Feb 2020 19:03:23 +0100 Romain Naour <[email protected]> wrote:
board/qemu/aarch64-virt/readme.txt +1
-1@@ -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=hd0While 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.
Quoted 7 lines
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_defconfigThis 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
Quoted 5 lines
Best regards,
Thomas
PATCH v4 5/9 board/qemu: add defconfig file name as tag before the qemu command line
Hello,
Quoted 6 lines · On Mon, 10 Feb 2020 14:37:27 +0100 Romain Naour <[email protected]> wrote:
Quoted 5 lines
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_defconfigThis 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.
Quoted 6 lines
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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 6/9 board/qemu: add post-image script for gitlab qemu testing
In reply to Romain NaourThis 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".
--- 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
board/qemu/aarch64-virt/post-image.sh new file +40 -0
@@ -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
board/qemu/arm-versatile/post-image.sh new file +40 -0
@@ -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
board/qemu/arm-vexpress-tz/post-image.sh new file +40 -0
@@ -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
board/qemu/arm-vexpress/post-image.sh new file +40 -0
@@ -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
board/qemu/csky/post-image.sh new file +40 -0
@@ -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
board/qemu/m68k-mcf5208/post-image.sh new file +40 -0
@@ -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
board/qemu/m68k-q800/post-image.sh new file +40 -0
@@ -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
board/qemu/microblazebe-mmu/post-image.sh new file +40 -0
@@ -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
board/qemu/microblazeel-mmu/post-image.sh new file +40 -0
@@ -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
board/qemu/mips32r2-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/mips32r2el-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/mips32r6-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/mips32r6el-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/mips64-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/mips64el-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/mips64r6-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/mips64r6el-malta/post-image.sh new file +40 -0
@@ -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
board/qemu/nios2-10m50/post-image.sh new file +40 -0
@@ -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
board/qemu/or1k/post-image.sh new file +40 -0
@@ -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
board/qemu/ppc-g3beige/post-image.sh new file +40 -0
@@ -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
board/qemu/ppc-mac99/post-image.sh new file +40 -0
@@ -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
board/qemu/ppc-mpc8544ds/post-image.sh new file +40 -0
@@ -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
board/qemu/ppc-virtex-ml507/post-image.sh new file +40 -0
@@ -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
board/qemu/ppc64-e5500/post-image.sh new file +40 -0
@@ -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
board/qemu/ppc64-pseries/post-image.sh new file +40 -0
@@ -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
board/qemu/ppc64le-pseries/post-image.sh new file +40 -0
@@ -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
board/qemu/riscv32-virt/post-image.sh new file +40 -0
@@ -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
board/qemu/riscv64-virt/post-image.sh new file +40 -0
@@ -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
board/qemu/sh4-r2d/post-image.sh new file +41 -0
41 lines not on this page · raw message
board/qemu/sh4eb-r2d/post-image.sh new file +41 -0
41 lines not on this page · raw message
board/qemu/sparc-ss10/post-image.sh new file +40 -0
@@ -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
board/qemu/sparc64-sun4u/post-image.sh new file +40 -0
@@ -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
board/qemu/x86/post-image.sh new file +40 -0
@@ -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
board/qemu/x86_64/post-image.sh new file +40 -0
@@ -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
board/qemu/xtensa-lx60/post-image.sh new file +40 -0
@@ -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
Signature · 1 line
2.24.1
PATCH v4 6/9 board/qemu: add post-image script for gitlab qemu testing
Quoted 19 lines · On Sun, 9 Feb 2020 19:03:24 +0100 Romain Naour <[email protected]> wrote:
This commit add the same post-image script for each qemu board in order to generate
start-qemu.shinBINARIES_DIR. Thestart-qemu.shscript 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.shis able to modify the qemu command line ifCI_JOB_NAMEdefined in the environment. This allow to disable the graphical output and redirect serial I/Os to console.
Quoted 4 lines
Only sh4/sh4eb needs a special handling by adding "-serial stdio -display none" instead of "-display none".
Signed-off-by Romain Naour <[email protected]>
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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 6/9 board/qemu: add post-image script for gitlab qemu testing
Le 10/02/2020 ? 14:09, Thomas Petazzoni a ?crit?:
Quoted 22 lines
Quoted 19 lines · On Sun, 9 Feb 2020 19:03:24 +0100 Romain Naour <[email protected]> wrote:
This commit add the same post-image script for each qemu board in order to generate
start-qemu.shinBINARIES_DIR. Thestart-qemu.shscript 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.shis able to modify the qemu command line ifCI_JOB_NAMEdefined in the environment. This allow to disable the graphical output and redirect serial I/Os to console.
Quoted 8 lines
Quoted 4 lines
Only sh4/sh4eb needs a special handling by adding "-serial stdio -display none" instead of "-display none".
Signed-off-by Romain Naour <[email protected]>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.shboard/grinn/liteboard/post-image.shboard/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
Quoted 3 lines
Thomas
PATCH v4 6/9 board/qemu: add post-image script for gitlab qemu testing
Hello,
Quoted 5 lines · On Mon, 10 Feb 2020 14:47:59 +0100 Romain Naour <[email protected]> wrote:
Quoted 3 lines
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.
Quoted 11 lines
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.shboard/grinn/liteboard/post-image.shboard/nexbox/a95x/post-image.shThis is the same script.
Maybe we need somethingboard/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.
Quoted 2 lines
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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 6/9 board/qemu: add post-image script for gitlab qemu testing
In reply to Romain NaourQuoted 19 lines · On Sun, 9 Feb 2020 19:03:24 +0100 Romain Naour <[email protected]> wrote:
This commit add the same post-image script for each qemu board in order to generate
start-qemu.shinBINARIES_DIR. Thestart-qemu.shscript 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.shis able to modify the qemu command line ifCI_JOB_NAMEdefined in the environment. This allow to disable the graphical output and redirect serial I/Os to console.
Quoted 4 lines
Only sh4/sh4eb needs a special handling by adding "-serial stdio -display none" instead of "-display none".
Signed-off-by Romain Naour <[email protected]>
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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 6/9 board/qemu: add post-image script for gitlab qemu testing
Le 10/02/2020 ? 14:13, Thomas Petazzoni a ?crit?:
Quoted 22 lines
Quoted 19 lines · On Sun, 9 Feb 2020 19:03:24 +0100 Romain Naour <[email protected]> wrote:
This commit add the same post-image script for each qemu board in order to generate
start-qemu.shinBINARIES_DIR. Thestart-qemu.shscript 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.shis able to modify the qemu command line ifCI_JOB_NAMEdefined in the environment. This allow to disable the graphical output and redirect serial I/Os to console.
Quoted 8 lines
Quoted 4 lines
Only sh4/sh4eb needs a special handling by adding "-serial stdio -display none" instead of "-display none".
Signed-off-by Romain Naour <[email protected]>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).
Quoted 3 lines
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
Quoted 5 lines
Thanks,
Thomas
PATCH v4 7/9 configs/qemu*: use the post-image script with "$(BR2_DEFCONFIG)" as argument.
In reply to Romain NaourThis 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.
--- 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(+)
configs/qemu_aarch64_virt_defconfig +4 -0
@@ -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
configs/qemu_arm_versatile_defconfig +4 -0
@@ -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
configs/qemu_arm_versatile_nommu_defconfig +4 -0
@@ -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
configs/qemu_arm_vexpress_defconfig +4 -0
@@ -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
configs/qemu_arm_vexpress_tz_defconfig +4 -0
@@ -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
configs/qemu_csky610_virt_defconfig +4 -0
@@ -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
configs/qemu_csky807_virt_defconfig +4 -0
@@ -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
configs/qemu_csky810_virt_defconfig +4 -0
@@ -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
configs/qemu_csky860_virt_defconfig +4 -0
@@ -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
configs/qemu_m68k_mcf5208_defconfig +4 -0
@@ -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
configs/qemu_m68k_q800_defconfig +4 -0
@@ -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
configs/qemu_microblazebe_mmu_defconfig +4 -0
@@ -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
configs/qemu_microblazeel_mmu_defconfig +4 -0
@@ -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
configs/qemu_mips32r2_malta_defconfig +4 -0
@@ -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
configs/qemu_mips32r2el_malta_defconfig +4 -0
@@ -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
configs/qemu_mips32r6_malta_defconfig +4 -0
@@ -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
configs/qemu_mips32r6el_malta_defconfig +4 -0
@@ -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
configs/qemu_mips64_malta_defconfig +4 -0
@@ -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
configs/qemu_mips64el_malta_defconfig +4 -0
@@ -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
configs/qemu_mips64r6_malta_defconfig +4 -0
@@ -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
configs/qemu_mips64r6el_malta_defconfig +4 -0
@@ -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
configs/qemu_nios2_10m50_defconfig +4 -0
@@ -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
configs/qemu_or1k_defconfig +4 -0
@@ -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
configs/qemu_ppc64_e5500_defconfig +4 -0
@@ -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
configs/qemu_ppc64_pseries_defconfig +4 -0
@@ -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
configs/qemu_ppc64le_pseries_defconfig +4 -0
@@ -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
configs/qemu_ppc_g3beige_defconfig +4 -0
@@ -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
configs/qemu_ppc_mac99_defconfig +4 -0
@@ -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
configs/qemu_ppc_mpc8544ds_defconfig +4 -0
@@ -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
configs/qemu_ppc_virtex_ml507_defconfig +4 -0
@@ -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
configs/qemu_riscv32_virt_defconfig +4 -0
@@ -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
configs/qemu_riscv64_virt_defconfig +4 -0
@@ -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
configs/qemu_sh4_r2d_defconfig +4 -0
@@ -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
configs/qemu_sh4eb_r2d_defconfig +4 -0
@@ -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
configs/qemu_sparc64_sun4u_defconfig +4 -0
@@ -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
configs/qemu_sparc_ss10_defconfig +4 -0
@@ -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
configs/qemu_x86_64_defconfig +4 -0
@@ -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
configs/qemu_x86_defconfig +4 -0
@@ -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
configs/qemu_xtensa_lx60_defconfig +4 -0
@@ -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
configs/qemu_xtensa_lx60_nommu_defconfig +4 -0
@@ -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
Signature · 1 line
2.24.1
PATCH v4 8/9 support/scripts/boot-qemu-image.py: boot Qemu images with Qemu-system.
In reply to Romain NaourFrom: Jugurtha BELKALEM <[email protected]>
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
wip
--- support/scripts/boot-qemu-image.py | 105 +++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 support/scripts/boot-qemu-image.py
support/scripts/boot-qemu-image.py new file +105 -0
@@ -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()
Signature · 1 line
2.24.1
PATCH v4 9/9 gitlab.yml.in*: enable Qemu gitlab testing
In reply to Romain NaourFrom: Jugurtha BELKALEM <[email protected]>
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.
--- .gitlab-ci.yml | 7 +++++++ .gitlab-ci.yml.in | 7 +++++++ 2 files changed, 14 insertions(+)
.gitlab-ci.yml +7 -0
@@ -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
.gitlab-ci.yml.in +7 -0
@@ -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
Signature · 1 line
2.24.1