Advertisement
Guest User

Untitled

a guest
Sep 5th, 2014
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. mkdir ~/livecdtmp
  2. mv ubuntu-14.04-desktop-amd64.iso ~/livecdtmp
  3. cd ~/livecdtmp
  4.  
  5. mkdir mnt
  6. mkdir extract-cd
  7. sudo su
  8. mount -o loop ubuntu-10.04-desktop-amd64.iso mnt
  9. rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
  10. unsquashfs mnt/casper/filesystem.squashfs
  11. mv squashfs-root edit
  12. cp /etc/resolv.conf edit/etc/
  13. cp /etc/hosts edit/etc/
  14.  
  15. sudo su
  16. mount --bind /dev/ edit/dev
  17. chroot edit
  18. mount -t proc none /proc
  19. mount -t sysfs none /sys
  20. mount -t devpts none /dev/pts
  21. export HOME=/root
  22. export LC_ALL=C
  23. dbus-uuidgen > /var/lib/dbus/machine-id
  24. dpkg-divert --local --rename --add /sbin/initctl
  25. ln -s /bin/true /sbin/initctl
  26.  
  27. sudo su
  28. apt-get install package
  29. apt-get remove --purge package
  30. apt-get clean
  31. apt-get autoremove
  32. rm /etc/hosts
  33. rm /var/lib/dbus/machine-id
  34. rm /sbin/initctl
  35. dpkg-divert --rename --remove /sbin/initctl
  36.  
  37. sudo su
  38. umount /proc || umount -lf /proc
  39. umount /sys
  40. umount /dev/pts
  41. exit
  42.  
  43. sudo su
  44. chmod +w extract-cd/casper/filesystem.manifest
  45. chroot edit dpkg-query -W --showformat='${Package} ${Version}n' > extract-cd/casper/filesystem.manifest
  46. cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
  47. sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
  48. sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop
  49. umount edit/dev
  50. rm extract-cd/casper/filesystem.squashfs
  51. mksquashfs edit extract-cd/casper/filesystem.squashfs -comp xz -e edit/boot
  52. printf $(sudo du -sx --block-size=1 edit | cut -f1) > extract-cd/casper/filesystem.size
  53. nano extract-cd/README.diskdefines
  54. cd extract-cd
  55. rm md5sum.txt
  56. find -type f -print0 | xargs -0 md5sum | grep -v isolinux/boot.cat | tee md5sum.txt
  57. mkisofs -D -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 ../ubuntu-14.04-desktop-amad64-custom.iso
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement