some old changes

This commit is contained in:
nospoonuser 2018-11-06 23:29:48 +01:00
parent cd6be254ac
commit 4c6705a312
3 changed files with 36 additions and 27 deletions

View File

@ -23,8 +23,10 @@ checkstage() {
}
startstage() {
requiredir ${WORKDIR}/stage
echo -n "started" > ${WORKDIR}/stage/_$1
}
endstage() {
echo -n "done" > ${WORKDIR}/stage/_$1
}

View File

@ -5,7 +5,9 @@ if [ -n $SERIAL_PORT ]; then
SERIAL="SERIAL $SERIAL_PORT $SERIAL_SPEED"
fi
cat << EOF
PATH $1
$SERIAL
UI menu.c32
@ -31,8 +33,8 @@ cat << EOF
label live
menu label ${LIVE_NAME}
menu default
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live
kernel /live/vmlinuz
append initrd=/live/initrd.img boot=live
EOF
}
@ -74,8 +76,8 @@ cat << EOF
label live-ftp
menu label ${LIVE_NAME} (FTP)
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_FTP}live/filesystem.squashfs
kernel /live/vmlinuz
append initrd=/live/initrd.img boot=live fetch=${PXE_FETCH_FTP}live/filesystem.squashfs
TEXT HELP
Boot ${LIVE_NAME} via ftp.
${LIVE_DESC}
@ -89,8 +91,8 @@ cat << EOF
label live-http
menu label ${LIVE_NAME} (HTTP)
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_HTTP}live/filesystem.squashfs
kernel /live/vmlinuz
append initrd=/live/initrd.img boot=live fetch=${PXE_FETCH_HTTP}live/filesystem.squashfs
TEXT HELP
Boot ${LIVE_NAME} via http.
${LIVE_DESC}
@ -104,8 +106,8 @@ cat << EOF
label live-tftp
menu label ${LIVE_NAME} (TFTP)
kernel ../live/vmlinuz
append initrd=../live/initrd.img boot=live fetch=${PXE_FETCH_TFTP}live/filesystem.squashfs
kernel /live/vmlinuz
append initrd=/live/initrd.img boot=live fetch=${PXE_FETCH_TFTP}live/filesystem.squashfs
TEXT HELP
Boot ${LIVE_NAME} via tftp, this is the slowest option.
${DESC_LIVE}
@ -160,7 +162,7 @@ menuhwmemtest(){
cat << EOF
label memtest86+
menu label ^Memory Failure Detection (memtest86+)
kernel ../memtest
kernel /memtest
EOF
}
@ -187,14 +189,14 @@ EOF
sed -r -e "s/(default .*)//g" \
-e "s/(label) ([a-z]+)/\1 \2-${dist}/g" \
-e "s/(${dist}-installer)/..\/\1/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/(${dist}-installer)/\/\1/g" \
-e "s/(append.+)(--- quiet)/\1console=ttyS${SERIAL_PORT},${SERIAL_SPEED}n8 \2/" \
$WORKDIR/INSTALLER/${dist}.cfg
fi
@ -215,13 +217,17 @@ 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
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
#echo "http://${PXE_SERVER}${PXE_HTTP_BASE}/${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~boot~/${archbasedir}/boot~g" \
-e "s~basedir=arch~basedir=${PXE_HTTP_BASE}/${ARCH_BASEDIR}~g" \
-e "s/\\$\{pxeserver\}/${PXE_SERVER}/g" \
-e 's/^(APPEND .*)$/\1 ip=dhcp/g' \
-e "s/^SYSAPPEND [0-9]+/SYSAPPEND 2/g" \
-n -e '/arch64_http/,/^$/p'
fi

View File

@ -11,7 +11,7 @@ fi
einfo "Creating PXE enviroment"
PXELINUX_MODULES="ldlinux.c32 libmenu.c32 menu.c32"
PXELINUX_MODULES="libmenu.c32 menu.c32"
PXELINUX_BIN="/usr/lib/PXELINUX/pxelinux.0"
checkstage live || eexit "Previous stage (live) was not finished"
@ -21,49 +21,50 @@ startstage pxe
PXEDIR=${WORKDIR}/PXE
requiredir $PXEDIR
requiredir $PXEDIR/pxelinux
requiredir $PXEDIR/pxelinux/pxelinux.cfg
requiredir $PXEDIR/pxelinux.cfg
[ -L $PXEDIR/live ] || ln -s ../LIVE $PXEDIR/live
#copy pxelinux.bin
cp ${PXELINUX_BIN} $PXEDIR/pxelinux/
cp ${PXELINUX_BIN} $PXEDIR/
cp ${SYSLINUX_MODULESDIR}/ldlinux.c32 $PXEDIR/
#create pxelinux.conf
menuhead > $PXEDIR/pxelinux/pxelinux.cfg/default
menulivehead >> $PXEDIR/pxelinux/pxelinux.cfg/default
menulivepxe >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuhead "/pxelinux" > $PXEDIR/pxelinux.cfg/default
menulivehead >> $PXEDIR/pxelinux.cfg/default
menulivepxe >> $PXEDIR/pxelinux.cfg/default
if [ "$PXE_INCLUDE_ARCH_LIVE" == "true" ]; then
menuarchlive >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuarchlive >> $PXEDIR/pxelinux.cfg/default
fi
if [ "$PXE_INCLUDE_UBUNTU_INSTALLER" == "true" ] || [ "$PXE_INCLUDE_DEBIAN_INSTALLER" == "true" ]; then
menuinstallerhead >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuinstallerhead >> $PXEDIR/pxelinux.cfg/default
fi
if [ "$PXE_INCLUDE_UBUNTU_INSTALLER" == "true" ]; then
menuinstaller ubuntu >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuinstaller ubuntu >> $PXEDIR/pxelinux.cfg/default
[ -L $PXEDIR/ubuntu-installer ] || ln -s ../INSTALLER/ubuntu-installer $PXEDIR/ubuntu-installer
fi
if [ "$PXE_INCLUDE_DEBIAN_INSTALLER" == "true" ]; then
menuinstaller debian >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuinstaller debian >> $PXEDIR/pxelinux.cfg/default
[ -L $PXEDIR/debian-installer ] || ln -s ../INSTALLER/debian-installer $PXEDIR/debian-installer
fi
if [ "$PXE_INCLUDE_HDT" == "true" ] || [ "$PXE_INCLUDE_MEMTEST" == "true" ]; then
menuhwhead >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuhwhead >> $PXEDIR/pxelinux.cfg/default
fi
if [ "$PXE_INCLUDE_HDT" == "true" ]; then
PXELINUX_MODULES="${PXELINUX_MODULES} hdt.c32 libutil.c32 libgpl.c32 libcom32.c32"
menuhwhdt >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuhwhdt >> $PXEDIR/pxelinux.cfg/default
[ -e /usr/share/misc/pci.ids ] && cp /usr/share/misc/pci.ids $PXEDIR/pxelinux/
fi
if [ "$PXE_INCLUDE_MEMTEST" == "true" ]; then
cp $MEMTEST_BIN $PXEDIR/memtest
menuhwmemtest >> $PXEDIR/pxelinux/pxelinux.cfg/default
menuhwmemtest >> $PXEDIR/pxelinux.cfg/default
fi