### Start
### nst-24-7977.x86_64.iso
set iso_path=""

set default="1"

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video
}

set gfxmode=1024x768x32
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2

insmod gfxterm
insmod gettext
insmod gfxmenu

#terminal_output gfxterm

insmod serial
# Experimenting with serial and console
serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1
terminal_input serial console
#terminal_input serial
# Console seems a safer bet than gfxterm
#terminal_output gfxterm serial
#terminal_output serial gfxterm
terminal_output serial console

menuentry "[1] Console" --hotkey=1 {
	booting ${iso_path}
	loopback loop ${iso_path}
	probe -l (loop) --set=isolabel
	linux	(loop)/isolinux/vmlinuz0 root=live:LABEL=${isolabel} ro rd.live.image quiet acpi=force audit=0 systemd.unit=multi-user.target nstrelocate=false iso-scan/filename=${iso_path}
	initrd	(loop)/isolinux/initrd0.img
	loopback -d loop
}
menuentry "[2] Graphical Desktop" --hotkey=2 {
	booting ${iso_path}
	loopback loop ${iso_path}
	probe -l (loop) --set=isolabel
	linux	(loop)/isolinux/vmlinuz0 root=live:LABEL=${isolabel} ro rd.live.image quiet acpi=force audit=0 rhgb systemd.unit=graphical.target nstrelocate=false iso-scan/filename=${iso_path}
	initrd	(loop)/isolinux/initrd0.img
	loopback -d loop
}
menuentry "[3] Server (Serial ttyS0 at 57600)" --hotkey=3 {
	booting ${iso_path}
	loopback loop ${iso_path}
	probe -l (loop) --set=isolabel
	linux	(loop)/isolinux/vmlinuz0 root=live:LABEL=${isolabel} ro rd.live.image quiet acpi=force rd.dm=0 audit=0 console=tty0 console=ttyS0,57600n8 systemd.unit=multi-user.target nstrelocate=false iso-scan/filename=${iso_path}
	initrd	(loop)/isolinux/initrd0.img
	loopback -d loop
}
menuentry "[4] Rescue Mode" --hotkey=4 {
	booting ${iso_path}
	loopback loop ${iso_path}
	probe -l (loop) --set=isolabel
	linux	(loop)/isolinux/vmlinuz0 root=live:LABEL=${isolabel} ro rd.live.image quiet acpi=force rd.dm=0 audit=0 systemd.unit=rescue.target nstrelocate=false iso-scan/filename=${iso_path}
	initrd	(loop)/isolinux/initrd0.img
	loopback -d loop
}
menuentry "[5] Reset Persistance Overlay & Reboot" --hotkey=5 {
	booting ${iso_path}
	loopback loop ${iso_path}
	probe -l (loop) --set=isolabel
	linux	(loop)/isolinux/vmlinuz0 root=live:LABEL=${isolabel} ro rd.live.image quiet acpi=force rd.dm=0 audit=0 reset_overlay nstreboot systemd.unit=multi-user.target nstrelocate=false iso-scan/filename=${iso_path}
	initrd	(loop)/isolinux/initrd0.img
	loopback -d loop
}
menuentry "[6] Stealth (Aggressive incognito mode)" --hotkey=6 {
	booting ${iso_path}
	loopback loop ${iso_path}
	probe -l (loop) --set=isolabel
	linux	(loop)/isolinux/vmlinuz0 root=live:LABEL=${isolabel} ro rd.live.image quiet acpi=force audit=0 rhgb rd.live.check iso-scan/filename=${iso_path}
	initrd	(loop)/isolinux/initrd0.img
	loopback -d loop
}
### End