Add Legacy Boot
This commit is contained in:
parent
8caf7c29f3
commit
7b428b8e0a
|
|
@ -63,19 +63,21 @@ sgdisk -n 2:0:0 ${DISK} # partition 2 (Root), default start, remaining
|
||||||
# set partition types
|
# set partition types
|
||||||
sgdisk -t 1:ef00 ${DISK}
|
sgdisk -t 1:ef00 ${DISK}
|
||||||
sgdisk -t 2:8300 ${DISK}
|
sgdisk -t 2:8300 ${DISK}
|
||||||
|
if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
|
sgdisk -A 1:set:2 ${DISK}
|
||||||
|
fi
|
||||||
# label partitions
|
# label partitions
|
||||||
sgdisk -c 1:"UEFISYS" ${DISK}
|
sgdisk -c 1:"BOOT" ${DISK}
|
||||||
sgdisk -c 2:"ROOT" ${DISK}
|
sgdisk -c 2:"ROOT" ${DISK}
|
||||||
|
|
||||||
# make filesystems
|
# make filesystems
|
||||||
echo -e "\nCreating Filesystems...\n$HR"
|
echo -e "\nCreating Filesystems...\n$HR"
|
||||||
if [[ ${DISK} =~ "nvme" ]]; then
|
if [[ ${DISK} =~ "nvme" ]]; then
|
||||||
mkfs.vfat -F32 -n "UEFISYS" "${DISK}p1"
|
mkfs.vfat -F32 -n "BOOT" "${DISK}p1"
|
||||||
mkfs.btrfs -L "ROOT" "${DISK}p2" -f
|
mkfs.btrfs -L "ROOT" "${DISK}p2" -f
|
||||||
mount -t btrfs "${DISK}p2" /mnt
|
mount -t btrfs "${DISK}p2" /mnt
|
||||||
else
|
else
|
||||||
mkfs.vfat -F32 -n "UEFISYS" "${DISK}1"
|
mkfs.vfat -F32 -n "BOOT" "${DISK}1"
|
||||||
mkfs.btrfs -L "ROOT" "${DISK}2" -f
|
mkfs.btrfs -L "ROOT" "${DISK}2" -f
|
||||||
mount -t btrfs "${DISK}2" /mnt
|
mount -t btrfs "${DISK}2" /mnt
|
||||||
fi
|
fi
|
||||||
|
|
@ -95,7 +97,7 @@ esac
|
||||||
mount -t btrfs -o subvol=@ -L ROOT /mnt
|
mount -t btrfs -o subvol=@ -L ROOT /mnt
|
||||||
mkdir /mnt/boot
|
mkdir /mnt/boot
|
||||||
mkdir /mnt/boot/efi
|
mkdir /mnt/boot/efi
|
||||||
mount -t vfat -L UEFISYS /mnt/boot/
|
mount -t vfat -L BOOT /mnt/boot/
|
||||||
|
|
||||||
if ! grep -qs '/mnt' /proc/mounts; then
|
if ! grep -qs '/mnt' /proc/mounts; then
|
||||||
echo "Drive is not mounted can not continue"
|
echo "Drive is not mounted can not continue"
|
||||||
|
|
@ -105,6 +107,10 @@ if ! grep -qs '/mnt' /proc/mounts; then
|
||||||
reboot now
|
reboot now
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
|
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/gptmbr.bin of=${DISK}
|
||||||
|
extlinux --install /mnt/boot
|
||||||
|
fi
|
||||||
echo "--------------------------------------"
|
echo "--------------------------------------"
|
||||||
echo "-- Arch Install on Main Drive --"
|
echo "-- Arch Install on Main Drive --"
|
||||||
echo "--------------------------------------"
|
echo "--------------------------------------"
|
||||||
|
|
@ -114,7 +120,6 @@ echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
|
||||||
echo "--------------------------------------"
|
echo "--------------------------------------"
|
||||||
echo "-- GRUB Bootloader Installation --"
|
echo "-- GRUB Bootloader Installation --"
|
||||||
echo "--------------------------------------"
|
echo "--------------------------------------"
|
||||||
bootctl install --esp-path=/mnt/boot
|
|
||||||
if [[ ! -d "/sys/firmware/efi" ]]; then
|
if [[ ! -d "/sys/firmware/efi" ]]; then
|
||||||
grub-install --boot-directory=/mnt/boot ${DISK}
|
grub-install --boot-directory=/mnt/boot ${DISK}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue