diff options
Diffstat (limited to 'setup-disk.in')
-rwxr-xr-x[-rw-r--r--] | setup-disk.in | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/setup-disk.in b/setup-disk.in index 9258df2..20be60c 100644..100755 --- a/setup-disk.in +++ b/setup-disk.in @@ -238,6 +238,9 @@ find_mount_dev() { supported_boot_fs() { local supported="ext2 ext3 ext4 btrfs xfs vfat" + if [ "$BOOTLOADER" = "grub" ]; then + local supported="$supported zfs" + fi local fs= if is_rpi; then supported=vfat @@ -352,6 +355,10 @@ setup_grub() { GRUB_DISABLE_RECOVERY=true GRUB_CMDLINE_LINUX_DEFAULT="modules=$modules $kernel_opts" EOF + + case "$initfs_features" in + *zfs*) echo "GRUB_FS=zfs" >> "$mnt"/etc/default/grub;; + esac } # setup syslinux bootloader @@ -544,6 +551,18 @@ install_mounted_root() { echo "Continuing at your own risk." fi + # if root fileystem is zfs, check if we need to load + # nvme feature when creating initramfs + if [ "$root_fs" = "zfs" ]; then + for dev in $(zpool list -v ${rootdev%%/*} | sed '/^\S.*/d;s/^\s*\(\S*\)\s.*/\1/g'); do + case $dev in + nvme*) + initfs_features="${initfs_features% nvme} nvme" + ;; + esac + done + fi + # check if our root is on raid so we can feed mkinitfs and # bootloader conf with the proper kernel module params for dev in $rootdev $pvs $cryptdev; do |