mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
e7485d04f1
Update the zfsunlock initramfs hook to provide instructions on how to unlock the root filesystem when appropriate. The intent is to make the dropbear ssh MOTD more user friendly. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Cong Zhang <13283869+congzhangzh@users.noreply.github.com> Closes #17661 Closes #17662
20 lines
464 B
Bash
20 lines
464 B
Bash
#!/bin/sh
|
|
|
|
if [ "$1" = "prereqs" ]; then
|
|
echo "dropbear"
|
|
exit
|
|
fi
|
|
|
|
. /usr/share/initramfs-tools/hook-functions
|
|
|
|
copy_exec /usr/share/initramfs-tools/zfsunlock /usr/bin/zfsunlock
|
|
|
|
if [ -f /etc/initramfs-tools/etc/motd ]; then
|
|
copy_file text /etc/initramfs-tools/etc/motd /etc/motd
|
|
else
|
|
tmpf=$(mktemp)
|
|
echo "If you use zfs encrypted root filesystems, you can use \`zfsunlock\` to manually unlock it" > "$tmpf"
|
|
copy_file text "$tmpf" /etc/motd
|
|
rm -f "$tmpf"
|
|
fi
|