### Start
### pmagic_2016_07_12.iso
set iso_path=""
booting ${iso_path}
loopback loop ${iso_path}
set root=loop

set default="0"
set timeout="20"
set hidden_timeout_quiet=false
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
set color_normal=white/black
set color_highlight=black/white
loadfont /boot/grub/unicode.pf2
background_image /boot/grub/pmagic.png

set default_settings="edd=on vga=normal"
set live_settings="boot=live eject=no"
set linux_64="/pmagic/bzImage64 iso_filename=${iso_path}"
set linux_32="/pmagic/bzImage iso_filename=${iso_path}"
set initrd_img="/pmagic/initrd.img /pmagic/fu.img /pmagic/m64.img"
set initrd_img32="/pmagic/initrd.img /pmagic/fu.img /pmagic/m32.img"
set default=2

menuentry "Parted Magic UEFI Boot Menu"{
	set
}
menuentry ' '{
	set
}
menuentry "1. Default settings 64 (Runs from RAM)"{
	search --set -f $linux_64
	linux $linux_64 $default_settings
	initrd $initrd_img
}
menuentry "2. Default settings 32"{
	search --set -f $linux_32
	linux $linux_32 $default_settings
	initrd $initrd_img32
}
menuentry "3. Live with default settings 64"{
	search --set -f $linux_64
	linux $linux_64 $default_settings $live_settings
	initrd $initrd_img
}
menuentry "4. Live with default settings 32"{
	search --set -f $linux_32
	linux $linux_32 $default_settings $live_settings
	initrd $initrd_img32
}
if [ -n "$efi" ]; then
menuentry "5. Memtest86+ 64" {
	chainloader /boot/memtest/BOOTX64.EFI
}
menuentry "6. Memtest86+ 32" {
	chainloader /boot/memtest/BOOTIA32.EFI
}
else
menuentry "5. Memtest86+" {
	linux16	/boot/memtest/MEMTEST
}
fi
submenu "Extras Menu"{
set iso_path=""
	set default_settings="edd=on vga=normal"
	set live_settings="boot=live eject=no"
	set linux_64="/pmagic/bzImage64 iso_filename=${iso_path}"
	set linux_32="/pmagic/bzImage iso_filename=${iso_path}"
	set initrd_img="/pmagic/initrd.img /pmagic/fu.img /pmagic/m64.img"
	set initrd_img32="/pmagic/initrd.img /pmagic/fu.img /pmagic/m32.img"
	menuentry "1. Super Grub2 Disk" {
		configfile /boot/grub/grub_sgd2.cfg
	}
	menuentry "2. Clonezilla 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings clonezilla=yes
		initrd $initrd_img
	}
	menuentry "3. Clonezilla 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings clonezilla=yes
		initrd $initrd_img32
	}
	menuentry "4. Nwipe 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings nwipe=yes
		initrd $initrd_img
	}
	menuentry "5. Nwipe 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings nwipe=yes
		initrd $initrd_img32
	}
	menuentry "6. Load iSCSI Kernel Modules 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings iscsi=yes
		initrd $initrd_img
	}
	menuentry "7. Load iSCSI Kernel Modules 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings iscsi=yes
		initrd $initrd_img32
	}
	menuentry "8. Load config for xf86-video-qxl module 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings qxl=yes
		initrd $initrd_img
	}
	menuentry "9. Load config for xf86-video-qxl module 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings qxl=yes
		initrd $initrd_img32
	}
}
}
submenu "Failsafe Menu"{
set iso_path=""
	set default_settings="edd=on vga=normal"
	set live_settings="boot=live eject=no"
	set linux_64="/pmagic/bzImage64 iso_filename=${iso_path}"
	set linux_32="/pmagic/bzImage iso_filename=${iso_path}"
	set initrd_img="/pmagic/initrd.img /pmagic/fu.img /pmagic/m64.img"
	set initrd_img32="/pmagic/initrd.img /pmagic/fu.img /pmagic/m32.img"
	menuentry "1. ACPI=NO for Toshiba Satellite 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings acpi=off
		initrd $initrd_img
	}
	menuentry "2. ACPI=NO for Toshiba Satellite 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings acpi=off
		initrd $initrd_img32
	}
	menuentry "3. Do not eject CD 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings eject=no
		initrd $initrd_img
	}
	menuentry "4. Do not eject CD 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings eject=no
		initrd $initrd_img32
	}
	menuentry "5. Emulator compatibility 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings $live_settings noreplace-paravirt xvesa=yes
		initrd $initrd_img
	}
	menuentry "6. Emulator compatibility 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings $live_settings noreplace-paravirt xvesa=yes
		initrd $initrd_img32
	}
	menuentry "7. Console 64 (boots to the shell)"{
		search --set -f $linux_64
		linux $linux_64 $default_settings consoleboot=yes
		initrd $initrd_img
	}
	menuentry "8. Console 32 (boots to the shell)"{
		search --set -f $linux_32
		linux $linux_32 $default_settings consoleboot=yes
		initrd $initrd_img32
	}
	menuentry "9. Initrd.img 64 (boot to initrd.img shell)"{
		search --set -f $linux_64
		linux $linux_64 $default_settings initrd_shell=yes
		initrd $initrd_img
	}
	menuentry "10. Initrd.img 32 (boot to initrd.img shell)"{
		search --set -f $linux_32
		linux $linux_32 $default_settings initrd_shell=yes
		initrd $initrd_img32
	}
	menuentry "11. KILL Nouveau 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings blacklist=nouveau
		initrd $initrd_img
	}
	menuentry "12. KILL Nouveau 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings blacklist=nouveau
		initrd $initrd_img32
	}
	menuentry "13. Radeon no modeset 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings blacklist=radeon
		initrd $initrd_img
	}
	menuentry "14. Radeon no modeset 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings blacklist=radeon
		initrd $initrd_img32
	}
	menuentry "15. Intel Mobile 4 workaround 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings mobile4=yes
		initrd $initrd_img
	}
	menuentry "16. Intel Mobile 4 workaround 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings mobile4=yes
		initrd $initrd_img32
	}
	menuentry "17. Black/Blank Screen workaround 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings nomodeset
		initrd $initrd_img
	}
	menuentry "18. Black/Blank Screen workaround 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings nomodeset
		initrd $initrd_img32
	}
	menuentry "19. No / force CPU Frequency Scaling 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings cpufreq=no
		initrd $initrd_img
	}
	menuentry "20. No / force CPU Frequency Scaling 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings cpufreq=no
		initrd $initrd_img32
	}
	menuentry "21. Force vesa workaround 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings xconfig=forcevesa
		initrd $initrd_img
	}
	menuentry "22. Force vesa workaround 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings xconfig=forcevesa
		initrd $initrd_img32
	}
	menuentry "23. Force refresh rate 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings xconfig=forcerefresh nomodeset
		initrd $initrd_img
	}
	menuentry "24. Force refresh rate 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings xconfig=forcerefresh nomodeset
		initrd $initrd_img32
	}
	menuentry "25. Disable symmetric multiprocessing 64 (SMP)"{
		search --set -f $linux_64
		linux $linux_64 $default_settings nosmp
		initrd $initrd_img
	}
	menuentry "26. Disable symmetric multiprocessing 32 (SMP)"{
		search --set -f $linux_32
		linux $linux_32 $default_settings nosmp
		initrd $initrd_img32
	}
	menuentry "27. Disable accelerated 3D graphics 64 (DRI)"{
		search --set -f $linux_64
		linux $linux_64 $default_settings nodri=yes
		initrd $initrd_img
	}
	menuentry "28. Disable accelerated 3D graphics 32 (DRI)"{
		search --set -f $linux_32
		linux $linux_32 $default_settings nodri=yes
		initrd $initrd_img32
	}
	menuentry "29. Not enough memory to load specified image 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings mem=1024m
		initrd $initrd_img
	}
	menuentry "30. Not enough memory to load specified image 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings mem=1024m
		initrd $initrd_img32
	}
	menuentry "31. Missing Mouse Pointer 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings xmouse=yes
		initrd $initrd_img
	}
	menuentry "32. Missing Mouse Pointer 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings xmouse=yes
		initrd $initrd_img32
	}
	menuentry "33. Macbook Pro 8,x Dual Graphics Workaround 64"{
		search --set -f $linux_64
		linux $linux_64 $default_settings
		outb 0x728 1 # Switch select
		outb 0x710 2 # Switch display
		outb 0x740 2 # Switch DDC
		outb 0x750 0 # Power down discrete graphics
		initrd $initrd_img
	}
	menuentry "34. Macbook Pro 8,x Dual Graphics Workaround 32"{
		search --set -f $linux_32
		linux $linux_32 $default_settings
		outb 0x728 1 # Switch select
		outb 0x710 2 # Switch display
		outb 0x740 2 # Switch DDC
		outb 0x750 0 # Power down discrete graphics
		initrd $initrd_img32
	}
}
### End