From 29ed9e9f03a36c79903fa5b1a9df64cdd94af5af Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 Nov 2023 13:34:21 +0100 Subject: [PATCH] main,static,sys --- grub.cfg.sh | 2 +- live/configfile.sh | 7 +++- live/menu/cmd.sh | 8 +++-- live/{ => menu}/main.sh | 5 +-- live/menu/static.sh | 10 ++++++ live/source/env.sh | 3 +- live/source/sys.sh | 22 ++++++++++++ readme.md | 13 ++++--- readme/grub.md | 78 ++++++++++++++++++++++------------------- 9 files changed, 98 insertions(+), 50 deletions(-) rename live/{ => menu}/main.sh (53%) create mode 100644 live/menu/static.sh create mode 100644 live/source/sys.sh diff --git a/grub.cfg.sh b/grub.cfg.sh index 5d2675d..28aa68e 100644 --- a/grub.cfg.sh +++ b/grub.cfg.sh @@ -116,7 +116,7 @@ function grub_main { source "${file}" done unset file - source "${live}/main.sh" + source "${live}/menu/main.sh" fi grub_list_vars grub_list_xtra diff --git a/live/configfile.sh b/live/configfile.sh index 0c91d68..2df106e 100644 --- a/live/configfile.sh +++ b/live/configfile.sh @@ -1 +1,6 @@ -menuentry 'configfile' { nop } +menuentry 'menuentry 1' { nop } +submenu 'submenu' { + menuentry 'subentry 1' { nop } + menuentry 'subentry 2' { nop } +} +menuentry 'menuentry 2' { nop } diff --git a/live/menu/cmd.sh b/live/menu/cmd.sh index eece47c..da8cd72 100644 --- a/live/menu/cmd.sh +++ b/live/menu/cmd.sh @@ -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 } diff --git a/live/main.sh b/live/menu/main.sh similarity index 53% rename from live/main.sh rename to live/menu/main.sh index 7d5f959..0a2064f 100644 --- a/live/main.sh +++ b/live/menu/main.sh @@ -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' } diff --git a/live/menu/static.sh b/live/menu/static.sh new file mode 100644 index 0000000..234be81 --- /dev/null +++ b/live/menu/static.sh @@ -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' } diff --git a/live/source/env.sh b/live/source/env.sh index 508fcef..4b49aeb 100644 --- a/live/source/env.sh +++ b/live/source/env.sh @@ -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 diff --git a/live/source/sys.sh b/live/source/sys.sh new file mode 100644 index 0000000..183b313 --- /dev/null +++ b/live/source/sys.sh @@ -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 +} diff --git a/readme.md b/readme.md index cc68b0f..aaf70b3 100644 --- a/readme.md +++ b/readme.md @@ -39,20 +39,22 @@ Build an ESP File System including: │ └── nightly.png ├── license.md ├── live -│ ├── main.sh │ ├── menu │ │ ├── cmd.sh │ │ ├── env.sh │ │ ├── gfx.sh +│ │ ├── main.sh │ │ ├── pause.sh │ │ ├── scan.sh -│ │ └── set.sh +│ │ ├── set.sh +│ │ └── static.sh │ └── source │ ├── boot.sh │ ├── env.sh │ ├── menu.sh │ ├── probe.sh │ ├── scan.sh +│ ├── sys.sh │ └── util.sh ├── readme │ └── grub.md @@ -112,20 +114,22 @@ build.sh pgp_fingerprint /esp/mount/point [/data/mount/point] │ │ ├── *.lst │ │ └── *.mod │ └── lsgm -│ ├── main.sh │ ├── menu │ │ ├── cmd.sh │ │ ├── env.sh │ │ ├── gfx.sh +│ │ ├── main.sh │ │ ├── pause.sh │ │ ├── scan.sh -│ │ └── set.sh +│ │ ├── set.sh +│ │ └── static.sh │ └── source │ ├── boot.sh │ ├── env.sh │ ├── menu.sh │ ├── probe.sh │ ├── scan.sh +│ ├── sys.sh │ └── util.sh ├── efi │ └── boot @@ -211,6 +215,7 @@ bash /media/ssd/esp/bios/setup.sh /dev/sda * [ ] try -mount-opts * refactor grub list_{const,vars,xtra} & split +* setparams probe_unset & smbios_unset ### Python diff --git a/readme/grub.md b/readme/grub.md index d618a0b..d0d967a 100644 --- a/readme/grub.md +++ b/readme/grub.md @@ -134,51 +134,37 @@ #### allowed -* . -* [ -* authenticate * background_color -* background_image +* submenu +* terminal_input +* terminfo + +##### unused + +* . +* authenticate * boot * break * cat -* chainloader * clear -* configfile * continue * cpuid -* cryptomount * distrust * dump -* echo -* exit -* export * extract_entries_configfile * extract_entries_source -* false -* fwsetup * gettext -* halt * help -* initrd * initrdefi * insmod * keystatus -* linux * linuxefi -* list_env -* list_trusted -* load_env -* loadfont -* loopback -* ls * lsefi * lsefimmap * lsefisystab * lsfonts * lsmod * lssal -* menuentry * net_add_addr * net_add_dns * net_add_route @@ -196,38 +182,58 @@ * net_ls_routes * net_nslookup * normal -* normal_exit * password_pbkdf2 * play -* probe -* reboot -* regexp -* return * rmmod -* save_env -* search * search.file * search.fs_label * search.fs_uuid * serial * set +* test +* zfs-bootfs +* zfsinfo +* zfskey + +##### used + +* [ +* background_image +* chainloader +* configfile +* cryptomount +* echo +* exit +* export +* false +* fwsetup +* halt +* initrd +* linux +* list_env +* list_trusted +* load_env +* loadfont +* loopback +* ls +* menuentry +* normal_exit +* probe +* reboot +* regexp +* return +* save_env +* search * setparams * shift * sleep * smbios * source -* submenu -* terminal_input * terminal_output -* terminfo -* test * true * trust * unset * verify_detached -* zfs-bootfs -* zfsinfo -* zfskey ## Variables