summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorStefan Eichenberger <stefan.eichenberger@toradex.com>2020-03-13 12:09:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-13 13:35:58 +0000
commitdd6ee0b06cd8df6204cf600050516d15172302ea (patch)
treea9fa79684cfdcc57815cbdd487efa40168acbf9c /meta/recipes-core/initrdscripts
parent287123a9562e08cd97a4ebfd380508432654324b (diff)
downloadopenembedded-core-dd6ee0b06cd8df6204cf600050516d15172302ea.tar.gz
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 <stefan.eichenberger@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/udev3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev
index 87551ff4a9..4898b89246 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