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() { startstage() {
requiredir ${WORKDIR}/stage
echo -n "started" > ${WORKDIR}/stage/_$1 echo -n "started" > ${WORKDIR}/stage/_$1
} }
endstage() { endstage() {
echo -n "done" > ${WORKDIR}/stage/_$1 echo -n "done" > ${WORKDIR}/stage/_$1
} }

View File

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

View File

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