MaRTE OS live CD creation instructions ====================================== by Daniel Sangorrin daniel.sangorrin@{unican.es,gmail.com} ver 0.2 | 29-May-2008 This instructions are written mainly for those academic teachers who want to provide their students with a LiveCD that includes a MaRTE OS environment ready to be used. The instructions are provided with no WARRANTY but if you have problems you can ask in MaRTE OS forum. 1) LIVE CD BASED ON SLAX ------------------------- SLAX (http://www.slax.org/) is a distribution based on Slackware which has a very modular structure very easy to customize to create new Live CD distributions. Its main features are that its very small, it can boot from CD or from USB and it is easy to create new distributions from it. To create a distribution with SLAX, you just have to download the .tar version from http://www.slax.org/ and customize it by: - adding new files or replacing files (like wallpaper) in the folder 'slax/rootcopy' - creating new modules to include the GNAT GPL 2007 compiler or MaRTE OS sources. Creating a module is very simple and it just consists in compressing the directory with the contents of the module using 'dir2lzm'. 'dir2lzm' and other commands are obtained from Linux Live scripts (http://www.linux-live.org/) Example: $ mkdir -p $HOME/martemodule/usr/src $ cd $HOME/martemodule/usr/src $ tar zxvf $HOME/marte_1.8.tar.gz $ dir2lzm marte.lzm $HOME/martemodule $ mv marte.lzm $HOME/slax-live-cd/slax/modules - to install it on a USB copy the two directories 'boot/' and 'slax/' to a USB pen drive and execute the command 'boot/bootinst.sh' to write on the MBR of the USB to make it bootable. - to convert it into a CD, execute 'slax/make_iso.sh' and burn the resulting 'slax.iso' CD image file into a CD. 2) LIVE CD BASED ON KNOPPIX ---------------------------- KNOPPIX is a very popular Live CD that can also be customized. It is not so modular as SLAX but it may have other upsides. Working as root: # apt-get install cloop-utils # mkdir /tmp/knoppix-cd # mount -o loop -r $HOME/KNOPPIX_V5.1.1CD-2007-01-04-EN.iso /tmp/knoppix-cd # mkdir /tmp/knoppix-cloop # extract_compressed_fs /tmp/knoppix-cd/KNOPPIX/KNOPPIX > /var/tmp/KNOPPIX-cloop # mount -o loop /var/tmp/KNOPPIX-cloop /tmp/knoppix-cloop You can look (# find /tmp/knoppix-cloop -print), but you can't touch—the ISO9660 filesystem is read-only. To modify the distribution, you first need to copy both filesystem images to ordinary directories: # mkdir $HOME/my-knoppix-tree $HOME/my-knoppix-cd-tree # tar -C /tmp/knoppix-cloop -cf - . | tar -C $HOME/my-knoppix-tree -xvpf - # tar -C /tmp/knoppix-cd -cf - . | tar -C $HOME/my-knoppix-cd-tree -xvpf - # umount /tmp/knoppix-cd /tmp/knoppix-cloop # rm /var/tmp/KNOPPIX-cloop Now, you can hack away to your heart's content. The most convenient way to do this is to change root into the Knoppix inner tree using the chroot command: # mount -t proc none $HOME/my-knoppix-tree/proc # cp /etc/resolv.conf $HOME/my-knoppix-tree/etc/resolv.conf # chroot $HOME/my-knoppix-tree /bin/sh Once you are chrooted into the KNOPPIX future cd: 1) remove not needed packages # dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | grep -v deinstall | sort -n | awk '{print $1" "$2}' # apt-get remove --purge name-of-package-to-remove # deborphan | xargs apt-get -y remove 2) add new stuff # apt-get install build-essential (note: check that you have files /usr/lib/ctr*, if not copy them from the local Linux) - install AdaCore GNAT compiler and versions of MaRTE OS - create export/ dir with a QEMU (check that QEMU is installed) disk image (demo1 from MaRTE OS website tutorial) # apt-get install mtools - edit /etc/mtools.conf with drive c: file="/export/disk.img" partition=1 mtools_skip_check=1 - create the files you want to appear at /home/knoppix in /etc/skel with names 'marte_xxx' and then add 'marte*' in the script '/etc/X11/Xsession.d/45xsession' so they are copied at initialization time 3) final cleaning COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P # apt-get clean - check that the file and directory permissions is ok. If not change them with chmod, chown, chgrp Now, unmount the proc filesystem and exit chroot: # umount /proc # exit Now compress the KNOPPIX directory with all the files in ' $HOME/my-knoppix-tree' into a file named KNOPPIX in '/home/marte/my-knoppix-cd-tree/KNOPPIX/KNOPPIX' with: # mkisofs -R -J -l -V "KNOPPIX ISO9660" -v -allow-multidot $HOME/my-knoppix-tree | create_compressed_fs - 65536 > /home/marte/my-knoppix-cd-tree/KNOPPIX/KNOPPIX Finally, make the live CD: # cd $HOME/my-knoppix-cd-tree/ # mkisofs -pad -l -r -J -v -V "KNOPPIX" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o knoppix.iso $HOME/my-knoppix-cd-tree/