mklive/scripts/menufunction.sh

178 lines
2.6 KiB
Bash

function menuhead {
if [ -n $SERIAL_PORT ]; then
SERIAL="SERIAL $SERIAL_PORT $SERIAL_SPEED"
fi
cat << EOF
$SERIAL
UI menu.c32
prompt 0
menu title BOOT MENU
timeout 300
EOF
}
function menulivehead {
cat << EOF
label -
menu label Live Systems:
menu disable
EOF
}
function menulive {
cat << EOF
label live
menu label ${LIVE_NAME}
menu default
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live
EOF
}
function menulivepxe {
# FETCH
# ftp, http, tftp
num=$(echo "$PXE_FETCH_FTP $PXE_FETCH_HTTP $PXE_FETCH_TFTP" | wc -w)
if [ $num -gt 1 ];then
cat << EOF
menu begin live-menu
menu label ${LIVE_NAME}
menu title ${LIVE_NAME} BOOT
EOF
fi
if [ -n "$PXE_FETCH_FTP" ]; then
cat << EOF
label live
menu label ${LIVE_NAME} (fetch via ftp)
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_FTP}/live/filesystem.squashfs
EOF
fi
if [ -n "$PXE_FETCH_HTTP" ]; then
cat << EOF
label live
menu label ${LIVE_NAME} (fetch via http)
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_HTTP}/live/filesystem.squashfs
EOF
fi
if [ -n "$PXE_FETCH_TFTP" ]; then
cat << EOF
label live
menu label ${LIVE_NAME} (fetch via tftp)
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_TFTP}/live/filesystem.squashfs
EOF
fi
if [ $num -gt 1 ];then
cat << EOF
label exit-${dist}-installer
menu label Exit
menu exit
menu end
EOF
fi
}
function menuhwhead {
cat << EOF
label -
menu label Hardware tools:
menu disable
EOF
}
function menuhwhdt {
cat << EOF
label hdt
menu label ^Hardware Detection Tool (HDT)
kernel hdt.c32
text help
HDT displays low-level information about the systems hardware.
endtext
EOF
}
function menuhwmemtest {
cat << EOF
label memtest86+
menu label ^Memory Failure Detection (memtest86+)
kernel ../memtest
EOF
}
function menuinstallerhead {
cat << EOF
label -
menu label Installer:
menu disable
EOF
}
function menuinstaller {
dist=$1
cat << EOF
menu begin $dist-installer-menu
menu label ${dist^} Installer
menu title ${dist^^} INSTALLER
EOF
sed -r -e "s/(default .*)//g" \
-e "s/(label) ([a-z]+)/\1 \2-${dist}/g" \
-e "s/(${dist}-installer)/..\/\1/g" \
$WORKDIR/INSTALLER/${dist}.cfg
if [ -n "$SERIAL_PORT" ]; then
sed -r -e "s/(default .*)//g" \
-e "s/(label) ([a-z]+)/\1 \2-${dist}-serial/g" \
-e "s/(menu label .*)/\1 with Serial Console/g" \
-e "s/(${dist}-installer)/..\/\1/g" \
-e "s/(append.+)(--- quiet)/\1console=ttyS${SERIAL_PORT},${SERIAL_SPEED}n8 \2/" \
$WORKDIR/INSTALLER/${dist}.cfg
fi
cat << EOF
label exit-${dist}-installer
menu label Exit
menu exit
menu end
EOF
}