From: Stefan Eichenberger Date: Fri, 13 Mar 2020 11:09:07 +0000 (+0100) Subject: initramfs-framework: fix boothang when console=null X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~11530 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd6ee0b06cd8df6204cf600050516d15172302ea;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git initramfs-framework: fix boothang when console=null If console=null systemd-udevd throws an assertion which prevents the system from booting. This patch redirects stdin, stdout and stderr to /dev/null in case that the console can't be opened so that udevd still boots. A systemd issue was reported here. However, they will not fix this specific use-case: https://github.com/systemd/systemd/issues/13332 Signed-off-by: Stefan Eichenberger Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev index 87551ff4a9b..4898b892463 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework/udev +++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev @@ -41,6 +41,9 @@ udev_run() { mkdir -p /run mkdir -p /var/run + # Workaround if console=null, systemd-udevd needs valid stdin, stdout and stderr to work + sh -c "exec 4< /dev/console" || { exec 0> /dev/null; exec 1> /dev/null; exec 2> /dev/null; } + $_UDEV_DAEMON --daemon udevadm trigger --action=add udevadm settle