OSDN Git Service

Add advanced options to boot menu
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 2 Feb 2018 08:09:40 +0000 (16:09 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 2 Feb 2018 08:09:40 +0000 (16:09 +0800)
Provide more boot options in the advanced submenu.

boot/boot/grub/grub.cfg
boot/isolinux/isolinux.cfg
install/grub2/efi/boot/android.cfg

index b142ed6..d140366 100644 (file)
@@ -1,6 +1,5 @@
 set timeout=30
 set live=Live
 set debug_mode="Live DEBUG mode"
-set installation=Installation
 
 source /efi/boot/android.cfg
index d958dc1..8f2df61 100644 (file)
@@ -16,11 +16,6 @@ label livem
        kernel /kernel
        append initrd=/initrd.img CMDLINE quiet SRC= DATA=
 
-label vesa
-       menu label Live CD - ^VESA mode
-       kernel /kernel
-       append initrd=/initrd.img CMDLINE nomodeset vga=ask SRC= DATA=
-
 label debug
        menu label Live CD - ^Debug mode
        kernel /kernel
@@ -31,7 +26,39 @@ label install
        kernel /kernel
        append initrd=/initrd.img CMDLINE INSTALL=1 DEBUG=
 
+menu separator
+
+menu begin advanced
+menu label ^Advanced options...
+menu title Advanced options
+
+label vesa
+       menu label Live CD ^VESA mode - No GPU hardware acceleration
+       kernel /kernel
+       append initrd=/initrd.img CMDLINE nomodeset vga=ask SRC= DATA=
+
+menu separator
+
 label auto_install
-       menu label ^Audo_Installation - Auto Install to harddisk
+       menu label Audo_^Installation - Auto Install to first harddisk
        kernel /kernel
        append initrd=/initrd.img CMDLINE AUTO_INSTALL=1 DEBUG=
+
+label auto_update
+       menu label Audo_^Update - Auto update Android-x86
+       kernel /kernel
+       append initrd=/initrd.img CMDLINE AUTO_INSTALL=update DEBUG=
+
+menu separator
+
+label local
+       menu label Boot from ^local drive
+       localboot 0xffff
+
+menu separator
+
+label mainmenu
+       menu label ^Back...
+       menu exit
+
+menu end
index d7a02a5..315e228 100644 (file)
@@ -4,7 +4,7 @@ function add_entry {
        menuentry "Android-x86 VER $1" "$@" --class android-x86 {
                shift 2
                savedefault
-               search --no-floppy --set -f $kdir/kernel
+               set root=$android
                linux $kdir/kernel CMDLINE $src $@
                initrd $kdir/initrd.img
        }
@@ -34,14 +34,29 @@ if [ -s $prefix/grubenv ]; then
        load_env
 fi
 
+search --no-floppy --set android -f $kdir/kernel
+export android kdir live src
+
 # Create main menu
 add_entry "$live" quiet
 add_entry "$debug_mode" DEBUG=2
-if [ "$installation" ]; then
-       add_entry "$installation" INSTALL=1
-       add_entry "Auto $installation" AUTO_INSTALL=1
+if [ -s ($android)$kdir/install.img ]; then
+       add_entry "Installation" INSTALL=1
 fi
 
+submenu "Advanced options -> " {
+       add_entry "$live - No Hardware Acceleration" quiet nomodeset HWACCEL=0
+       if [ -s ($android)$kdir/install.img ]; then
+               add_entry "Auto Install to first harddisk" AUTO_INSTALL=1
+               add_entry "Auto Update" AUTO_INSTALL=update
+       fi
+       if [ "$grub_cpu" != "i386" ]; then
+               menuentry "Reboot" { reboot }
+               menuentry "Poweroff" { halt }
+               menuentry "UEFI BIOS Setup" { fwsetup }
+       fi
+}
+
 if [ "$grub_cpu" = "i386" ]; then
        set grub=grubia32
 else