diff mbox series

[3/4] board/qemu: add post-build script to aarch64_virt_defconfig

Message ID 20240822130220.4135741-4-alex.bennee@linaro.org
State Changes Requested
Headers show
Series Update Mesa and enable vkmark | expand

Commit Message

Alex Bennée Aug. 22, 2024, 1:02 p.m. UTC
This is in aid of supporting getty on fbcon.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 board/qemu/post-build.sh            | 16 ++++++++++++++++
 configs/qemu_aarch64_virt_defconfig |  1 +
 2 files changed, 17 insertions(+)
 create mode 100755 board/qemu/post-build.sh

Comments

Thomas Petazzoni Aug. 23, 2024, 5:27 p.m. UTC | #1
Hello Alex,

On Thu, 22 Aug 2024 14:02:19 +0100
Alex Bennée <alex.bennee@linaro.org> wrote:

> This is in aid of supporting getty on fbcon.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Like Yann, I also don't think this really belongs to the
qemu_aarch64_virt_defconfig. Why this defconfig in particular, and not
any other?

If you want a "demo" of vkmark and the Venus vulkan driver, a runtime
test in support/testing/ is much more relevant, as Yann suggested.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/board/qemu/post-build.sh b/board/qemu/post-build.sh
new file mode 100755
index 0000000000..73026e5922
--- /dev/null
+++ b/board/qemu/post-build.sh
@@ -0,0 +1,16 @@ 
+#!/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 # HDMI console' ${TARGET_DIR}/etc/inittab
+# systemd doesn't use /etc/inittab, enable getty.tty1.service instead
+elif [ -d ${TARGET_DIR}/etc/systemd ]; then
+    mkdir -p "${TARGET_DIR}/etc/systemd/system/getty.target.wants"
+    ln -sf /lib/systemd/system/getty@.service \
+       "${TARGET_DIR}/etc/systemd/system/getty.target.wants/getty@tty1.service"
+fi
diff --git a/configs/qemu_aarch64_virt_defconfig b/configs/qemu_aarch64_virt_defconfig
index 30ecf04cac..45f7fc75eb 100644
--- a/configs/qemu_aarch64_virt_defconfig
+++ b/configs/qemu_aarch64_virt_defconfig
@@ -15,6 +15,7 @@  BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 
 # Image
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"