From b47ed53fb242542ea1d06f7a971475eec18c089a Mon Sep 17 00:00:00 2001 From: MatMoul Date: Mon, 31 Dec 2018 17:15:19 +0100 Subject: [PATCH] syslinux: add efi support --- archfi | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/archfi b/archfi index f6bb349..550ca7f 100644 --- a/archfi +++ b/archfi @@ -1056,7 +1056,7 @@ archgenmkinitcpiochroot(){ archbootloadermenu(){ options=() options+=("grub" "") - if [ "$efimode" != "1" ]&&[ "$efimode" != "2" ]; then + if [ "$efimode" != "2" ]; then options+=("syslinux" "") fi sel=$(whiptail --backtitle "$apptitle" --title "$txtbootloadermenu" --menu "" --cancel-button "$txtback" 0 0 0 \ @@ -1261,6 +1261,11 @@ archbootloadersyslinuxbmenu(){ archsyslinuxinstall(){ clear + if [ "$efimode" == "1" ]||[ "$efimode" == "2" ]; then + echo "Add efibootmgr to support your efi installation" + additionalpkg=$additionalpkg"efibootmgr " + fi + if [ "$(parted ${realrootdev::8} print|grep gpt)" != "" ]; then echo "Add gptfdisk to support your gpt disk" additionalpkg=$additionalpkg"gptfdisk " @@ -1286,12 +1291,17 @@ archsyslinuxinstall(){ echo "sed -i \"/APPEND\ root=/c\ APPEND root=$rootdev rw\" /mnt/boot/syslinux/syslinux.cfg" sed -i "/APPEND\ root=/c\ APPEND root=$rootdev\ rw" /mnt/boot/syslinux/syslinux.cfg fi + pressanykey } archsyslinuxinstallbootloader(){ clear - archchroot syslinuxbootloaderinstall $device + if [ "$efimode" == "1" ]||[ "$efimode" == "2" ]; then + archchroot syslinuxbootloaderefiinstall $bootdev + else + archchroot syslinuxbootloaderinstall $bootdev + fi pressanykey } archsyslinuxinstallbootloaderchroot(){ @@ -1301,6 +1311,15 @@ archsyslinuxinstallbootloaderchroot(){ fi exit } +archsyslinuxinstallbootloaderefichroot(){ + if [ ! "$1" = "none" ]; then + echo "cp -r /usr/lib/syslinux/efi64/* /boot/syslinux" + echo "efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose" + cp -r /usr/lib/syslinux/efi64/* /boot/syslinux + efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose + fi + exit +} @@ -1526,6 +1545,7 @@ if [ "$chroot" = "1" ]; then 'grubbootloaderefiinstall') archgrubinstallbootloaderefichroot $args;; 'grubbootloaderefiusbinstall') archgrubinstallbootloaderefiusbchroot $args;; 'syslinuxbootloaderinstall') archsyslinuxinstallbootloaderchroot $args;; + 'syslinuxbootloaderefiinstall') archsyslinuxinstallbootloaderefichroot $args;; 'archdiinstallandlaunch') archdiinstallandlaunchchroot;; 'archdiinstall') archdiinstallchroot;; 'archdilaunch') archdilaunchchroot;;