package-iso 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. rm -rf ${CD}/
  9. ISO=${ARTIFACTS}/$(echo ${DISTRIB_ID} | tr '[:upper:]' '[:lower:]').iso
  10. CHECKSUM=iso-checksums.txt
  11. mkdir -p ${CD}/boot/isolinux
  12. mkdir -p ${CD}/rancheros
  13. cp ${ARTIFACTS}/${INITRD} ${CD}/boot
  14. # TODO: these move to os-kernel
  15. pwd
  16. ls dist/artifacts/vmlinuz-${KERNEL_VERSION}
  17. cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/
  18. #TODO cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${CD}/boot/
  19. # cfg files creation moved to package-installer
  20. DIST=$(pwd)/dist
  21. cp -r ${DIST}/boot/* ${CD}/boot/
  22. cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
  23. cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/
  24. cp /usr/lib/syslinux/modules/bios/*.c32 ${CD}/boot/isolinux/
  25. # add the installer image to the iso for non-network / dev/test
  26. cp ${ARTIFACTS}/installer.tar ${CD}/rancheros/
  27. cp ${ARTIFACTS}/Dockerfile.${ARCH} ${CD}/rancheros/
  28. gzip ${CD}/rancheros/installer.tar
  29. cd ${CD} && xorriso \
  30. -as mkisofs \
  31. -l -J -R -V "${DISTRIB_ID}" \
  32. -no-emul-boot -boot-load-size 4 -boot-info-table \
  33. -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
  34. -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
  35. -o $ISO ${CD}
  36. cd $(dirname $ISO)
  37. rm -f $CHECKSUM
  38. for algo in sha256 md5; do
  39. echo "$algo: $(${algo}sum $(basename $ISO))" >> $CHECKSUM
  40. done