metalx1000

Custom GRML ISO - Remaster

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