package-iso 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. set -e
  3. source $(dirname $0)/version
  4. cd $(dirname $0)/..
  5. ARTIFACTS=$(pwd)/dist/artifacts
  6. CD=${BUILD}/cd
  7. ISO=${ARTIFACTS}/$(echo ${DISTRIB_ID} | tr '[:upper:]' '[:lower:]').iso
  8. CHECKSUM=iso-checksums.txt
  9. mkdir -p ${CD}/boot/isolinux
  10. mkdir -p ${CD}/boot/isolinux
  11. if [ ! -f ${ARTIFACTS}/vmlinuz ] || [ ! -f ${ARTIFACTS}/initrd ]; then
  12. exit 0
  13. fi
  14. cp ${ARTIFACTS}/initrd ${CD}/boot
  15. cp ${ARTIFACTS}/vmlinuz ${CD}/boot
  16. cp scripts/isolinux.cfg ${CD}/boot/isolinux
  17. cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux
  18. cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux
  19. cd ${CD} && xorriso \
  20. -as mkisofs \
  21. -l -J -R -V "${DISTRIB_ID}" \
  22. -no-emul-boot -boot-load-size 4 -boot-info-table \
  23. -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
  24. -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
  25. -o $ISO ${CD}
  26. cd $(dirname $ISO)
  27. rm -f $CHECKSUM
  28. for algo in sha256 md5; do
  29. echo "$algo: $(${algo}sum $(basename $ISO))" >> $CHECKSUM
  30. done