Add support for legacy BIOS boot

This commit is contained in:
maride 2017-08-12 16:01:00 +02:00
parent 955ec704e8
commit ba1e4bff49
3 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,10 @@
#!/bin/sh
if [ "$bootloader" == "EFI" ]; then
echo "~> Not an EFI host, not checking for EFI."
exit 0
fi
ls /sys/firmware/efi/efivars 2>/tmp/arch-maride-flavour_checks_uefi_error.log 1>/tmp/arch-maride-flavour_checks_uefi_out.log
return=$?

View File

@ -16,6 +16,15 @@ if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
exit 1
fi
echo -n "=> Do you want to install on EFI or BIOS? BIOS is required for VirtalBox hosts (E/b) "
read answer
if [ "$answer" != "e" ] && [ "$answer" != "E" ]; then
export bootloader="BIOS";
else
export bootloader="EFI";
fi
echo "=> Please enter the full path to the block device the installation should take place on: (e.g. /dev/sda)"
echo " Make sure to choose a drive, not a partition."
echo " Hint: here's a list of devices that may be the right:"

View File

@ -17,8 +17,13 @@ echo -e "~> Choose a hostname: "
read hostname
echo $hostname > /mnt/etc/hostname
echo "~> Configuring 'grub'"
arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch_GRUB
echo "~> Configuring 'grub' for $bootloader"
if [ "$bootloader" == "EFI" ]; then
arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch_GRUB
else
arch-chroot /mnt grub-install --target=i386-pc /dev/*da
fi
echo "GRUB_CMDLINE_LINUX='cryptdevice=UUID=`blkid -o value ${blockdevice}2 | head -n 1`:cryptroot'" > /mnt/etc/default/grub
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg