refactor
This commit is contained in:
parent
0dc8e3e6b1
commit
39e1a9b927
15 changed files with 72 additions and 81 deletions
54
live/source/scan.sh
Normal file
54
live/source/scan.sh
Normal file
|
@ -0,0 +1,54 @@
|
|||
function scan {
|
||||
if [ "${1}" ] ; then
|
||||
paths="${1}/*"
|
||||
else
|
||||
regexp --set default '(\(.*\))' "${cmdpath}"
|
||||
paths='(*)'
|
||||
fi
|
||||
for path in ${paths} ; do
|
||||
if [ "${1}" ] ; then
|
||||
regexp --set tmp '.*/(.*)' "${path}"
|
||||
else
|
||||
if [ "${path}" == "${default}" ] ; then
|
||||
tmp="→ ${path}"
|
||||
else
|
||||
tmp=" ${path}"
|
||||
fi
|
||||
probe_set "${path}"
|
||||
tmp="${tmp}${probe_entry}"
|
||||
fi
|
||||
if [ "${tmp}" != '*' ] ; then
|
||||
if [ -d "${path}" ] ; then
|
||||
menuentry "${tmp} →" "${path}" --id "${path}" {
|
||||
scan="${2}"
|
||||
menu
|
||||
}
|
||||
else
|
||||
menuentry "${tmp}" {
|
||||
nop
|
||||
}
|
||||
fi
|
||||
fi
|
||||
if [ ! "${1}" ] ; then
|
||||
if [ "${probe_fs}" == 'fat' ] ; then
|
||||
if [ -f "${path}/efi/boot/bootx64.efi" ] ; then
|
||||
menuentry ' efi/boot/bootx64.efi →' "${path}" {
|
||||
chainloader "${2}/efi/boot/bootx64.efi"
|
||||
}
|
||||
fi
|
||||
elif [ "${probe_fs}" ] ; then
|
||||
if [ -d "${path}/boot/bash" ] ; then
|
||||
for x in ${path}/boot/bash/* ; do
|
||||
if [ -f "${x}/gui/filesystem.squashfs" ] ; then
|
||||
regexp --set y '\(.*\)/(.*)' "${x}/gui"
|
||||
menuentry " ${y} →" {
|
||||
nop
|
||||
}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
probe_unset
|
||||
fi
|
||||
done
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue