mklive/scripts/installer.sh

38 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2018-05-21 12:41:52 +00:00
#!/bin/bash
source $(dirname $0)/defaults.conf
source ${WORKDIR}/mklive.conf
source $(dirname $0)/functions.sh
set -e
einfo "Preparing Installer"
2018-05-21 12:41:52 +00:00
startstage installer
requiredir ${WORKDIR}/INSTALLER
installerdists=""
if [ "$ISO_INCLUDE_UBUNTU_INSTALLER" == "true" ] || [ "$PXE_INCLUDE_UBUNTU_INSTALLER" == "true" ]; then
installerdists="${installerdists} ubuntu"
fi
if [ "$ISO_INCLUDE_DEBIAN_INSTALLER" == "true" ] || [ "$PXE_INCLUDE_DEBIAN_INSTALLER" == "true" ]; then
installerdists="${installerdists} debian"
fi
for dist in $installerdists
do
URLVAR="${dist^^}_INSTALL_NETBOOT"
[ -z "${!URLVAR}" ] && continue;
[ -e ${WORKDIR}/INSTALLER/${dist}_netboot.tar.gz ] || ( einfo "Missing ${dist} netboot installer. Downloading ..." && wget ${!URLVAR} -O ${WORKDIR}/INSTALLER/${dist}_netboot.tar.gz )
[ $? -eq 0 ] || ( eerr "Download failed." && break )
2018-05-21 12:41:52 +00:00
tar -C ${WORKDIR}/INSTALLER -xzf ${WORKDIR}/INSTALLER/${dist}_netboot.tar.gz ./$dist-installer/amd64/linux ./${dist}-installer/amd64/initrd.gz
tar -C ${WORKDIR}/INSTALLER --transform "s/txt/${dist}/" --strip 4 -xzf ${WORKDIR}/INSTALLER/${dist}_netboot.tar.gz ./${dist}-installer/amd64/boot-screens/txt.cfg
done
eok "Installer done."
2018-05-21 12:41:52 +00:00
endstage installer