Skip to content

Commit 3dfbc27

Browse files
initrd: add more advise regarding failed units (#377)
1 parent 29e4738 commit 3dfbc27

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

modules/initrd.nix

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,24 @@ in
5858
];
5959

6060
systemd.contents."/etc/profile" = lib.mkIf (cfg.luks.devices != { }) {
61-
text = ''
62-
echo "If the boot process does not continue in 5 seconds, try running:"
63-
echo " systemctl start default.target"
64-
''
65-
+ lib.concatMapAttrsStringSep "\n"
66-
(volume: disk: "systemd-cryptsetup attach ${volume} ${disk.device}")
67-
cfg.luks.devices;
61+
text = let
62+
help = ''
63+
echo
64+
echo
65+
echo "If the boot process does not continue in 5 seconds, try running:"
66+
echo " systemctl default"
67+
echo
68+
echo "If that does not continue the boot, see if any units failed and try restarting them:"
69+
echo " systemctl --failed"
70+
echo
71+
echo
72+
'';
73+
in
74+
help
75+
+ lib.concatMapAttrsStringSep "\n"
76+
(volume: disk: "systemd-cryptsetup attach ${volume} ${disk.device}")
77+
cfg.luks.devices
78+
+ help;
6879
};
6980
};
7081

0 commit comments

Comments
 (0)