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.
 
 
 

45 lines
1.2 KiB

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