package-iso 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # add the installer image to the iso for non-network / dev/test
  32. cp ${ARTIFACTS}/installer.tar ${CD}/rancheros/
  33. cp ${ARTIFACTS}/Dockerfile.amd64 ${CD}/rancheros/
  34. gzip ${CD}/rancheros/installer.tar
  35. cd ${CD} && xorriso \
  36. -as mkisofs \
  37. -l -J -R -V "${DISTRIB_ID}" \
  38. -no-emul-boot -boot-load-size 4 -boot-info-table \
  39. -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
  40. -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
  41. -o $ISO ${CD}
  42. cd $(dirname $ISO)
  43. rm -f $CHECKSUM
  44. for algo in sha256 md5; do
  45. echo "$algo: $(${algo}sum $(basename $ISO))" >> $CHECKSUM
  46. done