Create a Dyne:III iso image

by Asbesto, JUL 2010


Fetch your favorite iso, in the following examples we will take puredyne-911-carrot_and_coriander iso to show that this procedures can apply to a lot of different isos/systems.

The basic procedure is simple:


You need the squashfs-tools.

apt-get install squashfs-tools


# we choose pd/ as our working directory, so...

mkdir pd
cd pd

sudo mount puredyne.iso /mnt -o loop
mkdir extract-cd
rsync --exclude=/live/filesystem.squashfs -a /mnt/ extract-cd
# for d:b: rsync --exclude=/dyne/dyne.sys -a /mnt extract-cd/

sudo unsquashfs /mnt/live/filesystem.squashfs
# for d:b: sudo unsquashfs /mnt/dyne/dyne.sys 

sudo mv squashfs-root edit

# use resolv.conf and hosts from your system, or edit them by hand...
sudo cp /etc/resolv.conf edit/etc/
sudo cp /etc/hosts edit/etc/

# if you are into your pd/ directory with the system extracted as above, 
# just cut'n paste from here to start working on the system.

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

# To avoid locale problems during installation of new packages, you need to export 2 system variables:

export HOME=/root
export LC_ALL=C

# You also need to do this as root (that's for some reasons connected with a couple of dbus bugs).
# If you are re-chrooting to a system you're working on, don't mind about warnings or errors.

dbus-uuidgen > /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl


That's all folks! ;)


When you want to remove packages remember to use purge I investigated a bit the matter, not enough to know whats going on but enough to know is a good practice.

Once in the chroot start poking:

# refresh your list
apt-get update

# some must have
apt-get install htop modconf

# some multimedia 
apt-get install cinelerra sox twolame mpeg2dec a52dec libsox-fmt-all a52dec darkice darksnow

rsync to carry the pack for working out of home

rsync --exclude=/edit/dev --exclude=/edit/proc --exclude=/edit/sys  -auvz /home/youruser/wherever/src/pd/ /media/usbdisk/pd/

In this way you rsync your pd/ working directory on a same pd/ dir on your usb key, so you can work everywhere on your eeepc. ;)


cd /
aptitude clean
rm -rf /tmp/* ~/.bash_history
rm /etc/resolv.conf
rm /var/lib/dbus/machine-id
rm /sbin/initctl
dpkg-divert --rename --remove /sbin/initctl
dpkg -l > packages.txt
umount /proc
umount /sys
umount /dev/pts
sudo umount edit/dev
sudo mv edit/packages.txt extract-cd/live/

Creating the ISO

Regenerate the manifest

Into the pd dir:

# creiamo il file
sudo touch extract-cd/live/filesystem.manifest
sudo chmod a+w extract-cd/live/filesystem.manifest
sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/live/filesystem.manifest
sudo cp extract-cd/live/filesystem.manifest extract-cd/live/filesystem.manifest-desktop
sudo sed -i '/ubiquity/d' extract-cd/live/filesystem.manifest-desktop
sudo sed -i '/live/d' extract-cd/live/filesystem.manifest-desktop


Compress the filesystem

# cancelliamo il vecchio squashfs eventualmente in mezzo alle palle
sudo rm extract-cd/live/filesystem.squashfs

# creiamo il nuovo squashfs. La pagina Debian live parla di una opzione -nolzma da mettere
# alla fine, che pero' NON ESISTE:
# Note: The -nolzma option is only available from Hardy , and was removed in Karmic. 
# Also, the squashfs has to be generated using a version of mksquashfs that is compatible 
# with the kernel used on the CD you are customizing. For example, you cannot generate 
# a jaunty squashfs on karmic, as the jaunty kernel is not able to mount a squashfs 
# prepared using mksquashfs from karmic.  O_o

sudo mksquashfs edit extract-cd/live/filesystem.squashfs


Set an image name in extract-cd/README.diskdefines

maybe is unuseful?

sudo joe extract-cd/README.diskdefines

(you can use "sudo vim extract-cd/README.diskdefines" if you have difficulties understanding joe. AHHAHAHAH)


Remove old md5sum.txt and calculate new md5 sums

cd extract-cd
sudo rm md5sum.txt
find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/ | sudo tee md5sum.txt


From inside the extract-cd directory:

sudo mkisofs -D -r -V "dyneIIIa1" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/ -no-emul-boot -boot-load-size 4 -boot-info-table -o ../dyneIIIa1.iso .


Tasks to do

<fruity> "aggiungere voce in syslinux menu per modo persistente"
<fruity> basta aprire syslinux.cfg o isolinux.cfg
<fruity> fare copia incolla della voce che hanno li gia
<fruity> editare il titolo e metterci "Persisten mode"
<fruity> e addare persistent a APPEND
<fruity> sai dove metti le opzioni del kernel
<fruity> tipo root= splash quiet
<fruity> va alla fine di quelle robe li

0 packages upgraded, 13 newly installed, 0 to remove and 35 not upgraded.
Need to get 67.7MB/68.0MB of archives. After unpacking 234MB will be used.


Primo test: OK! boota perfettamente, ci sono alcune ricorrenze di "puredyne" da sistemare e customizzare.

Elenco di cose da levare di mezzo:

Roba da mettere:


Autologin account

Tutte le occorrenze di lintian diventano luther. In particolare i files dentro pd/extract-cd/extra, pd/edit/etc/gdm/custom.conf ed alcuni file dentro pd/extract-cd/isolinux. In questi file c'e' anche il nome assegnato al computer, che ho deciso essere "mir".


Dentro edit/usr/share/initramfs-tools/scripts/live-bottom/15autologin c'e' questa cagata qua

# chroot needed to handle symlinks correctly
if chroot /root [ -f ${GDMCONF} ]
        # true hack ! -- nohar
        chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf

true hack STA MINCHIA, dato che non esiste alcun /usr/share/gdm/defaults.conf da copiare!!!


root@gemini:/home/asbesto/Desktop/src/pd/edit# cp etc/gdm/custom.conf usr/share/gdm/defaults.conf

asbesto@gemini:/home/asbesto/Desktop/src/pd/edit/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml$ ls
accessibility.xml  xfce4-desktop.xml             xfce4-power-manager.xml  xfce4-settings-manager.xml  xsettings.xml
keyboards.xml        xfce4-keyboard-shortcuts.xml  xfce4-session.xml      xfwm4.xml

Sfondi desktop, icone, grafica

I backgrounds della pd stanno dentro /usr/share/xfce4/backdrops.

Per una questione di hierarchy sposterei gli sfondi che non sono default di xfce4 su una dir tipo /usr/local/share/xfce4/backgrounds sistemando opportunamente i file di config. Vedremo...




Ubuntu Live CD Customization