Config for Arch live system. Script output to strerr

This commit is contained in:
nospoonuser 2018-11-13 10:47:50 +01:00
parent 4c6705a312
commit b0a1a5867d
3 changed files with 27 additions and 8 deletions

View File

@ -1,5 +1,8 @@
MEMTEST_BIN="/boot/memtest86+.bin" MEMTEST_BIN="/boot/memtest86+.bin"
UBUNTU_INSTALL_NETBOOT="http://de.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/netboot.tar.gz" UBUNTU_INSTALL_NETBOOT="http://de.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/netboot.tar.gz"
DEBIAN_INSTALL_NETBOOT="http://ftp.nl.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/netboot.tar.gz" DEBIAN_INSTALL_NETBOOT="http://ftp.nl.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/netboot.tar.gz"
ARCH_BASEDIR="arch/arch" ARCH_BASEDIR="archiso/arch"
PXE_HTTP_PORT=80
ARCHISO_HTTP_PORT=80
LIVE_SSH_ROOTLOGIN="yes" LIVE_SSH_ROOTLOGIN="yes"

View File

@ -6,6 +6,10 @@ LGRAY='\033[0;37m'
NC='\033[0m' NC='\033[0m'
[ -z "$ARCHISO_SERVER" ] && ARCHISO_SERVER=${PXE_SERVER}
[ -z "$ARCHISO_HTTP_BASE" ] && ARCHISO_HTTP_BASE=${PXE_HTTP_BASE}
requiredir() { requiredir() {
[ -n "$1" ] || exit 1 [ -n "$1" ] || exit 1
[ -e $1 ] || mkdir $1 [ -e $1 ] || mkdir $1
@ -31,15 +35,19 @@ endstage() {
echo -n "done" > ${WORKDIR}/stage/_$1 echo -n "done" > ${WORKDIR}/stage/_$1
} }
edebug() {
[ "$MKLIVE_DEBUG" == "true" ] && echo "[dd] $1" 1>&2
}
eok() { eok() {
echo -e "${GREEN}[++] $1${NC}" echo -e "${GREEN}[++] $1${NC}" 1>&2
} }
einfo() { einfo() {
echo -e "${BLUE}[ii] ${1}${NC}" echo -e "${BLUE}[ii] ${1}${NC}" 1>&2
} }
eerr(){ eerr(){
echo -e "${RED}[--] ${1}${NC}" echo -e "${RED}[--] ${1}${NC}" 1>&2
} }

View File

@ -221,14 +221,22 @@ then
-n -e '/arch64_http/,/^$/p' \ -n -e '/arch64_http/,/^$/p' \
${localarchpath}${archbasedir}/boot/syslinux/archiso_pxe.cfg ${localarchpath}${archbasedir}/boot/syslinux/archiso_pxe.cfg
else else
#echo "http://${PXE_SERVER}${PXE_HTTP_BASE}/${archbasedir}/boot/syslinux/archiso_pxe.cfg" 1>&2 #echo "http://${ARCHISO_SERVER}${ARCHISO_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 \ archiso_pxe_url=http://${ARCHISO_SERVER}:${ARCHISO_HTTP_PORT}${ARCHISO_HTTP_BASE}/${archbasedir}/boot/syslinux/archiso_pxe.cfg
edebug "Try to download $archiso_pxe_url"
curl -s $archiso_pxe_url | 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=${ARCHISO_HTTP_BASE}/${ARCH_BASEDIR}~g" \
-e "s/\\$\{pxeserver\}/${PXE_SERVER}/g" \ -e "s/\\$\{pxeserver\}/${ARCHISO_SERVER}:${ARCHISO_HTTP_PORT}/g" \
-e 's/^(APPEND .*)$/\1 ip=dhcp/g' \ -e 's/^(APPEND .*)$/\1 ip=dhcp/g' \
-e "s/^SYSAPPEND [0-9]+/SYSAPPEND 2/g" \ -e "s/^SYSAPPEND [0-9]+/SYSAPPEND 2/g" \
-n -e '/arch64_http/,/^$/p' -n -e '/arch64_http/,/^$/p'
if [ "${PIPESTATUS[0]}" -ne 0 ];
then
eerr "Failed to download archiso_pxe.cfg"
fi
fi fi
} }