Advertisement
thefinn93

OS Repacker

Aug 23rd, 2011
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.64 KB | None | 0 0
  1. #! /bin/bash
  2. IMAGE_NAME="AnonOS `date +%a%d%b%Y`"
  3. echo "Preparing to build AnonOS. This will probably require your sudo password. Make sure to not let it fuck with grub."
  4. sudo chroot edit/ apt-get update    # Update the software in the chroot
  5. sudo chroot edit/ apt-get upgrade -y    # Upgrade the software in the chroot
  6. sudo chroot edit/ aptitude clean    # Clean up temporary files from aptitude
  7. sudo chroot edit/ rm -rf /tmp/*     # Clean up other temporary files
  8. sudo chroot edit/ rm /etc/resolv.conf   # Remove the networking capibilities of the chroot
  9. sudo chroot edit/ umount /proc
  10. sudo chroot edit/ umount /sys
  11. sudo umount edit/dev
  12.  
  13. chmod +w extract-cd/casper/filesystem.manifest*
  14. sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
  15. sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
  16. sudo sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
  17.  
  18. sudo rm extract-cd/casper/filesystem.squashfs
  19. echo "Preparing to squash the filesystem. This will probably take FOREVER:"
  20. sudo mksquashfs edit extract-cd/casper/filesystem.squashfs
  21.  
  22. sudo nano extract-cd/README.diskdefines
  23.  
  24. rm -r extract-cd/dists extract-cd/pool
  25.  
  26. echo "Recalculating md5 checksums..."
  27. rm extract-cd/md5sum.txt
  28. (cd extract-cd && find . -not -name md5sum.txt -and -not -name boot.cat -and -not -name isolinux.bin -type f -print0 | xargs -0 md5sum > md5sum.txt)
  29.  
  30. echo "Making the ISO"
  31. cd extract-cd
  32. sudo mkisofs -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o "../AnonOS-`date +%a%d%b%Y`.iso" .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement