Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mkdir ~/livecdtmp
- mv ubuntu-14.04-desktop-amd64.iso ~/livecdtmp
- cd ~/livecdtmp
- mkdir mnt
- mkdir extract-cd
- sudo su
- mount -o loop ubuntu-10.04-desktop-amd64.iso mnt
- rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
- unsquashfs mnt/casper/filesystem.squashfs
- mv squashfs-root edit
- cp /etc/resolv.conf edit/etc/
- cp /etc/hosts edit/etc/
- sudo su
- mount --bind /dev/ edit/dev
- chroot edit
- mount -t proc none /proc
- mount -t sysfs none /sys
- mount -t devpts none /dev/pts
- export HOME=/root
- export LC_ALL=C
- dbus-uuidgen > /var/lib/dbus/machine-id
- dpkg-divert --local --rename --add /sbin/initctl
- ln -s /bin/true /sbin/initctl
- sudo su
- apt-get install package
- apt-get remove --purge package
- apt-get clean
- apt-get autoremove
- rm /etc/hosts
- rm /var/lib/dbus/machine-id
- rm /sbin/initctl
- dpkg-divert --rename --remove /sbin/initctl
- sudo su
- umount /proc || umount -lf /proc
- umount /sys
- umount /dev/pts
- exit
- sudo su
- chmod +w extract-cd/casper/filesystem.manifest
- chroot edit dpkg-query -W --showformat='${Package} ${Version}n' > extract-cd/casper/filesystem.manifest
- cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
- sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
- sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop
- umount edit/dev
- rm extract-cd/casper/filesystem.squashfs
- mksquashfs edit extract-cd/casper/filesystem.squashfs -comp xz -e edit/boot
- printf $(sudo du -sx --block-size=1 edit | cut -f1) > extract-cd/casper/filesystem.size
- nano extract-cd/README.diskdefines
- cd extract-cd
- rm md5sum.txt
- find -type f -print0 | xargs -0 md5sum | grep -v isolinux/boot.cat | tee md5sum.txt
- 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