This commit is contained in:
Marc Beninca 2023-10-01 19:59:50 +02:00
parent 39e1a9b927
commit cf876c72d8
12 changed files with 64 additions and 68 deletions

View file

@ -57,26 +57,13 @@ rm --force --recursive \
mkdir --parents "${MEMDISK_DIRECTORY}" mkdir --parents "${MEMDISK_DIRECTORY}"
echo -n "\ echo -n "\
function var_search { function set_init {
search \\ search --no-floppy --set data \\
--set data \\
--fs-uuid '${DATA}' --fs-uuid '${DATA}'
# #
search \\ search --no-floppy --set esp \\
--set esp \\
--fs-uuid '${ESP}' --fs-uuid '${ESP}'
}
function var_set {
check_signatures='no'
pager=1
#
var_search
if [ \"\${esp}\" ] ; then if [ \"\${esp}\" ] ; then
#
prefix=\"(\${esp})/grub\"
root=\"\${esp}\"
#
env=\"(\${esp})/grub.env\" env=\"(\${esp})/grub.env\"
live=\"(\${esp})/${PROJECT}/live\" live=\"(\${esp})/${PROJECT}/live\"
# #
@ -84,13 +71,23 @@ function var_set {
source \"\${file}\" source \"\${file}\"
done done
unset file unset file
#
env_init
normal \"\${live}/main.sh\"
fi 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}" " > "${MEMDISK_FILE}"
# gpg --detach-sign "${MEMDISK_FILE}" # gpg --detach-sign "${MEMDISK_FILE}"

View file

@ -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' }

View file

@ -1,11 +1,8 @@
env_init
menu_init menu_init
menuentry 'halt' { halt } menuentry 'halt' { halt }
menuentry 'reboot' { reboot } menuentry 'reboot' { reboot }
menuentry 'reload' { menu } menuentry 'reload' { menu }
menuentry 'exit normal' { normal_exit } menuentry 'exit normal' { normal_exit }
menuentry 'exit grub' { exit } menuentry 'exit grub' { exit }

View file

@ -1,15 +1,14 @@
menu_init env_init
menu_init "${env}${env_mod}"
menuentry 'list file' { menuentry 'list file' {
env_list env_list
pause pause
} }
menuentry 'list variables' { menuentry 'list variables' {
set set
pause pause
} }
menuentry 'reset defaults' { menuentry 'reset defaults' {
env_set env_set
env save env save

View file

@ -1,3 +1,4 @@
env_init
menu_init menu_init
menuentry 'list' { menuentry 'list' {

View file

@ -1,3 +1,4 @@
env_init
menu_init "${scan}" menu_init "${scan}"
scan "${scan}" scan "${scan}"

14
live/menu/set.sh Normal file
View file

@ -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 }

View file

@ -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 }

15
live/normal.sh Normal file
View file

@ -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' }

View file

@ -22,6 +22,7 @@ function env_apply {
} }
function env_init { function env_init {
set_init
env_set env_set
env_mod env_mod
env_apply env_apply
@ -34,13 +35,13 @@ function env_list {
} }
function env_mod { function env_mod {
env_mod='?' env_mod='---'
if [ -f "${env}" ] ; then if [ -f "${env}" ] ; then
env_mod='-' env_mod='--x'
if env 'load' ; then if env 'load' ; then
env_mod='r' env_mod='r-x'
if env 'save' ; then if env 'save' ; then
env_mod='w' env_mod='rwx'
fi fi
fi fi
fi fi

View file

@ -16,13 +16,15 @@ function menu_color {
} }
function menu_init { function menu_init {
if [ "${1}" ] ; then if [ "${menu}" ] ; then
menuentry "${menu}${1}" { nop } if [ "${1}" ] ; then
else menuentry "${menu}${1}" { nop }
menuentry "${menu}" { nop } else
menuentry "${menu}" { nop }
fi
menu_split
default=2
fi fi
menu_split
default=2
} }
function menu_item { function menu_item {
@ -39,8 +41,6 @@ function menu_item {
function menu_load { function menu_load {
menu="${1}" menu="${1}"
export menu export menu
# env_export
var_export
configfile "${live}/menu/${menu}.sh" configfile "${live}/menu/${menu}.sh"
} }

View file

@ -1,6 +0,0 @@
function var_export {
export \
data esp \
env env_mod \
live
}