diff --git a/checks/uefi.check b/checks/uefi.check index 9f94ebc..3ccc69a 100755 --- a/checks/uefi.check +++ b/checks/uefi.check @@ -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=$? diff --git a/install.sh b/install.sh index 4ba4120..4d5c2a5 100755 --- a/install.sh +++ b/install.sh @@ -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:" diff --git a/steps/50-configure.step b/steps/50-configure.step index b800986..d752d5c 100755 --- a/steps/50-configure.step +++ b/steps/50-configure.step @@ -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