diff --git a/build.sh b/build.sh index 99b0796..47c200b 100644 --- a/build.sh +++ b/build.sh @@ -57,26 +57,13 @@ rm --force --recursive \ mkdir --parents "${MEMDISK_DIRECTORY}" echo -n "\ -function var_search { - search \\ - --set data \\ +function set_init { + search --no-floppy --set data \\ --fs-uuid '${DATA}' # - search \\ - --set esp \\ + search --no-floppy --set esp \\ --fs-uuid '${ESP}' -} - -function var_set { - check_signatures='no' - pager=1 - # - var_search if [ \"\${esp}\" ] ; then - # - prefix=\"(\${esp})/grub\" - root=\"\${esp}\" - # env=\"(\${esp})/grub.env\" live=\"(\${esp})/${PROJECT}/live\" # @@ -84,13 +71,23 @@ function var_set { source \"\${file}\" done unset file - # - env_init - normal \"\${live}/main.sh\" fi } -var_set +function normal_init { + check_signatures='no' + pager=1 + # + set_init + if [ \"\${esp}\" ] ; then + prefix=\"(\${esp})/grub\" + root=\"\${esp}\" + # + normal \"\${live}/normal.sh\" + fi +} + +normal_init " > "${MEMDISK_FILE}" # gpg --detach-sign "${MEMDISK_FILE}" diff --git a/live/main.sh b/live/main.sh deleted file mode 100644 index 7a38f69..0000000 --- a/live/main.sh +++ /dev/null @@ -1,11 +0,0 @@ -menuentry 'scan →' { menu 'scan' } -menuentry 'var →' { menu 'var' } -menu_split -menuentry 'data / boot / bash / latest / gui' { debsquash '/boot/bash/latest/gui' } -menuentry 'data / boot / bash / latest / tui' { debsquash '/boot/bash/latest/tui' } -menuentry 'data / boot / bash / stable / gui' { debsquash '/boot/bash/stable/gui' } -menuentry 'data / boot / bash / stable / tui' { debsquash '/boot/bash/stable/tui' } -menu_split -menuentry "cmd → ${cmdpath} → ${grub_cpu}-${grub_platform}" { menu 'cmd' } -menuentry "env → ${env} → ${env_mod}" { menu 'env' } -menuentry 'gfx → ?' { menu 'gfx' } diff --git a/live/menu/cmd.sh b/live/menu/cmd.sh index 31687ac..eece47c 100644 --- a/live/menu/cmd.sh +++ b/live/menu/cmd.sh @@ -1,11 +1,8 @@ +env_init menu_init menuentry 'halt' { halt } - menuentry 'reboot' { reboot } - menuentry 'reload' { menu } - menuentry 'exit normal' { normal_exit } - menuentry 'exit grub' { exit } diff --git a/live/menu/env.sh b/live/menu/env.sh index c9c59ee..e97968a 100644 --- a/live/menu/env.sh +++ b/live/menu/env.sh @@ -1,15 +1,14 @@ -menu_init +env_init +menu_init "${env} → ${env_mod}" menuentry 'list file' { env_list pause } - menuentry 'list variables' { set pause } - menuentry 'reset defaults' { env_set env save diff --git a/live/menu/gfx.sh b/live/menu/gfx.sh index ac704fe..61dbd0e 100644 --- a/live/menu/gfx.sh +++ b/live/menu/gfx.sh @@ -1,3 +1,4 @@ +env_init menu_init menuentry 'list' { diff --git a/live/menu/scan.sh b/live/menu/scan.sh index a05e604..5096cdb 100644 --- a/live/menu/scan.sh +++ b/live/menu/scan.sh @@ -1,3 +1,4 @@ +env_init menu_init "${scan}" scan "${scan}" diff --git a/live/menu/set.sh b/live/menu/set.sh new file mode 100644 index 0000000..77951ba --- /dev/null +++ b/live/menu/set.sh @@ -0,0 +1,14 @@ +env_init +menu_init + +default='split' + +menuentry "cmdpath: ${cmdpath}" { nop } +menuentry "grub_cpu: ${grub_cpu} → grub_platform: ${grub_platform}" { nop } +menu_split +menuentry "check_signatures: ${check_signatures} → pager: ${pager}" { nop } +menuentry "prefix: ${prefix} → root: ${root}" { nop } +menu_split 'split' +menuentry "esp: ${esp} → data: ${data}" { nop } +menuentry "env: ${env} → env_mod: ${env_mod}" { nop } +menuentry "live: ${live}" { nop } diff --git a/live/menu/var.sh b/live/menu/var.sh deleted file mode 100644 index eccc39c..0000000 --- a/live/menu/var.sh +++ /dev/null @@ -1,12 +0,0 @@ -menu_init -default='split' -menuentry "check_signatures | ${check_signatures}" { nop } -menuentry "pager | ${pager}" { nop } -menuentry "prefix | ${prefix}" { nop } -menuentry "root | ${root}" { nop } -menu_split 'split' -menuentry "data | ${data}" { nop } -menuentry "esp | ${esp}" { nop } -menuentry "env | ${env}" { nop } -menuentry "env_mod | ${env_mod}" { nop } -menuentry "live | ${live}" { nop } diff --git a/live/normal.sh b/live/normal.sh new file mode 100644 index 0000000..6362e1e --- /dev/null +++ b/live/normal.sh @@ -0,0 +1,15 @@ +env_init +menu_init + +default='scan' + +menuentry ' scan →' --id 'scan' { menu 'scan' } +menuentry '↑ gfx →' { menu 'gfx' } +menuentry '↑ env →' { menu 'env' } +menuentry '↑ set →' { menu 'set' } +menuentry '↑ cmd →' { menu 'cmd' } +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' } diff --git a/live/source/env.sh b/live/source/env.sh index 16146c0..3c56130 100644 --- a/live/source/env.sh +++ b/live/source/env.sh @@ -22,6 +22,7 @@ function env_apply { } function env_init { + set_init env_set env_mod env_apply @@ -34,13 +35,13 @@ function env_list { } function env_mod { - env_mod='?' + env_mod='---' if [ -f "${env}" ] ; then - env_mod='-' + env_mod='--x' if env 'load' ; then - env_mod='r' + env_mod='r-x' if env 'save' ; then - env_mod='w' + env_mod='rwx' fi fi fi diff --git a/live/source/menu.sh b/live/source/menu.sh index 9a7a812..e4a96b4 100644 --- a/live/source/menu.sh +++ b/live/source/menu.sh @@ -16,13 +16,15 @@ function menu_color { } function menu_init { - if [ "${1}" ] ; then - menuentry "→ ${menu} → ${1}" { nop } - else - menuentry "→ ${menu}" { nop } + if [ "${menu}" ] ; then + if [ "${1}" ] ; then + menuentry "→ ${menu} → ${1}" { nop } + else + menuentry "→ ${menu}" { nop } + fi + menu_split + default=2 fi - menu_split - default=2 } function menu_item { @@ -39,8 +41,6 @@ function menu_item { function menu_load { menu="${1}" export menu - # env_export - var_export configfile "${live}/menu/${menu}.sh" } diff --git a/live/source/var.sh b/live/source/var.sh deleted file mode 100644 index ed44966..0000000 --- a/live/source/var.sh +++ /dev/null @@ -1,6 +0,0 @@ -function var_export { - export \ - data esp \ - env env_mod \ - live -}