) > /run/NetworkManager/conf.d/initrd-logging.conf
if [ -n "$DRACUT_SYSTEMD" ]; then
- mkdir -p /run/systemd/system/nm-initrd.service.d
- cat << EOF > /run/systemd/system/nm-initrd.service.d/tty-output.conf
+ # Enable tty output if a usable console is found
+ # See https://github.com/coreos/fedora-coreos-tracker/issues/943
+ # shellcheck disable=SC2217
+ if [ -w /dev/console ] && (echo < /dev/console) > /dev/null 2> /dev/null; then
+ mkdir -p /run/systemd/system/nm-initrd.service.d
+ cat << EOF > /run/systemd/system/nm-initrd.service.d/tty-output.conf
[Service]
StandardOutput=tty
EOF
- systemctl --no-block daemon-reload
+ systemctl --no-block daemon-reload
+ fi
fi
fi
ExecStart=/usr/sbin/NetworkManager --debug
KillMode=process
# The following gets changed to StandardOutput=tty by nm-config.sh
-# when debug is enabled.
+# when debug is enabled and a usable console is found.
StandardOutput=null
Environment=NM_CONFIG_ENABLE_TAG=initrd
Restart=on-failure