1
0
mirror of https://github.com/rancher/os.git synced 2025-08-01 23:17:50 +00:00
os/scripts/package-iso
Sven Dowideit 1a0e818328 make ros install --append work
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-15 23:40:18 +00:00

53 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
set -e
set -x
source $(dirname $0)/version
cd $(dirname $0)/..
ARTIFACTS=$(pwd)/dist/artifacts
CD=${BUILD}/cd
ISO=${ARTIFACTS}/$(echo ${DISTRIB_ID} | tr '[:upper:]' '[:lower:]').iso
CHECKSUM=iso-checksums.txt
mkdir -p ${CD}/boot/isolinux
mkdir -p ${CD}/rancheros
if [ ! -f ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ] || [ ! -f ${ARTIFACTS}/initrd ]; then
exit 0
fi
cp ${ARTIFACTS}/initrd ${CD}/boot
# TODO: these move to os-kernel
pwd
ls dist/artifacts/vmlinuz-${KERNEL_VERSION}
cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/
#TODO cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${CD}/boot/
cat scripts/isolinux.cfg | envsubst > ${CD}/boot/isolinux/isolinux.cfg
cat scripts/isolinux_label.cfg | LABEL=${VERSION} envsubst > ${CD}/boot/linux-current.cfg
#cat scripts/isolinux_label.cfg | LABEL=debug APPEND="rancher.debug=true" envsubst > ${CD}/boot/linux-previous.cfg
cat scripts/global.cfg | LABEL=${VERSION} envsubst > ${CD}/boot/global.cfg
cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/
# add the installer image to the iso for non-network / dev/test
cp ${ARTIFACTS}/installer.tar ${CD}/rancheros/
cp assets/bootinfoscript ${CD}/rancheros/
gzip ${CD}/rancheros/installer.tar
cd ${CD} && xorriso \
-as mkisofs \
-l -J -R -V "${DISTRIB_ID}" \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
-o $ISO ${CD}
cd $(dirname $ISO)
rm -f $CHECKSUM
for algo in sha256 md5; do
echo "$algo: $(${algo}sum $(basename $ISO))" >> $CHECKSUM
done