aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-test/images/initramfs-bootrr-image.bb11
1 files changed, 11 insertions, 0 deletions
diff --git a/recipes-test/images/initramfs-bootrr-image.bb b/recipes-test/images/initramfs-bootrr-image.bb
index 18e923f..9a6c84f 100644
--- a/recipes-test/images/initramfs-bootrr-image.bb
+++ b/recipes-test/images/initramfs-bootrr-image.bb
@@ -34,3 +34,14 @@ IMAGE_ROOTFS_EXTRA_SPACE = "0"
# Disable installation of kernel and modules via packagegroup-core-boot
NO_RECOMMENDATIONS = "1"
+
+# Enable local auto-login (on systemd) of the root user (local = serial port and
+# virtual console by default, can be configured).
+LOCAL_GETTY ?= " \
+ ${IMAGE_ROOTFS}${systemd_system_unitdir}/serial-getty@.service \
+ ${IMAGE_ROOTFS}${systemd_system_unitdir}/getty@.service \
+"
+local_autologin () {
+ sed -i -e 's/^\(ExecStart *=.*getty \)/\1--autologin root /' ${LOCAL_GETTY}
+}
+ROOTFS_POSTPROCESS_COMMAND += "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'local_autologin;', '', d)}"