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.

extractiso.sh 785 B

8 years ago
8 years ago
8 years ago
1234567891011121314151617181920212223242526272829303132333435363738
  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. mkdir -p $(dirname ${ORIG})
  16. wget -O "${ORIG}" "${ORIGURL}"
  17. fi
  18. # mount it
  19. sudo umount ${MNT} || true
  20. sudo rm -rf ${MNT} ${ISO} ${FS}
  21. sudo mkdir ${MNT}
  22. sudo mount -o loop,ro "$ORIG" ${MNT}
  23. # copy data
  24. sudo mkdir ${ISO}
  25. sudo rsync --exclude=/casper/filesystem.squashfs -a ${MNT}/ ${ISO}
  26. sudo chown -R ${NONPRIV_UID} ${ISO}
  27. chmod -R u+w ${ISO}
  28. # copy squashfs
  29. sudo unsquashfs -d ${FS} ${MNT}/casper/filesystem.squashfs
  30. sudo umount ${MNT}