|
|
|
@ -113,7 +113,7 @@ if [ "$efi" = "1" ]; then
|
|
|
|
for disk in `echo "$boots"`; do
|
|
|
|
for disk in `echo "$boots"`; do
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Creating boot partitions for device $disk..."
|
|
|
|
echo "Creating boot partitions for device $disk..."
|
|
|
|
errors=`sgdisk -n2:1M:+512M -t2:EF00 /dev/disk/by-id/$disk 2>&1 1>/dev/null`
|
|
|
|
errors=`sgdisk -n1:1M:+512M -t1:EF00 /dev/disk/by-id/$disk 2>&1 1>/dev/null`
|
|
|
|
if ! [ "$?" = "0" ]; then
|
|
|
|
if ! [ "$?" = "0" ]; then
|
|
|
|
echo "Failed to create boot partition for device $disk - $errors"
|
|
|
|
echo "Failed to create boot partition for device $disk - $errors"
|
|
|
|
exit 3
|
|
|
|
exit 3
|
|
|
|
@ -353,12 +353,12 @@ echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /mnt/etc/sysctl.conf
|
|
|
|
echo 'echo ""' >> /mnt/setup-chroot.sh
|
|
|
|
echo 'echo ""' >> /mnt/setup-chroot.sh
|
|
|
|
echo 'echo "Creating EFI partition..."' >> /mnt/setup-chroot.sh
|
|
|
|
echo 'echo "Creating EFI partition..."' >> /mnt/setup-chroot.sh
|
|
|
|
firstdisk=`echo "$boots" | head -n1`
|
|
|
|
firstdisk=`echo "$boots" | head -n1`
|
|
|
|
echo "error=\$(mkdosfs -F 32 -s 1 -n EFI /dev/disk/by-id/${firstdisk}-part2 2>&1 1>/dev/null && mkdir /boot/efi 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
|
|
|
|
echo "error=\$(mkdosfs -F 32 -s 1 -n EFI /dev/disk/by-id/${firstdisk}-part1 2>&1 1>/dev/null && mkdir /boot/efi 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
|
|
|
|
echo 'if ! [ \"$?\" = \"0\" ]; then '>> /mnt/setup-chroot.sh
|
|
|
|
echo 'if ! [ \"$?\" = \"0\" ]; then '>> /mnt/setup-chroot.sh
|
|
|
|
echo ' echo "Failed to create dos file system for EFI partition - $errors"' >> /mnt/setup-chroot.sh
|
|
|
|
echo ' echo "Failed to create dos file system for EFI partition - $errors"' >> /mnt/setup-chroot.sh
|
|
|
|
echo " exit 100">> /mnt/setup-chroot.sh
|
|
|
|
echo " exit 100">> /mnt/setup-chroot.sh
|
|
|
|
echo "fi">> /mnt/setup-chroot.sh
|
|
|
|
echo "fi">> /mnt/setup-chroot.sh
|
|
|
|
echo "echo PARTUUID=$(blkid -s PARTUUID -o value /dev/disk/by-id/${firstdisk}-part2) /boot/efi vfat nofail,x-systemd.device-timeout=0 0 1 >> /etc/fstab" >> /mnt/setup-chroot.sh
|
|
|
|
echo "echo PARTUUID=$(blkid -s PARTUUID -o value /dev/disk/by-id/${firstdisk}-part1) /boot/efi vfat nofail,x-systemd.device-timeout=0 0 1 >> /etc/fstab" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
echo "errors=\$(mount /boot/efi 2>&1 1>/dev/null && apt install -y grub-efi-amd64-signed shim-signed 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
|
|
|
|
echo "errors=\$(mount /boot/efi 2>&1 1>/dev/null && apt install -y grub-efi-amd64-signed shim-signed 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
|
|
|
|
echo 'if ! [ \"$?\" = \"0\" ]; then '>> /mnt/setup-chroot.sh
|
|
|
|
echo 'if ! [ \"$?\" = \"0\" ]; then '>> /mnt/setup-chroot.sh
|
|
|
|
@ -426,7 +426,7 @@ if ! [ "$boots" = "" ]; then
|
|
|
|
echo 'echo "Cloning EFI boot partition to all boot devices..."' >> /mnt/setup-chroot.sh
|
|
|
|
echo 'echo "Cloning EFI boot partition to all boot devices..."' >> /mnt/setup-chroot.sh
|
|
|
|
i="2"
|
|
|
|
i="2"
|
|
|
|
for disk in `echo "$boots" | tail -n+2`; do
|
|
|
|
for disk in `echo "$boots" | tail -n+2`; do
|
|
|
|
echo "errors=\$(dd if=/dev/disk/by-id/${firstdisk}-part2 of=/dev/disk/by-id/${disk}-part2 2>&1 1>/dev/null && efibootmgr -c -g -d /dev/disk/by-id/${disk} -p 3 -L "ubuntu-$i" -l '\EFI\ubuntu\grubx64.efi' 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
|
|
|
|
echo "errors=\$(dd if=/dev/disk/by-id/${firstdisk}-part1 of=/dev/disk/by-id/${disk}-part1 2>&1 1>/dev/null && efibootmgr -c -g -d /dev/disk/by-id/${disk} -p 3 -L "ubuntu-$i" -l '\EFI\ubuntu\grubx64.efi' 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
|
|
|
|
echo "if ! [ \"\$?\" = \"0\" ]; then echo \"EFI copy failed - \$errors\"; exit 20; fi" >> /mnt/setup-chroot.sh
|
|
|
|
echo "if ! [ \"\$?\" = \"0\" ]; then echo \"EFI copy failed - \$errors\"; exit 20; fi" >> /mnt/setup-chroot.sh
|
|
|
|
i=$((i + 1))
|
|
|
|
i=$((i + 1))
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|