metalx1000

Create Custom Linux Mint ISO Live CD

Dec 17th, 2017
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.61 KB | None | 0 0
  1. DISISO="$HOME/Downloads/linuxmint-18.3-xfce-64bit.iso"
  2. mkdir ~/livecdtmp
  3. cd ~/livecdtmp
  4. mkdir extract-cd mnt
  5. sudo mount -o loop "$DISISO" mnt
  6. sudo rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
  7. sudo unsquashfs mnt/casper/filesystem.squashfs
  8. sudo mv squashfs-root edit
  9. sudo cp /etc/resolv.conf edit/etc/
  10. sudo mount --bind /dev/ edit/dev
  11. sudo mount -t devpts devpts edit/dev/pts
  12. sudo mount -t proc proc edit/proc
  13. sudo mount -t sysfs sysfs edit/sys
  14. cd ~/livecdtmp/edit/etc/skel
  15. sudo mkdir Desktop Documents Downloads Music Pictures Public Templates Videos
  16. cd ~/livecdtmp/edit
  17. sudo chroot ~/livecdtmp/edit bash
  18.  
  19. #####Run These Commands in Chroot#####
  20. export HOME=/root && export LC_ALL=C
  21.  
  22. ###When Complete run these Commands###
  23. apt-get clean
  24. apt-get autoremove
  25. rm -rf /tmp/* ~/.bash_history
  26. exit
  27.  
  28. ###After Eixting Chroot###
  29. sudo umount ~/livecdtmp/edit/proc/sys/fs/binfmt_misc
  30. sudo umount ~/livecdtmp/edit/proc
  31. sudo umount ~/livecdtmp/edit/sys
  32. sudo umount ~/livecdtmp/dev/pts
  33. sudo umount ~/livecdtmp/edit/dev
  34. sudo umount ~/livecdtmp/mnt
  35.  
  36. echo "Creating ISO"
  37. sleep 3
  38.  
  39. sudo rm ~/livecdtmp/extract-cd/casper/filesystem.squashfs
  40. cd ~/livecdtmp
  41. sudo mksquashfs edit extract-cd/casper/filesystem.squashfs
  42. sudo vim extract-cd/README.diskdefines
  43. cd ~/livecdtmp/extract-cd
  44. sudo rm MD5SUMS
  45. find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee MD5SUMS
  46. cd ~/livecdtmp
  47. sudo genisoimage -l -r -J -V "REMASTER" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o ~/REMASTER.iso extract-cd
  48. cd ~
  49. sudo chmod 777 ~/REMASTER.iso
Add Comment
Please, Sign In to add comment