Skip to content

Commit

Permalink
Bugfix: GRUB installation failed to install on UEFI systems (#4758)
Browse files Browse the repository at this point in the history
- removing "removable" paramter
- UUID from EFI partition was not found
  • Loading branch information
igorpecovnik committed Jan 27, 2023
1 parent 013867f commit 7f5c20d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/bsp/common/usr/sbin/armbian-install
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ create_armbian()
echo "GRUB_DISABLE_OS_PROBER=false" >> "${TempDir}"/rootfs/etc/default/grub.d/98-armbian.cfg

echo "$satauuid / $FilesystemChoosen ${mountopts[$FilesystemChoosen]}" >> "${TempDir}"/rootfs/etc/fstab
echo "UUID=$(lsblk -io KNAME,LABEL,UUID | grep $diskcheck | grep -i efi | awk '{print $NF}') /boot/efi vfat defaults 0 2" >> "${TempDir}"/rootfs/etc/fstab
echo "UUID=$(lsblk -io KNAME,LABEL,UUID,PARTLABEL | grep $diskcheck | grep -i efi | awk '{print $3}') /boot/efi vfat defaults 0 2" >> "${TempDir}"/rootfs/etc/fstab
echo "/swapfile none swap sw 0 0" >> "${TempDir}"/rootfs/etc/fstab

cat <<-hibernatemenu >"${TempDir}"/rootfs/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Expand All @@ -414,15 +414,15 @@ create_armbian()
efi_partition=$(LC_ALL=C fdisk -l "/dev/$diskcheck" 2>/dev/null | grep "EFI" | awk '{print $1}')

echo "Install GRUB to $efi_partition"
mkdir -p "${TempDir}"/rootfs/boot/efi
mkdir -p "${TempDir}"/rootfs/{dev,proc,sys}
mount $efi_partition "${TempDir}"/rootfs/boot/efi
mount --bind /dev "${TempDir}"/rootfs/dev
mount --make-rslave --bind /dev/pts "${TempDir}"/rootfs/dev/pts
mount --bind /proc "${TempDir}"/rootfs/proc
mount --make-rslave --rbind /sys "${TempDir}"/rootfs/sys
arch_target=$([[ $(arch) == x86_64 ]] && echo "x86_64-efi" || echo "arm64-efi")
chroot "${TempDir}/rootfs/" /bin/bash -c "grub-install --target=$arch_target --efi-directory=/boot/efi --bootloader-id=GRUB --removable >/dev/null" >> $logfile
chroot "${TempDir}/rootfs/" /bin/bash -c "grub-mkconfig -o /boot/grub/grub.cfg >/dev/null" >> $logfile
chroot "${TempDir}/rootfs/" /bin/bash -c "grub-install --target=$arch_target --efi-directory=/boot/efi --bootloader-id=Armbian" >> $logfile
chroot "${TempDir}/rootfs/" /bin/bash -c "grub-mkconfig -o /boot/grub/grub.cfg" >> $logfile
grep "${TempDir}"/rootfs/sys /proc/mounts | cut -f2 -d" " | sort -r | xargs umount -n
umount "${TempDir}"/rootfs/proc
umount "${TempDir}"/rootfs/dev/pts
Expand Down

0 comments on commit 7f5c20d

Please sign in to comment.