# Felhom PUBLIC RELEASE ISO — GRUB menu. GENERATED by iso-repack.sh (FELHOM_MENU=release).
#
# TWO entries, both INTERACTIVE, and that is the whole design.
#
# WHY NOT THE AUTOMATED ENTRY: SPIKE-universal-iso-1 measured that no udev property distinguishes an
# internal system disk from a customer's external backup drive (ID_BUS is `ata` for BOTH on a SATA
# drive in a USB caddy; no removability property is exposed at all; NVMe carries a different property
# set), and that a filter matching two disks does NOT fail safe — the installer silently picks one and
# wipes it, while validate-answer accepts the answer. There is therefore no safe automated disk
# selection for hardware nobody has seen. The stock installer already shows the target disk and a
# `Bootdisk(s)` summary before erasing, so the human doing the choosing is the safety mechanism.
#
# WHY THE GRAPHICAL ENTRY IS DEFAULT: a tester who boots the stick and walks away must not land on a
# destructive unattended path. The default is the one that waits for a person.
#
# WHY timeout=15: SPIKE-universal-iso-2 lost an entire probe to the installed system's 1-SECOND menu.
# A human reading two options on unfamiliar hardware needs longer than a machine does. Note
# `timeout_style` (underscore) — the stock PVE config writes `timeout-style`, which GRUB does not
# recognise as a variable name at all, so the stock menu's own timeout directive is inert.
#
# The `linux` / `initrd` lines are lifted VERBATIM by iso-repack.sh from the stock ISO's own Graphical
# and Terminal-UI entries, so a PVE version bump that changes the kernel path tracks automatically
# instead of silently diverging from a copy frozen here.

insmod gzio
insmod iso9660
insmod png
insmod gfxmenu

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
   font=$prefix/unicode.pf2
fi

set gfxmode=1024x768,800x600,640x480
set gfxpayload=1024x768

if loadfont $font; then
    if test "${grub_platform}" = "efi"; then
        insmod efi_gop
        insmod efi_uga
    fi
    insmod video_bochs
    insmod video_cirrus
    insmod all_video
    insmod gfxterm
    set theme=/boot/grub/felhomtheme/theme.txt
    export theme
    terminal_input console
    terminal_output gfxterm
fi

insmod serial
insmod usbserial_common
insmod usbserial_ftdi
insmod usbserial_pl2303
insmod usbserial_usbdebug
if serial --unit=0 --speed=115200; then
    terminal_input --append serial
    terminal_output --append serial
fi

set timeout_style=menu
set timeout=15
set default=0

menuentry 'Felhom telepítés' --class felhom --class os {
    echo 'A Felhom telepítése indul — válassza ki a lemezt a telepítőben...'
@@LINUX_GFX@@
    echo 'Rendszerbetöltő betöltése...'
@@INITRD@@
}

menuentry 'Felhom telepítés (szöveges mód)' --class felhom --class os {
    echo 'A Felhom telepítése indul szöveges módban...'
@@LINUX_TUI@@
    echo 'Rendszerbetöltő betöltése...'
@@INITRD@@
}
