package-iso 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 \
  13. [[ "${ARCH}" != "amd64" ]] || \
  14. [ ! -f ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ] || \
  15. [ ! -f ${ARTIFACTS}/${INITRD} ]; \
  16. then
  17. echo "Skipping package-iso due to ARM/ARM64 build: ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} or ${ARTIFACTS}/${INITRD} not found"
  18. exit 0
  19. fi
  20. cp ${ARTIFACTS}/${INITRD} ${CD}/boot
  21. # TODO: these move to os-kernel
  22. pwd
  23. ls dist/artifacts/vmlinuz-${KERNEL_VERSION}
  24. cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/
  25. #TODO cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${CD}/boot/
  26. # cfg files creation moved to package-installer
  27. DIST=$(pwd)/dist
  28. cp -r ${DIST}/boot/* ${CD}/boot/
  29. cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
  30. cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/
  31. cp /usr/lib/syslinux/modules/bios/*.c32 ${CD}/boot/isolinux/
  32. # add the installer image to the iso for non-network / dev/test
  33. cp ${ARTIFACTS}/installer.tar ${CD}/rancheros/
  34. cp ${ARTIFACTS}/Dockerfile.amd64 ${CD}/rancheros/
  35. gzip ${CD}/rancheros/installer.tar
  36. cd ${CD} && xorriso \
  37. -as mkisofs \
  38. -l -J -R -V "${DISTRIB_ID}" \
  39. -no-emul-boot -boot-load-size 4 -boot-info-table \
  40. -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
  41. -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
  42. -o $ISO ${CD}
  43. cd $(dirname $ISO)
  44. rm -f $CHECKSUM
  45. for algo in sha256 md5; do
  46. echo "$algo: $(${algo}sum $(basename $ISO))" >> $CHECKSUM
  47. done