2 # Filename: grml-live-remaster
3 # Purpose: remaster a grml from the live cd
4 # Authors: grml-team (grml.org), (c) Michael Schierl <schierlm@gmx.de>, (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 # Latest change: Fri Dec 28 00:59:13 CET 2007 [mika]
8 ################################################################################
10 # this script currently lacks lots of error checking code... any help welcome...
11 ################################################################################
13 set -e # exit on any error
17 # source core functions {{{
18 . /etc/grml/lsb-functions
19 . /etc/grml/script-functions
22 # make sure we have what we need {{{
23 check4progs mkisofs mksquashfs || exit 1
27 if [ x"$1" == x ]; then
28 echo "$0 - version $VERSION"
30 echo "Usage: $0 destination.iso"
31 echo " destination.iso should point to a path that is on a hard disk,"
32 echo " you might want to mount some swap partitions or swap files"
33 echo " first, because grml-live-remaster will need a lot ot RAM."
35 echo "Please report bugs and feature requests: http://grml.org/bugs/"
39 if [ ! -d /remaster ]; then
40 mkdir -p /remaster/chroot /remaster/tmp /remaster/cdrom
41 mount -t tmpfs tmpfs /remaster/tmp
42 echo "#:# edit the following two lines to change the boot message" \
44 echo "#:#" >>/remaster/msg
45 sed 1,2d /live/image/boot/isolinux/boot.msg >>/remaster/msg
48 mount -t squashfs /live/image/live/grml.squashfs /remaster/cdrom -o ro,loop
49 mount -t aufs aufs /remaster/chroot -o br:/remaster/tmp=rw:/remaster/cdrom=rr
51 for i in dev proc root sys tmp; do
52 mount --bind /$i /remaster/chroot/$i
55 echo "Now edit the contents of the live CD in this chrooted shell:"
56 chroot /remaster/chroot
58 for i in dev proc root sys tmp; do
59 umount /remaster/chroot/$i
65 for i in /live/image/*; do
66 if [ ! $i == /live/image/live ]; then
67 cp -R $i /remaster/iso
71 rm /remaster/iso/boot/isolinux/boot.msg
72 sed 3,4d /live/image/boot/isolinux/boot.msg \
73 >/remaster/iso/boot/isolinux/boot.msg
74 sed 1,2d /remaster/msg >>/remaster/iso/boot/isolinux/boot.msg
76 mkdir /remaster/iso/live
77 mksquashfs /remaster/chroot /remaster/iso/live/grml.squashfs
78 umount /remaster/chroot /remaster/cdrom
80 mkisofs -b boot/isolinux/isolinux.bin -no-emul-boot -c boot/isolinux/boot.cat \
81 -boot-info-table -l -r -J -o "$1" /remaster/iso
85 echo "ISO generation complete:"
87 echo "If you want to customize your ISO, just call grml-live-remaster again."
89 ## END OF FILE #################################################################
90 # vim: ai filetype=sh expandtab