From 0fc4610c88891d68be7e86b46120be25ee7fa2c0 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 28 Dec 2007 01:04:55 +0100 Subject: [PATCH] Really add remaster/grml-live-remaster --- debian/rules | 6 +-- remaster/grml-live-remaster | 90 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 3 deletions(-) create mode 100755 remaster/grml-live-remaster diff --git a/debian/rules b/debian/rules index 7895772..c595514 100755 --- a/debian/rules +++ b/debian/rules @@ -40,9 +40,9 @@ install: build cp -a scripts debian/grml-live/usr/share/grml-live/ cp -a patches debian/grml-live/usr/share/grml-live/ cp -a buildd/*.sh debian/grml-live/usr/share/grml-live/buildd/ - cp remaster/grml-live-remaster debian/grml-live/usr/sbin/grml-live-remaster - install -o root -m 640 buildd/grml-buildd.conf debian/grml-live/etc/grml/grml-buildd.conf - install -o root -m 755 grml-live debian/grml-live/usr/sbin/grml-live + install -o root -m 640 buildd/grml-buildd.conf debian/grml-live/etc/grml/grml-buildd.conf + install -o root -m 755 remaster/grml-live-remaster debian/grml-live/usr/sbin/grml-live-remaster + install -o root -m 755 grml-live debian/grml-live/usr/sbin/grml-live # Build architecture-independent files here. binary-indep: build install diff --git a/remaster/grml-live-remaster b/remaster/grml-live-remaster new file mode 100755 index 0000000..11739c8 --- /dev/null +++ b/remaster/grml-live-remaster @@ -0,0 +1,90 @@ +#!/bin/sh +# Filename: grml-live-remaster +# Purpose: remaster a grml from the live cd +# Authors: grml-team (grml.org), (c) Michael Schierl , (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2 or any later version. +# Latest change: Fri Dec 28 00:59:13 CET 2007 [mika] +################################################################################ +# DISCLAIMER: +# this script currently lacks lots of error checking code... any help welcome... +################################################################################ + +set -e # exit on any error + +VERSION='0.0.1' + +# source core functions {{{ +. /etc/grml/lsb-functions +. /etc/grml/script-functions +# }}} + +# make sure we have what we need {{{ +check4progs mkisofs mksquashfs || exit 1 +check4root || exit 1 +# }}} + +if [ x"$1" == x ]; then + echo "$0 - version $VERSION" + echo "" + echo "Usage: $0 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." + echo "" + echo "Please report bugs and feature requests: http://grml.org/bugs/" + exit -1 +fi + +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 -l -r -J -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." + +## END OF FILE ################################################################# +# vim: ai filetype=sh expandtab -- 2.1.4