Cara Membuat LiveCD Custom Ubuntu 12.04
Install squashfs-tools dan genisoimage
1 | sudo aptitude install squashfs-tools genisoimage |
Saya membuat livecd di partisi lain karena partisi / (root) tidak cukup. Partisi tersebut harus bertipe ext.
Membuat direktori livecdtmp
1 | mkdir /media/master/livecdtmp |
Membuat direktori mnt untuk mount iso ubuntu
1 | mkdir mnt |
Mount iso ubuntu
1 | sudo mount -o loop ubuntu-12.04-desktop-i386.iso mnt |
Ekstrak iso ubuntu ke folder extract-cd
1 2 3 4 5 6 7 8 9 10 11 12 | mkdir extract-cd rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd sudo unsquashfs mnt/casper/filesystem.squashfs sudo mv squashfs-root edit sudo cp /etc/resolv.conf edit/etc/ sudo cp /etc/hosts edit/etc/ sudo mount --bind /dev/ edit/dev sudo chroot edit mount -t proc none /proc mount -t sysfs none /sys mount -t devpts none /dev/pts |
Disini kita sudah bisa menginstall/menguninstall aplikasi
1 2 | apt-get install namapaket apt-get remove namapaket |
Setelah menginstall semua aplikasi, hapus cache apt
1 | aptitude clean atau apt-get clean |
1 2 3 4 5 6 | rm -rf /tmp/* ~/.bash_history rm /etc/hosts touch /etc/hosts rm /etc/resolv.conf touch /etc/resolv.conf rm /var/lib/dbus/machine-id |
1 2 3 4 5 | umount /proc || umount -lf /proc umount /sys umount /dev/pts exit sudo umount edit/dev |
1 2 3 4 5 | chmod +w extract-cd/casper/filesystem.manifest sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}n' > extract-cd/casper/filesystem.manifest sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop sudo sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop sudo sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop |
1 2 3 | sudo rm extract-cd/casper/filesystem.squashfs sudo mksquashfs edit extract-cd/casper/filesystem.squashfs -b 1048576 printf $(sudo du -sx --block-size=1 edit | cut -f1) > extract-cd/casper/filesystem.size |
Membuat file md5
1 2 3 | cd extract-cd sudo rm md5sum.txt find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt |
Tahap akhir membuat file iso, jangan lupa titik diakhir perintah
1 | sudo 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-12.04-desktop-i386-custom.iso . |
selamat mencoba 🙂
via help.ubuntu.com