Skip to content

Commit

Permalink
Prepare EFI partitions via rsync
Browse files Browse the repository at this point in the history
This is much better practice, primarily because sharing the same UUID across different partitions is dangerous (see tabulon-ext#7).

Closes tabulon-ext#7.
  • Loading branch information
64kramsystem committed Feb 26, 2020
1 parent bb9c1f0 commit fec14fd
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions install-zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,6 @@ function install_and_configure_bootloader {
# performed on 18.04, but it's better to keep this reference just in case.

chroot_execute "update-grub"

chroot_execute "umount /boot/efi"
}

function install_and_configure_bootloader_Debian {
Expand All @@ -1047,17 +1045,27 @@ function install_and_configure_bootloader_Debian {
chroot_execute "perl -i -pe 's/#(GRUB_TERMINAL=console)/\$1/' /etc/default/grub"

chroot_execute "update-grub"

chroot_execute "umount /boot/efi"
}

function clone_efi_partition {
print_step_info_header

for ((i = 1; i < ${#v_selected_disks[@]}; i++)); do
dd if="${v_selected_disks[0]}-part1" of="${v_selected_disks[i]}-part1"
local cloned_partition_path="/boot/efi$((i + 1))"

chroot_execute "echo PARTUUID=$(blkid -s PARTUUID -o value "${v_selected_disks[i]}-part1") $cloned_partition_path vfat nofail,x-systemd.device-timeout=1 0 1 >> /etc/fstab"

chroot_execute "mkdir -p $cloned_partition_path"
chroot_execute "mount $cloned_partition_path"

chroot_execute "rsync --archive --delete --verbose /boot/efi/ $cloned_partition_path"

efibootmgr --create --disk "${v_selected_disks[i]}" --label "ubuntu-$((i + 1))" --loader '\EFI\ubuntu\grubx64.efi'

chroot_execute "umount $cloned_partition_path"
done

chroot_execute "umount /boot/efi"
}

function configure_boot_pool_import {
Expand Down

0 comments on commit fec14fd

Please sign in to comment.