All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: buildroot@buildroot.org
Cc: "Thomas Huth" <huth@tuxfamily.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Romain Naour" <romain.naour@gmail.com>
Subject: [Buildroot] [PATCH v11 5/5] support/scripts/boot-qemu-image.py: manage petitboot interface
Date: Fri, 21 Apr 2023 20:50:03 +0200	[thread overview]
Message-ID: <20230421185003.1221000-6-laurent@vivier.eu> (raw)
In-Reply-To: <20230421185003.1221000-1-laurent@vivier.eu>

Petitboot doesn't start a shell but a GUI.
Manage the menu to switch to the shell.

Enable the test for qemu_m68K_virt.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 configs/qemu_m68k_virt_petitboot_defconfig | 5 +++++
 support/scripts/boot-qemu-image.py         | 8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configs/qemu_m68k_virt_petitboot_defconfig b/configs/qemu_m68k_virt_petitboot_defconfig
index a109553187b4..454c8e353f2a 100644
--- a/configs/qemu_m68k_virt_petitboot_defconfig
+++ b/configs/qemu_m68k_virt_petitboot_defconfig
@@ -6,6 +6,8 @@ BR2_RELRO_NONE=y
 BR2_TARGET_GENERIC_ISSUE="Welcome to Petitboot"
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
 BR2_ROOTFS_MERGED_USR=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.19"
@@ -22,3 +24,6 @@ BR2_PACKAGE_RSYNC=y
 BR2_PACKAGE_PETITBOOT=y
 BR2_TARGET_ROOTFS_CPIO=y
 BR2_TARGET_ROOTFS_CPIO_XZ=y
+# host-qemu for gitlab testing
+BR2_PACKAGE_HOST_QEMU=y
+BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
diff --git a/support/scripts/boot-qemu-image.py b/support/scripts/boot-qemu-image.py
index ba50ea69ee9a..c94b7a5c969d 100755
--- a/support/scripts/boot-qemu-image.py
+++ b/support/scripts/boot-qemu-image.py
@@ -36,7 +36,7 @@ def main():
     time.sleep(1)
 
     try:
-        child.expect(["buildroot login:"], timeout=600)
+        idx = child.expect(["buildroot login:", "Exit to shell"], timeout=600)
     except pexpect.EOF as e:
         # Some emulations require a fork of qemu-system, which may be
         # missing on the system, and is not provided by Buildroot.
@@ -55,7 +55,11 @@ def main():
         print("System did not boot in time, exiting.")
         sys.exit(1)
 
-    child.sendline("root\r")
+    if idx == 0:
+        child.sendline("root\r")
+    elif idx == 1:
+        time.sleep(1)
+        child.sendline("\r")
 
     try:
         child.expect(["# "], timeout=600)
-- 
2.40.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2023-04-21 18:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 18:49 [Buildroot] [PATCH v11 0/5] package: add petitboot to use with qemu-system-m68k Laurent Vivier
2023-04-21 18:49 ` [Buildroot] [PATCH v11 1/5] kexec: fix sys/random.h with uclibc Laurent Vivier
2023-04-23 10:29   ` Laurent Vivier
2023-06-03 20:49   ` Arnout Vandecappelle via buildroot
2023-04-21 18:50 ` [Buildroot] [PATCH v11 2/5] petitboot: add pb-discover daemon Laurent Vivier
2023-04-21 18:50 ` [Buildroot] [PATCH v11 3/5] petitboot: start petitboot on all tty Laurent Vivier
2023-04-21 18:50 ` [Buildroot] [PATCH v11 4/5] board/qemu/m68k-virt: Add virt-m68k linux config Laurent Vivier
2023-04-21 18:50 ` Laurent Vivier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230421185003.1221000-6-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=buildroot@buildroot.org \
    --cc=clg@kaod.org \
    --cc=huth@tuxfamily.org \
    --cc=romain.naour@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.