diff options
Diffstat (limited to 'modules.d/01systemd-ask-password')
-rwxr-xr-x | modules.d/01systemd-ask-password/module-setup.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules.d/01systemd-ask-password/module-setup.sh b/modules.d/01systemd-ask-password/module-setup.sh index 6e78075..866eb3a 100755 --- a/modules.d/01systemd-ask-password/module-setup.sh +++ b/modules.d/01systemd-ask-password/module-setup.sh @@ -19,6 +19,19 @@ check() { # Module dependency requirements. depends() { + if [[ $hostonly ]]; then + # A password cannot be entered if there is no graphical output during boot, + # as is the case in aarch64, where efifb does not work with qemu-system-aarch64: + # - virtio-gpu-pci does not expose a linear framebuffer + # - virtio-vga is not supported + # - ramfb is not enough + # Therefore, depend on the drm module if virtio_gpu is loaded on the system. + if [[ ${DRACUT_ARCH:-$(uname -m)} == arm* || ${DRACUT_ARCH:-$(uname -m)} == aarch64 ]] \ + && grep -r -q "virtio:d00000010v" /sys/bus/virtio/devices/*/modalias 2> /dev/null; then + echo drm + fi + fi + # Return 0 to include the dependent module(s) in the initramfs. return 0 @@ -35,6 +48,10 @@ install() { systemd-ask-password \ systemd-tty-ask-password-agent + if [ -e "$systemdsystemunitdir"/systemd-vconsole-setup.service ]; then + $SYSTEMCTL -q --root "$initdir" add-wants systemd-ask-password-console.service systemd-vconsole-setup.service + fi + # Enable the systemd type service unit for systemd-ask-password. $SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-console.service @@ -44,6 +61,10 @@ install() { "$systemdsystemunitdir"/systemd-ask-password-plymouth.path \ "$systemdsystemunitdir"/systemd-ask-password-plymouth.service + if [ -e "$systemdsystemunitdir"/systemd-vconsole-setup.service ]; then + $SYSTEMCTL -q --root "$initdir" add-wants systemd-ask-password-plymouth.service systemd-vconsole-setup.service + fi + $SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-plymouth.service fi |