in FOSS

Cara Membuat LiveCD Custom Ubuntu 12.04

Install squashfs-tools dan genisoimage

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

mkdir /media/master/livecdtmp 

Membuat direktori mnt untuk mount iso ubuntu

mkdir mnt 

Mount iso ubuntu

sudo mount -o loop ubuntu-12.04-desktop-i386.iso mnt 

Ekstrak iso ubuntu ke folder extract-cd

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

apt-get install namapaket
apt-get remove namapaket 

Setelah menginstall semua aplikasi, hapus cache apt

aptitude clean atau apt-get clean
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
umount /proc || umount -lf /proc
umount /sys
umount /dev/pts
exit
sudo umount edit/dev
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
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

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

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

Write a Comment

Comment