K
там прямо системы выбираются
Size: a a a
K
m7
m7
AM
AM
K
K
# BootFix
# Checking permissions
#
if [ `echo $(whoami) | grep -c root` -eq 0 ]; then echo "You not have administrative privileges." & exit; fi
# Vars
#
gptdisk="sda"
gptbootpart="1"
gptsyspart="2"
rootdir="/media/target"
exit
# Action - fix EFI boot
#
mkdir -p "${rootdir}"
mount "/dev/${gptdisk}${gptsyspart}" "${rootdir}"
mount --bind "/dev" "${rootdir}/dev"
mount --bind "/proc" "${rootdir}/proc"
mount --bind "/sys" "${rootdir}/sys"
mount --bind "/run" "${rootdir}/run"
mkdir -p "${rootdir}/boot/efi"
mount "/dev/${gptdisk}${gptbootpart}" "${rootdir}/boot/efi"
chroot "${rootdir}" apt update --fix-missing
chroot "${rootdir}" apt install -y grub-efi-amd64-signed
chroot "${rootdir}" apt clean
chroot "${rootdir}" mkdir -p /boot/grub
chroot "${rootdir}" mkdir -p /boot/efi/EFI
chroot "${rootdir}" grub-install --removable --boot-directory /boot/efi/EFI --efi-directory /boot/efi /dev/${gptdisk}
chroot "${rootdir}" update-grub -o /boot/efi/EFI/grub/grub.cfg
umount "${rootdir}/run"
umount "${rootdir}/sys"
umount "${rootdir}/proc"
umount "${rootdir}/dev"
umount "${rootdir}/boot/efi"
umount "${rootdir}"
echo "Done."AM
AM
AM
AM
a
М
K