2018-05-21 12:41:52 +00:00
|
|
|
|
|
|
|
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
|
2018-05-27 13:07:46 +00:00
|
|
|
|
|
|
|
if [ -n "$PXE_HTTP_BASE" ]
|
|
|
|
then
|
|
|
|
PXE_FETCH_HTTP="http://${PXE_SERVER}${PXE_HTTP_BASE}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$PXE_FTP_BASE" ]
|
|
|
|
then
|
|
|
|
PXE_FETCH_FTP="ftp://${PXE_SERVER}${PXE_FTP_BASE}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$PXE_TFTP_BASE" ]
|
|
|
|
then
|
2018-05-27 14:05:28 +00:00
|
|
|
PXE_FETCH_TFTP="tftp://${PXE_SERVER}${PXE_TFTP_BASE}"
|
2018-05-27 13:07:46 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-21 12:41:52 +00:00
|
|
|
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
|
2018-05-27 16:15:04 +00:00
|
|
|
menu label ${LIVE_NAME} (FTP)
|
2018-05-21 12:41:52 +00:00
|
|
|
kernel ../live/vmlinuz
|
2018-05-27 14:05:28 +00:00
|
|
|
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_FTP}live/filesystem.squashfs
|
2018-05-27 16:15:04 +00:00
|
|
|
TEXT HELP
|
|
|
|
Boot "${LIVE_NAME}" via ftp.
|
|
|
|
${LIVE_DESC}
|
2018-05-21 12:41:52 +00:00
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$PXE_FETCH_HTTP" ]; then
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
label live
|
2018-05-27 16:15:04 +00:00
|
|
|
menu label ${LIVE_NAME} (HTTP)
|
2018-05-21 12:41:52 +00:00
|
|
|
kernel ../live/vmlinuz
|
2018-05-27 14:05:28 +00:00
|
|
|
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_HTTP}live/filesystem.squashfs
|
2018-05-27 16:15:04 +00:00
|
|
|
TEXT HELP
|
|
|
|
Boot "${LIVE_NAME}" via http.
|
|
|
|
${LIVE_DESC}
|
|
|
|
ENDTEXT
|
2018-05-21 12:41:52 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$PXE_FETCH_TFTP" ]; then
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
label live
|
2018-05-27 16:15:04 +00:00
|
|
|
menu label ${LIVE_NAME} (TFTP)
|
2018-05-21 12:41:52 +00:00
|
|
|
kernel ../live/vmlinuz
|
2018-05-27 14:05:28 +00:00
|
|
|
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_TFTP}live/filesystem.squashfs
|
2018-05-27 16:15:04 +00:00
|
|
|
TEXT HELP
|
|
|
|
Boot "${LIVE_NAME}" via tftp, this is the slowest option.
|
|
|
|
${DESC_LIVE}
|
|
|
|
ENDTEXT
|
2018-05-21 12:41:52 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-05-27 16:15:04 +00:00
|
|
|
menu separator
|
2018-05-21 12:41:52 +00:00
|
|
|
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
|
2018-05-27 16:15:04 +00:00
|
|
|
|
|
|
|
menu separator
|
2018-05-21 12:41:52 +00:00
|
|
|
label -
|
|
|
|
menu label Installer:
|
|
|
|
menu disable
|
|
|
|
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
function menuinstaller {
|
|
|
|
dist=$1
|
|
|
|
|
|
|
|
cat << EOF
|
|
|
|
menu begin $dist-installer-menu
|
|
|
|
menu label ${dist^} Installer
|
|
|
|
|
2018-05-22 19:41:55 +00:00
|
|
|
menu title ${dist^^} INSTALLER
|
2018-05-21 12:41:52 +00:00
|
|
|
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
|
|
|
|
}
|
2018-05-27 13:07:46 +00:00
|
|
|
|
|
|
|
menuarchlive(){
|
|
|
|
archbasedir=$ARCH_BASEDIR
|
|
|
|
localarchpath=$ARCH_LOCALPATH
|
|
|
|
|
|
|
|
if [ -n "$localarchpath" ] && [ -d $localarchpath/$archisobasedir ];
|
|
|
|
then
|
|
|
|
sed -r -e "s~boot~../${archbasedir}/boot~g" -n -e '/arch64_http/,/^$/p' ${localarchpath}${archbasedir}/boot/syslinux/archiso_pxe.cfg
|
|
|
|
else
|
|
|
|
#echo "http://${pxeserver}/${archbasedir}/boot/syslinux/archiso_pxe.cfg" 1>&2
|
|
|
|
curl -s http://${PXE_SERVER}${PXE_HTTP_BASE}/${archbasedir}/boot/syslinux/archiso_pxe.cfg | sed -r \
|
|
|
|
-e "s~boot~../${archbasedir}/boot~g" \
|
|
|
|
-e "s~basedir=arch~basedir=${PXE_HTTP_BASE}/${ARCH_BASEDIR}~g" \
|
|
|
|
-e "s/\\$\{pxeserver\}/${PXE_SERVER}/g" \
|
|
|
|
-n -e '/arch64_http/,/^$/p'
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|