main,static,sys

This commit is contained in:
Marc Beninca 2023-11-30 13:34:21 +01:00
parent 5c8fedafd9
commit 29ed9e9f03
9 changed files with 98 additions and 50 deletions

View file

@ -1 +1,6 @@
menuentry 'configfile' { nop }
menuentry 'menuentry 1' { nop }
submenu 'submenu' {
menuentry 'subentry 1' { nop }
menuentry 'subentry 2' { nop }
}
menuentry 'menuentry 2' { nop }

View file

@ -1,8 +1,10 @@
env_init
menu_init
menuentry 'halt' { halt }
menuentry 'reboot' { reboot }
menuentry 'reload' { menu }
menuentry 'exit normal' { normal_exit }
menuentry 'exit grub' { exit }
menu_split
menuentry 'setup firmware' { fwsetup }
menu_split
menuentry 'reboot' { reboot }
menuentry 'halt' { halt }

View file

@ -11,7 +11,4 @@ menuentry '↑ cmd →' { menu 'cmd' }
menu_split
menuentry 'configfile' { configfile "${live}/configfile.sh" }
menu_split
menuentry 'bash / stable / tui' { debsquash '/boot/bash/stable/tui' }
menuentry 'bash / stable / gui' { debsquash '/boot/bash/stable/gui' }
menuentry 'bash / latest / tui' { debsquash '/boot/bash/latest/tui' }
menuentry 'bash / latest / gui' { debsquash '/boot/bash/latest/gui' }
menuentry 'static →' { menu 'static' }

10
live/menu/static.sh Normal file
View file

@ -0,0 +1,10 @@
env_init
menu_init
default='lg'
menuentry 'bash / stable / tui' --id 'st' { debsquash '/boot/bash/stable/tui' }
menuentry 'bash / stable / gui' --id 'sg' { debsquash '/boot/bash/stable/gui' }
menu_split
menuentry 'bash / latest / tui' --id 'lt' { debsquash '/boot/bash/latest/tui' }
menuentry 'bash / latest / gui' --id 'lg' { debsquash '/boot/bash/latest/gui' }

View file

@ -37,11 +37,12 @@ function env_get {
if [ "${1}" == 'live_from' ] ; then get="${live_from}" ; fi
if [ "${1}" == 'pause' ] ; then get="${pause}" ; fi
if [ "${1}" == 'time_out' ] ; then get="${time_out}" ; fi
if [ ! "${get}" ] ; then return 1 ; fi
if [ ! "${get}" ] ; then false ; fi
}
function env_init {
grub_init
sys_set
env set
env_mod
env load

22
live/source/sys.sh Normal file
View file

@ -0,0 +1,22 @@
function sys_set {
sys_unset
smbios --set sys_manufacturer --type 1 --get-string 4
smbios --set sys_product --type 1 --get-string 5
smbios --set sys_serial --type 1 --get-string 7
smbios --set sys_uuid --type 1 --get-uuid 8
smbios --set sys_cpu --type 4 --get-string 16
smbios --set sys_ram_max --type 16 --get-dword 7
smbios --set sys_ram --type 19 --get-dword 8
smbios --set sys_ram_dev --type 19 --get-byte 14
}
function sys_unset {
unset sys_manufacturer
unset sys_product
unset sys_serial
unset sys_uuid
unset sys_cpu
unset sys_ram_max
unset sys_ram
unset sys_ram_dev
}