env_init, grub list & split

This commit is contained in:
Marc Beninca 2023-11-24 06:32:00 +01:00
parent 86d12fe01f
commit 99ae54c84c
11 changed files with 112 additions and 52 deletions

View file

@ -34,10 +34,19 @@ function grub_init {
}
function grub_list_const {
echo -n "\
cpu-platform | ${grub_cpu}-${grub_platform}
cmdpath | ${cmdpath}
"
target="${1}"
setparams \
" cpu-platform | ${grub_cpu}-${grub_platform}" \
" cmdpath | ${cmdpath}"
for entry in "${@}" ; do
if [ "${target}" == 'menu' ] ; then
menuentry "${entry}" { nop }
else
echo "${entry}"
fi
done
unset entry
unset target
}
function grub_list_info {
@ -57,20 +66,38 @@ function grub_list_info {
}
function grub_list_vars {
echo -n "\
root | ${root}
prefix | ${prefix}
check_signatures | ${check_signatures}
"
target="${1}"
setparams \
" root | ${root}" \
" prefix | ${prefix}" \
"check_signatures | ${check_signatures}"
for entry in "${@}" ; do
if [ "${target}" == 'menu' ] ; then
menuentry "${entry}" { nop }
else
echo "${entry}"
fi
done
unset entry
unset target
list_trusted
}
function grub_list_xtra {
echo -n "\
env | ${env}
live | ${live}
data | ${data}
"
target="${1}"
setparams \
" env | ${env}" \
" live | ${live}" \
" data | ${data}"
for entry in "${@}" ; do
if [ "${target}" == 'menu' ] ; then
menuentry "${entry}" { nop }
else
echo "${entry}"
fi
done
unset entry
unset target
}
function grub_main {
@ -107,9 +134,14 @@ function grub_pause {
}
function grub_split {
echo -n "\
---
"
target="${1}"
setparams \
' ---'
if [ "${target}" == 'menu' ] ; then
menuentry "${1}" { nop }
else
echo "${1}"
fi
}
grub_main