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.
 
 
 

38 lines
746 B

  1. #!/bin/bash
  2. # build the iso
  3. . config || exit 0
  4. if [ "$1" != "ok" ]; then
  5. if [ -e ${ISO} ] || [ -e ${FS} ]; then
  6. echo "remove \"${ISO}\" and \"${FS}\" dirs first,"
  7. echo "or pass \"ok\" as an argument to remove them"
  8. exit 0
  9. fi
  10. fi
  11. set -x
  12. set -e
  13. # download it if it doesn't exist
  14. if ! [ -e ${ORIG} ] ; then
  15. wget -O "${ORIG}" "${ORIGURL}"
  16. fi
  17. # mount it
  18. sudo umount ${MNT} || true
  19. sudo rm -rf ${MNT} ${ISO} ${FS}
  20. sudo mkdir ${MNT}
  21. sudo mount -o loop,ro "$ORIG" ${MNT}
  22. # copy data
  23. sudo mkdir ${ISO}
  24. sudo rsync --exclude=/casper/filesystem.squashfs -a ${MNT}/ ${ISO}
  25. sudo chown -R ${USER} ${ISO}
  26. chmod -R u+w ${ISO}
  27. # copy squashfs
  28. sudo unsquashfs -d ${FS} ${MNT}/casper/filesystem.squashfs
  29. sudo umount ${MNT}