Ubuntu Live cd bouwen

January 12th, 2010 Leave a comment Go to comments

In deze handleiding leg ik uit hoe je zelf een livecd kan aanpassen en bouwen.

Eerst stap is om de live cd te mounten:
mkdir /tmp/livecd
sudo mount -o loop xbmc-live-9.11-b1.iso /tmp/livecd

Volgende stap is om de inhoud te kopieren:
mkdir ./livecd
mkdir ./livecd/cd
rsync --exclude=/live/filesystem.squashfs -a /tmp/livecd/ ./livecd/cd

Voor het filesystem van de livecd maken we een aparte directory:
mkdir ./livecd/edit
cd ./livecd
cp /tmp/livecd/live/filesystem.squashfs .

Hierna pakken we het filesysteem uit:
sudo unsquashfs filesystem.squashfs

Openen we de omgeving:
sudo chroot squashfs-root/
umount /proc
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root
export LC_ALL=C

Pas nu desgewenst dingen aan. Met apt-get kan je nieuwe dingen toevoegen.

We gaan nu de omgeving opschonen en unmounten:
apt-get clean
rm -rf /tmp/* ~/.bash_history
umount /proc
umount /sys
umount /dev/pts
exit

Pak nu het filesysteem opnieuw in:
sudo mksquashfs squashfs-root/ filesystem.squashfs

Kopieer het filesysteem terug naar de nieuwe cd
cp filesystem.squashfs ./livecd/cd/live

Voor het booten is het van belang dat er een md5sum aanwezig is met alle hashes:
cd ./livecd/cd
rm md5sum.txt
find -type f -print0 | xargs -0 md5sum | grep -v isolinux/boot.cat | tee md5sum.txt

Pak nu de nieuwe iso in:
sudo pico ./livecd/cd/README.diskdefines
cd ./livecd/cd
sudo mkisofs -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -V "$IMAGE_NAME" -cache-inodes -r -J -l -o ../custom.iso .

Unmount nu de dvd en schoon alles op:
sudo umount /tmp/livecd
sudo rm -rf /tmp/livecd

  1. m3g4tr0n
    August 3rd, 2010 at 19:58 | #1

    does this tutorial work with Lucid Lynx?

    what are the contents of “README.diskdefines” or it’s empty file?

  1. December 27th, 2009 at 10:51 | #1