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

(From OE-Core rev: dd6ee0b06cd8df6204cf600050516d15172302ea)

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Stefan Eichenberger
2020-03-13 12:09:07 +01:00
committed by Richard Purdie
parent b353a8069b
commit cf2ea6cc27

View File

@@ -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