minor tweaks to config parsing

This commit is contained in:
Francis Lam 2017-04-29 21:50:10 -04:00
parent efd662c63a
commit 1f8eaa696e
No known key found for this signature in database
GPG Key ID: 0A59C698920806EB

View File

@ -13,7 +13,7 @@ reset_entry() {
echo_entry() { echo_entry() {
if [ "$kexectype" = "elf" ]; then if [ "$kexectype" = "elf" ]; then
if [ -z "$kernel" -o -z "$initrd" ]; then return; fi if [ -z "$kernel" ]; then return; fi
entry="$name|$kexectype|kernel $kernel|initrd $initrd" entry="$name|$kexectype|kernel $kernel|initrd $initrd"
if [ -n "$append" ]; then entry="$entry|append $append"; fi if [ -n "$append" ]; then entry="$entry|append $append"; fi
@ -57,6 +57,9 @@ grub_entry() {
kernel="$val" kernel="$val"
;; ;;
module*) module*)
case $val in
--nounzip*) val=`echo $val | cut -d\ -f2-` ;;
esac
modules="$modules|module $val" modules="$modules|module $val"
;; ;;
linux*) linux*)
@ -105,14 +108,17 @@ EOF
} }
syslinux_entry() { syslinux_entry() {
label_line=${line:0:5} case $line in
if [ -z "$line" ]; then "")
syslinux_end syslinux_end
fi return
if [ "$label_line" = "label" -o "$label_line" = "LABEL" ]; then ;;
search_entry label* | LABEL* )
return syslinux_end
fi search_entry
return
;;
esac
# add info to menuentry # add info to menuentry
trimcmd=`echo $line | tr '\t ' ' ' | tr -s ' '` trimcmd=`echo $line | tr '\t ' ' ' | tr -s ' '`