You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
1.5 KiB

  1. #!/bin/bash
  2. # build the iso
  3. . config || exit 0
  4. set -x
  5. set -e
  6. if ! [ "$1" == "skip" ] ; then
  7. # copy kernel if changed
  8. if [ ${FS}/initrd.img -nt ${ISO}/casper/initrd.lz ] ; then
  9. sudo cp ${FS}/vmlinuz ${ISO}/casper/vmlinuz
  10. sudo sh -c "zcat ${FS}/initrd.img | lzma > ${ISO}/casper/initrd.lz"
  11. fi
  12. # manifests
  13. sudo chmod +w ${ISO}/casper/filesystem.manifest
  14. sudo chroot ${FS} dpkg-query -W --showformat='${Package} ${Version}\n' \
  15. | sudo tee ${ISO}/casper/filesystem.manifest >/dev/null
  16. # squashfs
  17. sudo rm -f ${ISO}/casper/filesystem.squashfs
  18. sudo mksquashfs ${FS} ${ISO}/casper/filesystem.squashfs
  19. printf $(sudo du -sx --block-size=1 ${FS} | cut -f1) \
  20. | sudo tee ${ISO}/casper/filesystem.size
  21. fi
  22. # md5sums
  23. sudo rm -f md5sum.txt
  24. sudo find ${ISO} -type f -print0 \
  25. | sudo xargs -0 md5sum \
  26. | sed -e "s, ${ISO}, .," \
  27. | grep -v isolinux/boot.cat \
  28. | grep -v isolinux/isolinux.bin \
  29. | grep -v md5sum.txt \
  30. | sudo tee ${ISO}/md5sum.txt >/dev/null
  31. sudo chown -R ${NONPRIV_UID} ${ISO}
  32. # build CD
  33. xorriso -as mkisofs \
  34. -D -r -V "NilmDBuntu ${VERSION}" -cache-inodes -J -l \
  35. -input-charset utf-8 -o ${OUTPUT} \
  36. -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
  37. -boot-load-size 4 -boot-info-table \
  38. -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot \
  39. ${ISO}
  40. # fix iso for hybrid booting
  41. isohybrid ${OUTPUT}
  42. set +x
  43. echo "Burn it with:"
  44. echo " growisofs -dvd-compat -Z /dev/dvd=${OUTPUT}"
  45. echo "or write directly to a USB key"