grml-live-remaster script (problem with mkisofs)

Hello,
I built a script that should enable you to remaster a grml from the live cd like this:
- mount some swap (if you don't have unlimited RAM *g*) - mount a disk where the ISO should end up on - If you use grml-small, install mksquashfs and mkisofs - grml-live-remaster /path/to/remastered-grml.iso * it will build a new aufs based on /remaster/tmp and /remaster/cdrom (which are mounted first) * then it drops you into the chroot so you can "remaster" * then it will open the last two lines of boot.msg in $EDITOR so you can edit the start screen message * then it will create a new squashfs and iso image, and cleans up after itself. * but it will leave the boot.msg and /remaster/tmp intact, so if you do not like the result (for example because it is too large for your CD-R) you can just run it again and continue where you left. - reboot to Windows/whatever and burn the CD - have fun
Unfortunately, the build CD does not boot and drops me into busybox. But I guess this is only a bug in the mkisofs line, since the filesystem layout looks fine for me. And it is quite time consuming to test it within grml-small and installing mksquashfs and mkisofs after every reboot.
mika: can you look if you find the bug? and if you found it, can you include it into next grml? It is very useful to be able to remaster grml on virtually any PC without having to repartition anything first.
mihi
#!/bin/sh
if [ x"$1" == x ]; then echo "usage: grml-live-remaster destination.iso" echo " destination.iso should point to a path that is on a hard disk," echo " you might want to mount some swap partitions or swap files" echo " first, because grml-live-remaster will need a lot ot RAM." exit -1 fi
set -e
if [ ! -d /remaster ]; then mkdir -p /remaster/chroot /remaster/tmp /remaster/cdrom mount -t tmpfs tmpfs /remaster/tmp echo "#:# edit the following two lines to change the boot message" \ >/remaster/msg echo "#:#" >>/remaster/msg sed 1,2d /live/image/boot/isolinux/boot.msg >>/remaster/msg fi
mount -t squashfs /live/image/live/grml.squashfs /remaster/cdrom -o ro,loop mount -t aufs aufs /remaster/chroot -o br:/remaster/tmp=rw:/remaster/cdrom=rr
for i in dev proc root sys tmp; do mount --bind /$i /remaster/chroot/$i done
echo "Now edit the contents of the live CD in this chrooted shell:" chroot /remaster/chroot
for i in dev proc root sys tmp; do umount /remaster/chroot/$i done
$EDITOR /remaster/msg
mkdir /remaster/iso for i in /live/image/*; do if [ ! $i == /live/image/live ]; then cp -R $i /remaster/iso fi done
rm /remaster/iso/boot/isolinux/boot.msg sed 3,4d /live/image/boot/isolinux/boot.msg \ >/remaster/iso/boot/isolinux/boot.msg sed 1,2d /remaster/msg >>/remaster/iso/boot/isolinux/boot.msg mkdir /remaster/iso/live mksquashfs /remaster/chroot /remaster/iso/live/grml.squashfs umount /remaster/chroot /remaster/cdrom mkisofs -b boot/isolinux/isolinux.bin -no-emul-boot -c boot/isolinux/boot.cat \ -boot-info-table -o "$1" /remaster/iso rm -R /remaster/iso
echo "" echo "ISO generation complete:" ls --color -l "$1" echo "If you want to customize your ISO, just call grml-live-remaster again."

* Michael Schierl schierlm@gmx.de [20071111 20:47]:
I built a script that should enable you to remaster a grml from the live cd like this:
[...]
What a cool idea!
Unfortunately, the build CD does not boot and drops me into busybox. But I guess this is only a bug in the mkisofs line, since the filesystem layout looks fine for me. And it is quite time consuming to test it within grml-small and installing mksquashfs and mkisofs after every reboot.
I'll check out whether we can provide mksquashfs, mkisofs and everything else what's needed for remastering in grml-medium (grml ships it of course, but grml-small should stay at a minimum).
mika: can you look if you find the bug? and if you found it, can you include it into next grml? It is very useful to be able to remaster grml on virtually any PC without having to repartition anything first.
Yeah, for sure. I'll check it out ASAP.
regards, -mika-

On Sun, 11 Nov 2007 23:44:33 +0100, Michael Prokop wrote:
layout looks fine for me. And it is quite time consuming to test it within grml-small and installing mksquashfs and mkisofs after every reboot.
I'll check out whether we can provide mksquashfs, mkisofs and everything else what's needed for remastering in grml-medium (grml ships it of course, but grml-small should stay at a minimum).
How about we use grml-medium as the base system for remastering?
I.e., grml-medium will be a live system that includes as many HW driver/support tools as possible. So if I am at a new box and want to know whether Linux supports *all* of its HW or not, grml-medium is the only disk that I need. That'll be a must-have disk for sys-admins because making sure all HW works is the first step for sys-admins.
How about the rest of sys-admin tools? One apt-get can install them all. The real question is how to save users from doing that installation again and again. My envision is that, in the future, grml provides a way to build a squashfs system out of the newly *installed/updated* files (from the writable portion of aufs), and a way to use the built squashfs module as an add-on to grml live system when booted.

[late reply, but I was working on this issue in the last days]
* T o n g mlist4suntong@yahoo.com [20071113 04:55]:
On Sun, 11 Nov 2007 23:44:33 +0100, Michael Prokop wrote:
layout looks fine for me. And it is quite time consuming to test it within grml-small and installing mksquashfs and mkisofs after every reboot.
I'll check out whether we can provide mksquashfs, mkisofs and everything else what's needed for remastering in grml-medium (grml ships it of course, but grml-small should stay at a minimum).
How about we use grml-medium as the base system for remastering?
[...]
Yes, this was my plan. :)
I just build a grml-medium ISO providing X.org and featuring LZMA compression within squashfs. Currently I'm at 163MB ISO size, I'll add some few more packages but I'm very confident that we can provide a grml-medium ISO shipping X.org as well. Oh and of course grml-live and FAI is part of the ISO too.
regards, -mika-

* Michael Schierl schierlm@gmx.de [20071111 20:47]:
I built a script that should enable you to remaster a grml from the live cd like this:
[...]
Unfortunately, the build CD does not boot and drops me into busybox. But I guess this is only a bug in the mkisofs line, since the filesystem layout looks fine for me. And it is quite time consuming to test it within grml-small and installing mksquashfs and mkisofs after every reboot.
mika: can you look if you find the bug? and if you found it, can you include it into next grml? It is very useful to be able to remaster grml on virtually any PC without having to repartition anything first.
Just tested it: the problem is that when using your script the filenames on the ISO are limited to 8 characters, resulting in a "/live/grml.squ"-file instead of "/live/grml.squashfs". :) So the fix is as easy as adding "-l -r -J" to the mkisofs cmdline.
Now we should just add some more error handling to the script (make the script re-executable when building fails, check for tools/RAM/...), then we could already ship it with the upcoming release. I really love the script! YMMD :)
regards, -mika-
Teilnehmer (3)
-
Michael Prokop
-
Michael Schierl
-
T o n g