diff --git a/setup.sh b/setup.sh index 1922387..acc3362 100644 --- a/setup.sh +++ b/setup.sh @@ -497,11 +497,8 @@ function in_file_in_array_remove_n () { function add_zfs_hook_to_initramfs () { #1.16 # Add zfs hook, remove fsck hook from initramfs. - sed -ri \ - -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' \ - '/mnt/etc/mkinitcpio.conf' + in_file_in_array_insert_n_before_m '/mnt/etc/mkinitcpio.conf' 'HOOKS' 'zfs' 'filesystems' + in_file_in_array_remove_n '/mnt/etc/mkinitcpio.conf' 'HOOKS' 'fsck' # Also unless encryption's unwanted add plain text key file into # initramfs since it's living inside an encrypted pool anyway. [[ ! "${ARCHZBM_ZFSPROPS_NO_ENCRYPTION}" ]] && sed -ri \