mirror of
https://github.com/rancher/os.git
synced 2025-06-21 04:31:55 +00:00
75 lines
1.9 KiB
Bash
Executable File
75 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
source scripts/build-common
|
|
|
|
|
|
cp bin/rancheros ${BUILD}/initrd/init
|
|
|
|
cd ${BUILD}/initrd
|
|
|
|
if [ "--dev" = "$1" ]; then
|
|
find | cpio -H newc -o > ${DIST}/artifacts/initrd
|
|
cp ${DIST}/artifacts/initrd ${DIST}/artifacts/initrd.none
|
|
else
|
|
find | cpio -H newc -o | lzma -c > ${DIST}/artifacts/initrd
|
|
fi
|
|
|
|
CD=${BUILD}/cd
|
|
|
|
mkdir -p ${CD}/boot/isolinux
|
|
cp ${DIST}/artifacts/vmlinuz ${CD}/boot
|
|
cp ${DIST}/artifacts/initrd ${CD}/boot
|
|
cp /usr/lib/syslinux/isolinux.bin ${CD}/boot/isolinux
|
|
cp /usr/lib/syslinux/linux.c32 ${CD}/boot/isolinux/ldlinux.c32
|
|
|
|
cat > ${CD}/boot/isolinux/isolinux.cfg << EOF
|
|
default rancheros
|
|
label rancheros
|
|
kernel /boot/vmlinuz
|
|
initrd /boot/initrd
|
|
append quiet rancher.password=rancher
|
|
EOF
|
|
|
|
cd ${CD}
|
|
# Copied from boot2docker, thanks.
|
|
xorriso \
|
|
-publisher "Rancher Labs, Inc." \
|
|
-as mkisofs \
|
|
-l -J -R -V "RancherOS" \
|
|
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
|
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
|
|
-isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
|
|
-o ${DIST}/artifacts/rancheros.iso $(pwd)
|
|
|
|
cat > ${CD}/boot/isolinux/isolinux.cfg << EOF
|
|
default rancheros
|
|
label rancheros
|
|
kernel /boot/vmlinuz
|
|
initrd /boot/initrd
|
|
append quiet rancher.password=rancher rancher.state.autoformat=[/dev/sda,/dev/vda]
|
|
EOF
|
|
|
|
cd ${CD}
|
|
xorriso \
|
|
-publisher "Rancher Labs, Inc." \
|
|
-as mkisofs \
|
|
-l -J -R -V "RancherOS" \
|
|
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
|
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
|
|
-isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
|
|
-o ${DIST}/artifacts/machine-rancheros.iso $(pwd)
|
|
|
|
|
|
if [ -e ${DIST}/artficats/iso-checksums.txt ]; then
|
|
rm ${DIST}/artficats/iso-checksums.txt
|
|
fi
|
|
|
|
for algorithm in 'sha256' 'md5'; do
|
|
for i in ${DIST}/artifacts/*iso; do
|
|
echo "${algorithm}: $(${algorithm}sum ${i})" >> ${DIST}/artifacts/iso-checksums.txt
|
|
done
|
|
done
|