From: Chih-Wei Huang Date: Tue, 1 Jan 2019 15:31:16 +0000 (+0800) Subject: android.cfg: support custom boot entry X-Git-Tag: android-x86-7.1-r3~7 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fbootable-newinstaller.git;a=commitdiff_plain;h=e04296a63b9eb563b6312ec959dfc9bff5561193 android.cfg: support custom boot entry New entries could also be appended by the new add_boot_entry function in custom.cfg like add_boot_entry /android-7.1-r2 "Android-x86 7.1-r2" quiet --- diff --git a/install/grub2/efi/boot/android.cfg b/install/grub2/efi/boot/android.cfg index 192d410..c2d09a4 100644 --- a/install/grub2/efi/boot/android.cfg +++ b/install/grub2/efi/boot/android.cfg @@ -1,15 +1,30 @@ -# $1 Title -# $2... Kernel cmdline -function add_entry { - menuentry "OS_TITLE VER $1" "$@" --class android-x86 { - shift 2 +# $1 Kernel dir +# $2 Title +# $3... Kernel cmdline +function add_boot_entry { + menuentry "$2" "$@" --class android-x86 { savedefault set root=$android - linux $kdir/kernel CMDLINE $src $@ - initrd $kdir/initrd.img + if [ -e $2/kernel ]; then + true + else + search --no-floppy --set root -f $2/kernel + fi + set kd=$2 + shift 3 + linux $kd/kernel CMDLINE $src $@ + initrd $kd/initrd.img } } +# $1 Title +# $2... Kernel cmdline +function add_entry { + set title="OS_TITLE VER $1" + shift 1 + add_boot_entry "$kdir" "$title" "$@" +} + # $1 EFI to chainload # $2 OS name # $3 Class