uefi support

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2016-12-20 11:08:24 +01:00
parent d34843347a
commit a495a20d95

View file

@ -35,22 +35,41 @@ printf '#!/bin/sh -l\n'
case "$target_os" in case "$target_os" in
ubuntu|debian) ubuntu|debian)
printf 'grub-install "%s"\n' "$device" if [ -s "$__global/explorer/efi" ]; then
printf 'update-grub\n' # FIXME: untested. maybe also just run update-grub for EFI system?
printf 'grub-mkconfig --output=/boot/efi/EFI/%s/grub.cfg\n' "$target_os"
printf 'mkdir -p /boot/efi/EFI/BOOT\n'
printf 'cp /boot/efi/EFI/%s/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi' "$target_os"
else
printf 'grub-install "%s"\n' "$device"
printf 'update-grub\n'
fi
;; ;;
archlinux) archlinux)
# bugfix/workarround: rebuild initramfs if [ -s "$__global/explorer/efi" ]; then
# FIXME: doesn't belong here echo "EFI boot loader installation is on your operating system ($target_os) is currently not supported by this type (${__type##*/})." >&2
printf 'grub-install "%s"\n' "$device" echo "Please contribute an implementation for it if you can." >&2
printf 'mkinitcpio -p linux\n' exit 1
printf 'grub-mkconfig -o /boot/grub/grub.cfg\n' else
printf 'grub-install "%s"\n' "$device"
# bugfix/workarround: rebuild initramfs
# FIXME: doesn't belong here
printf 'mkinitcpio -p linux\n'
printf 'grub-mkconfig -o /boot/grub/grub.cfg\n'
fi
;; ;;
centos) centos)
printf 'grub2-install "%s"\n' "$device" if [ -s "$__global/explorer/efi" ]; then
printf 'grub2-mkconfig --output=/boot/grub2/grub.cfg\n' printf 'grub2-mkconfig --output=/boot/efi/EFI/%s/grub.cfg\n' "$target_os"
printf 'mkdir -p /boot/efi/EFI/BOOT\n'
printf 'cp /boot/efi/EFI/%s/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi' "$target_os"
else
printf 'grub2-install "%s"\n' "$device"
printf 'grub2-mkconfig --output=/boot/grub2/grub.cfg\n'
fi
;; ;;
*) *)
echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2 echo "Your operating system ($target_os) is currently not supported by this type (${__type##*/})." >&2
echo "If you can, please contribute an implementation for it." >&2 echo "If you can, please contribute an implementation for it." >&2
exit 1 exit 1
;; ;;
@ -74,4 +93,5 @@ chmod +x "\$script"
# Run script in chroot # Run script in chroot
relative_script="\${script#$chroot}" relative_script="\${script#$chroot}"
chroot "$chroot" "\$relative_script" chroot "$chroot" "\$relative_script"
rm -rf \$script
DONE DONE