diff --git a/setup.sh b/setup.sh index 0d0ba5a..802f5a6 100644 --- a/setup.sh +++ b/setup.sh @@ -251,8 +251,10 @@ function set_locale () { } function add_zfs_hook_to_initramfs () { - # Add zfs hook, remove fsck hook from initramfs + # Add zfs hook, remove fsck hook from initramfs. Also add plain text key + # file into initramfs since it's living inside an encrypted pool anyway. sed -ri \ + -e 's'$'\x1''^(FILES=)[^\r\n\f]*'$'\x1''\1(/etc/zfs/'"${zpool_name}"'.key)'$'\x1''g' \ -e 's'$'\x1''(HOOKS=)(.*?[\(| ])(filesystems)([\)| ][^\r\n\f]*)'$'\x1''\1\2zfs \3\4'$'\x1''g' \ -e 's'$'\x1''((\()(fsck)(\)))'$'\x1''\2\4'$'\x1''g' \ -e 's'$'\x1''(([[:space:]]+)(fsck)|(fsck)([[:space:]]+))'$'\x1'''$'\x1''g' \