http://wiki.grml.org/doku.php?id=remastering
Table of Contents
Remaster with modified squashfs
To get access to grml's /, you first have to mount the grml_X.Y.iso somewhere. This ISO image is a iso9660 filesystem - any recent distribution kernel should include support for iso9660.
I put all my remastering stuff under '\~/grml-remaster', just to keep track of all the files. So create a mount point and mount the iso image:
$ mkdir -p ~/grml-remaster/mount1 # We will create another mountpoint, hence the '1' at the end $ sudo mount /path/to/grml-X.Y.iso ~/grml-remaster/mount1 -o loop
Now we have the CD image mounted at 'mount1/'. Inside the cd image there's e.g. the isolinux stuff, the index.html (which you get displayed when you put grml into a windows pc) and a file called 'GRML' in the directory 'GRML'. This file contains grml's root file system and is a squashfs filesystem.
The rest of this procedure depends on whether you intend to change the contents of the sqashfs filesystem or not. Since grml is very flexible, there are chances that you do not need to modify the squashfs.
You can start exploring the grml CD's / in '\~/grml-remaster/mount1' right now. Beware that the file system is mounted read-only, as iso9660 is a read-only filesystem (anything else wouldn't make sense on the CD, either :-)).
To make changes, we have to copy the mounted CD. I created '\~/grml-remaster/copy-mount1' for this and copied 'mount1/' there:
$ mkdir ~/grml-remaster/copy-mount1 $ cp -av ~/grml-remaster/mount1/* ~/grml-remaster/copy-mount1
This takes some time. After cp is finished you have a read-/writeable copy of the grml CD's '/' in '\~/grml-remaster/copy-mount1'. You may umount '\~/grml-remaster/mount1' now, if you wish.
After making your changes, create a new .iso:
$ cd copy-mount1 $ mkisofs -V "locally modified grml" -publisher 'Your Name <your.address@example>' -l -r -J \ -no-emul-boot -boot-load-size 4 -boot-info-table -c boot/isolinux/boot.cat -b \ boot/isolinux/isolinux.bin -o ../my-local-grml.iso .
You can treat \~/grml-remaster/copy-mount2 like a root filesystems of an installed linux (in fact, it isn't something else).
You can just copy files there or chroot into it, to run apt-get or so.
$ sudo chroot ~/grml-remaster/copy-mount2 /usr/bin/zsh root@foo ~ # (do whatever you like to do with grml) root@foo ~ # exit $
consult any knoppix remastering howto (like the one on knoppix.net).
To create a new squashfs image, mksquashfs is needed. If you are on a Debian system, just apt-get install squashfs-tools. Ran it with the source directory and the destination file as arguments:
# do this as root, else mksquashfs can't read all files: $ sudo mksquashfs ~/grml-remaster/copy-mount2 ~/grml-remaster/new-GRML
to put the new-GRML into an iso9660 image and others, check back the original wiki.
documented on: 2006.11.26