--- a/systemd/initcpio-install-systemd 2016-06-14 01:07:00.000000000 +0300 +++ b/systemd/initcpio-install-systemd 2016-06-11 13:56:34.269606003 +0300 @@ -100,6 +100,7 @@ add_binary /bin/mount add_binary /usr/bin/kmod /usr/bin/modprobe add_binary /usr/lib/systemd/systemd /init + add_binary /usr/bin/sulogin map add_binary \ /usr/bin/systemd-tmpfiles \ @@ -144,7 +145,9 @@ systemd-udevd-control.socket \ systemd-udevd-kernel.socket \ systemd-udevd.service \ - timers.target + timers.target \ + rescue.target \ + emergency.target add_symlink "/usr/lib/systemd/system/default.target" "initrd.target" add_symlink "/usr/lib/systemd/system/ctrl-alt-del.target" "reboot.target" @@ -154,6 +157,14 @@ add_binary "$(readlink -f /usr/lib/libnss_files.so)" add_file "/etc/passwd" add_file "/etc/group" + + # make the rescue shell passwordless + # (to preserve status-quo wrt. the "base" hook) + echo "root::::::::" > "$BUILDROOT/etc/shadow" + +# sed '/^ExecStart=/s/sulogin/& -e/' -i \ +# "$BUILDROOT/usr/lib/systemd/system/emergency.service" \ +# "$BUILDROOT/usr/lib/systemd/system/rescue.service" } help() { @@ -163,6 +174,8 @@ components will need to be ported, and will not work as intended. You also may wish to still include the 'base' hook (before this hook) to ensure that a rescue shell exists on your initramfs. +The rescue shell will be passwordless and accessible by adding 'rd.rescue' or +'rd.emergency' to the kernel cmdline. HELPEOF }