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."

_______________________________________________
Grml mailing list - [email protected]
http://lists.mur.at/mailman/listinfo/grml
join #grml on irc.freenode.org
grml-devel-blog: http://grml.supersized.org/

Reply via email to