package-iso 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. set -e
  3. set -x
  4. source $(dirname $0)/version
  5. cd $(dirname $0)/..
  6. ARTIFACTS=$(pwd)/dist/artifacts
  7. CD=${BUILD}/cd
  8. ISO=${ARTIFACTS}/$(echo ${DISTRIB_ID} | tr '[:upper:]' '[:lower:]').iso
  9. CHECKSUM=iso-checksums.txt
  10. mkdir -p ${CD}/boot/isolinux
  11. mkdir -p ${CD}/rancheros
  12. if [ ! -f ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ] || [ ! -f ${ARTIFACTS}/${INITRD} ]; then
  13. echo "Skipping package-iso due to ARM build: ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} or ${ARTIFACTS}/${INITRD} not found"
  14. exit 0
  15. fi
  16. cp ${ARTIFACTS}/${INITRD} ${CD}/boot
  17. # TODO: these move to os-kernel
  18. pwd
  19. ls dist/artifacts/vmlinuz-${KERNEL_VERSION}
  20. cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/
  21. #TODO cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${CD}/boot/
  22. # cfg files creation moved to package-installer
  23. DIST=$(pwd)/dist
  24. cp -r ${DIST}/boot/* ${CD}/boot/
  25. cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
  26. cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/
  27. # add the installer image to the iso for non-network / dev/test
  28. cp ${ARTIFACTS}/installer.tar ${CD}/rancheros/
  29. cp ${ARTIFACTS}/Dockerfile.amd64 ${CD}/rancheros/
  30. gzip ${CD}/rancheros/installer.tar
  31. cd ${CD} && xorriso \
  32. -as mkisofs \
  33. -l -J -R -V "${DISTRIB_ID}" \
  34. -no-emul-boot -boot-load-size 4 -boot-info-table \
  35. -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
  36. -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
  37. -o $ISO ${CD}
  38. cd $(dirname $ISO)
  39. rm -f $CHECKSUM
  40. for algo in sha256 md5; do
  41. echo "$algo: $(${algo}sum $(basename $ISO))" >> $CHECKSUM
  42. done