linux/cdrom/Makefile \
linux/cdrom/bacula/Makefile \
linux/cdrom/cdtree/boot/isolinux/boot.msg \
+ knoppix/cdrom/Makefile \
+ knoppix/cdrom/bacula/Makefile \
freebsd/Makefile \
solaris/Makefile \
$PFILES ],
- ac_config_files="$ac_config_files autoconf/Make.common Makefile linux/Makefile linux/cdrom/Makefile linux/cdrom/bacula/Makefile linux/cdrom/cdtree/boot/isolinux/boot.msg freebsd/Makefile solaris/Makefile $PFILES"
+ ac_config_files="$ac_config_files autoconf/Make.common Makefile linux/Makefile linux/cdrom/Makefile linux/cdrom/bacula/Makefile linux/cdrom/cdtree/boot/isolinux/boot.msg knoppix/cdrom/Makefile knoppix/cdrom/bacula/Makefile freebsd/Makefile solaris/Makefile $PFILES"
ac_config_commands="$ac_config_commands default"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
"linux/cdrom/Makefile" ) CONFIG_FILES="$CONFIG_FILES linux/cdrom/Makefile" ;;
"linux/cdrom/bacula/Makefile" ) CONFIG_FILES="$CONFIG_FILES linux/cdrom/bacula/Makefile" ;;
"linux/cdrom/cdtree/boot/isolinux/boot.msg" ) CONFIG_FILES="$CONFIG_FILES linux/cdrom/cdtree/boot/isolinux/boot.msg" ;;
+ "knoppix/cdrom/Makefile" ) CONFIG_FILES="$CONFIG_FILES knoppix/cdrom/Makefile" ;;
+ "knoppix/cdrom/bacula/Makefile" ) CONFIG_FILES="$CONFIG_FILES knoppix/cdrom/bacula/Makefile" ;;
"freebsd/Makefile" ) CONFIG_FILES="$CONFIG_FILES freebsd/Makefile" ;;
"solaris/Makefile" ) CONFIG_FILES="$CONFIG_FILES solaris/Makefile" ;;
"$PFILES" ) CONFIG_FILES="$CONFIG_FILES $PFILES" ;;
--- /dev/null
+#
+# Makefile for building a Bacula Rescue CDROM or remastering
+# a CDROM or ISO image adding the Bacula files.
+#
+
+.PATH: .
+
+
+first_rule: all
+dummy:
+
+#-------------------------------------------------------------------------
+
+# Make an iso boot image
+iso:
+ ./build-iso
+
+cdimage:
+ makecdimage --type=@type@ --where=@where@
+
+# try booting it with qemu emulator
+boot:
+ qemu -cdrom bacula-knoppix.iso
+
+initrd:
+ ./makeinitrd
+
+kernel:
+ ./makekernel @KERNEL@
+
+binaries:
+ ./makebinaries
+
+static-bacula: dummy
+ @(cd bacula; make copy-static-fd)
+
+bacula: dummy
+ @(cd bacula; make)
+
+copy-bacula:
+ cp -a bacula/ cdimage/
+
+knoppix: environment fillknoppix iso
+
+environment:
+ ./makeenv
+
+fillknoppix:
+ ./copy-to-knoppix
+
+#all: kernel binaries bacula initrd iso
+all: bacula
+
+copy-static-fd: kernel binaries static-bacula initrd iso
+
+
+# This needs to be customized for your burner.
+burn:
+ cdrecord dev=ATA:@CDSTL@ gracetime=2 fs=4096k driveropts=burnfree -v \
+ -useinfo speed=48 -dao -eject -pad -data "bacula-knoppix.iso"
+
+# Blank the CDROM assuming it is +rw
+blank:
+ cdrecord dev=ATA:@CDSTL@ gracetime=2 -v blank=fast -useinfo speed=48
+
+scan:
+ cdrecord -scanbus
+
+distclean:
+clean:
+#
+# Clean out files that are rebuilt
+#
+ @rm -f bacula-knoppix.iso
+ @rm -rf roottree/bacula-*
+ @(cd bacula; make distclean)
+ @echo
+ @echo " Please delete manually the REMASTER_PATH"
+ @echo
--- /dev/null
+This folder knoppix/cdrom was created by Mikael Kermorgant <mikael.kermorgant@gmail.com> on Thu, 30 Mar 2006
+
+It contains scripts aimed at creating a bootable rescue cd based on knoppix (see http://www.knoppix.org).
+The first aim I had when building this cd was to make rescue cds for the debian servers I backup with bacula, which I failed to do with the original rescue cd.
+
+Requirements:
+ - A Linux system (tested on Debian 3.1 and Mandrake 10.0)
+ - 1,5 Go space on hard drive
+ - It should boot on any hardware that Knoppix can boot on
+ - cloop-utils version > 2.0 (only on the machine you build the iso)
+
+
+A - To build an ISO image for burning a CD, do the following :
+
+ cd <bacula-source>
+ ./configure (your-options)
+ make
+
+ download knoppix's modified source archive
+ cd bacula-rescue-<version>
+ ./configure --with-bacula=<path-to-bacula-source>
+ cd knoppix/cdrom
+ vi config
+ make bacula
+ make knoppix
+
+ to cleanup, do:
+
+ make clean
+
+ you'll have to manually remove the knoppix source file and the directory where the source has been extracted.
+
+B - Build an iso image for multiple clients
+
+ This requires you have already built one rescue cd (see step A).
+ You'll have to follow nearly the same steps :
+
+ cd <bacula-source>
+ ./configure (your-options)
+ make
+
+ cd bacula-rescue-<version>
+ ./configure --with-bacula=<path-to-bacula-source>
+ cd knoppix/cdrom
+ make bacula
+ tar -cvzf bacula-<hostname>.tar.gz roottree/bacula-<hostname>
+
+ Copy bacula-<hostname>.tar.gz on the machine you built the iso and extract it in bacula-rescue-<version>/knoppix/cdrom/roottree and execute :
+
+ make knoppix
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+if [ ! -f `which create_compressed_fs` ]; then
+ echo "You will need the create_compressed_fs script"
+ echo "Please check your install (cloop)"
+ exit
+else
+ CCFS=`which create_compressed_fs`
+fi
+
+rm -f bacula-knoppix.iso
+. config
+
+
+mkisofs -R -U -V "KNOPPIX.net fs" -publisher "BACULA www.bacula.org" \
+ -hide-rr-moved -cache-inodes -no-bak -pad $REMASTER_PATH/source/KNOPPIX \
+ | nice -5 $CCFS - 65536 > $REMASTER_PATH/master/KNOPPIX/KNOPPIX
+
+
+mkisofs -pad -l -r -J -v -V "KNOPPIX" -no-emul-boot -boot-load-size 4 \
+ -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
+ -hide-rr-moved -o bacula-knoppix.iso $REMASTER_PATH/master
--- /dev/null
+# settings for the remastering process
+# you will need 1Gb swap and 2Gb space
+
+REMASTER_PATH=/baie/knx
+KNOPPIX_SOURCE=/tmp/knoppix.source3.tar.bz2
+ISO_DESTPATH=/baie/knx
--- /dev/null
+#!/bin/sh
+
+. ./config
+
+for d in `find ./roottree -type d -mindepth 1 -maxdepth 1`
+do
+ cp -a $d $REMASTER_PATH/source/KNOPPIX/var/bacula/
+done
--- /dev/null
+#!/bin/sh
+
+# this script finds all binaries and updates them with the ones
+# from your system, in order to maintain them more easily.
+# Be careful. If you have specially made binaries (perhaps lean ones),
+# they will be overwritten.
+
+TOPDIR=`pwd`
+R=roottree
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:$PATH"
+
+
+# Cleanup and make necessary directories
+rm -rf $R/sbin
+mkdir -p $R/etc $R/initrd $R/lib $R/mnt $R/mnt/cdrom
+mkdir -p $R/proc $R/root $R/sbin $R/tmp $R/var
+mkdir -p $R/dev $R/sys $R/initrd $R/sysroot
+mkdir -p $R/etc/terminfo $R/etc/terminfo/l
+mkdir -p $R/var/lib $R/var/log $R/var/run $R/var/state
+mkdir -p $R/var/lib/nfs
+mkdir -p $R/var/log/news
+touch $R/var/log/news/news.crit $R/var/log/news/news.err $R/var/log/news.notice
+
+cd $R
+ln -sf sbin bin
+cd $TOPDIR
+
+#
+# Some users have a different shell for root, so be
+# sure to add it to the rootsbin list. Note, the shell may
+# be copied twice, but it is not worth the effort to run uniq
+# here.
+#
+TMPFILE=`mktemp -t bin.XXXXXXXXXX`
+if [ $? != 0 ]; then
+ echo "Could not make temp file"
+ exit 1
+fi
+cat rootsbin.list >${TMPFILE}
+command=`grep ^root: /etc/passwd | cut -d ':' -f 7`
+command=`basename $command`
+if [ x$command != "xbash" ] ; then
+ echo "roottree/sbin/$command" >>${TMPFILE}
+fi
+
+echo "Building root /sbin. Some Could not find messages are normal ..."
+for file in `cat ${TMPFILE}` ; do
+ command=`basename $file`
+ fullfile=`which $command 2> /dev/null`
+ if [ x$fullfile != x ] ; then
+# echo "updating $command in roottree with $fullfile"
+ cp -fpd $fullfile $file
+ if [ $? != 0 ] ; then
+ echo "Update failed."
+ exit 1
+ fi
+ strip $file 2>/dev/null
+ else
+ echo "==== Could not find $command on your system ===="
+ rm -f $file
+ fi
+done
+rm -f ${TMPFILE}
+
+cd roottree/sbin
+ln -sf halt reboot
+# Eliminate recursive link
+rm -f sbin
+cd $TOPDIR
+
+# Copy all needed shared libraries
+echo "Building root shared libaries ..."
+rm -f `find roottree/lib/ -maxdepth 1 -type f 2>/dev/null`
+#
+# Statically linked binaries create an error
+# message from ldd, so we ignore those
+#
+for lib in `find roottree/sbin/ -type f -exec ldd {} \; | awk '{print $3}' | sort | uniq` ; do
+ if [ -e $lib ] ; then
+ cp -fp $lib roottree/lib/
+ if [ $? != 0 ] ; then
+ echo "Update failed."
+ exit 1
+ fi
+ fi
+done
+#
+# Wouldn't you know, there is one so that is critical to have or
+# nothing will load on 2.6 kernels.
+#
+cp -fp /lib/ld-linux.so.* roottree/lib/
+strip `find roottree/lib/ -maxdepth 1 -type f` 2>/dev/null
+
+# Grub crap
+mkdir -p roottree/usr/share/grub
+cp -fpr /usr/share/grub/* roottree/usr/share/grub
+
+#
+# Get a bunch of stuff from /etc
+#
+echo "Building /etc ..."
+cp -p /etc/services roottree/etc/
+if [ $? != 0 ] ; then
+ echo "Update failed."
+ exit 1
+fi
+
+for file in `cat rootetc.list` ; do
+ if [ -e $file ] ; then
+ cp -fp $file roottree/etc/
+ else
+ echo "==== Could not find $file in /etc ===="
+ fi
+done
+if [ -e /etc/modules.conf ] ; then
+ cp -fp /etc/modules.conf roottree/etc/
+fi
+if [ -e /etc/modprobe.conf ] ; then
+ cp -fp /etc/modprobe.conf roottree/etc/
+fi
+rm -rf roottree/etc/pam.d
+if [ -e /etc/pam.d ] ; then
+ cp -a /etc/pam.d roottree/etc/
+ if [ -e /etc/pam.conf ] ; then
+ cp -fp /etc/pam.conf roottree/etc/
+ fi
+fi
+
+if [ -e /etc/init.d ] ; then
+ rm -rf roottree/etc/init.d
+ cp -aL /etc/init.d roottree/etc/
+fi
+
+if [ -e /etc/udev ] ; then
+ rm -rf roottree/etc/udev
+ cp -aL /etc/udev roottree/etc/
+fi
+
+
+if [ -e /etc/ssh ] ; then
+ cp -a /etc/ssh roottree/etc/
+ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+ echo "!!!! !!!!"
+ echo "!!!! Warning your /etc/ssh directory was copied. !!!!"
+ echo "!!!! Keep this directory and the CDROM secure. !!!!"
+ echo "!!!! !!!!"
+ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+fi
+if [ -e /etc/security ] ; then
+ cp -a /etc/security roottree/etc/
+fi
+
+#
+# Pull a few files needed by PAM
+#
+if [ -f /lib/libnss_files.so.1 ] ; then
+ cp -fp /lib/libnss_files.so.1 roottree/lib/
+fi
+cp -fp /lib/libnss_files.so.* roottree/lib/
+cp -a /lib/security roottree/lib/
--- /dev/null
+#! /bin/sh
+
+# This script makes a copy of an existing boot cd or iso on
+# disk so that we can add the Bacula code to it for remastering
+#
+# When we are done if there is no error, we should have the
+# cdrom image in cdimage
+#
+
+export LANG=C
+
+# Print Usage message
+usage () {
+ cat <<END_OF_DATA
+Usage: make_rescue_disk
+ -h, --help print this message
+ --type=cdrom|iso start with a cdrom or iso image
+ --where=path the path to the device (mounted) or the iso
+END_OF_DATA
+}
+
+if [ ! `whoami` = "root" ] ; then
+ echo ""
+ echo "You need to be root to run this, otherwise"
+ echo "I cannot mount the loopback. Continuing anyway ..."
+ echo ""
+fi
+
+
+#
+# Process command line options
+#
+for option in "$@" ; do
+ case "$option" in
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ --type=cdrom)
+ type=cdrom
+ ;;
+ --type=iso)
+ type=iso
+ ;;
+ --where*)
+ where=`echo "$option"|cut -c 9-`
+ ;;
+ *)
+ echo "Unknown option specified: $option"
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+if [ x$type == x ] ; then
+ echo " "
+ echo "You can make the rescue disk either from a mounted CDROM or"
+ echo "from a .iso image. Please enter cdrom or iso:"
+ read type
+ if [ $type == 'cdrom' ] ; then
+ echo "OK want mounted CDROM"
+ elif [ $type == 'iso' ] ; then
+ echo "OK want iso image"
+ else
+ echo "Type missing"
+ exit 1
+ fi
+fi
+if [ x$where == x ] ; then
+ echo " "
+ echo "Enter location of image e.g. /mnt/cdrom or /home/src/.../rescue.iso"
+ read where
+fi
+if [ ! -e $where ]; then
+ echo "Cannot find rescue image $where"
+ exit 1
+fi
+if [ $type == iso ]; then
+ rm -rf mnt
+ mkdir mnt
+ mount -o loop $where mnt
+ if [ $? != 0 ] ; then
+ echo "Mount failed."
+ rm -rf mnt
+ exit 1;
+ fi
+ rm -rf cdimage
+ mkdir cdimage
+ cp -a mnt/* cdimage/
+ if [ $? != 0 ] ; then
+ echo "Copy from iso to cdimage failed"
+ unmount mnt
+ rm -rf mnt cdimage
+ exit 1;
+ fi
+ unmount mnt
+ rm -rf mnt
+fi
+if [ $type == cdrom ] ; then
+ rm -rf cdimage
+ mkdir cdimage
+ cp -a $where/* cdimage
+ if [ $? != 0 ] ; then
+ echo "Copy from cdrom to cdimage failed"
+ rm -rf cdimage
+ exit 1;
+ fi
+fi
+#
--- /dev/null
+#!/bin/sh
+
+. ./config
+
+if [ ! -f $KNOPPIX_SOURCE ]; then
+ echo "Please edit config file and set appropriate values (KNOPPIX_SOURCE)"
+ exit 1;
+fi
+
+[ ! -d $REMASTER_PATH/master/KNOPPIX ] && mkdir -p $REMASTER_PATH/master/KNOPPIX
+[ ! -d $REMASTER_PATH/master/boot ] && cp isolinux.tar.bz2 $REMASTER_PATH/master/ && cd $REMASTER_PATH/master && tar -xjf isolinux.tar.bz2 && rm isolinux.tar.bz2
+
+# preparing the knoppix source folder
+if [ ! -d $REMASTER_PATH/source ]; then
+ if [ -f $KNOPPIX_SOURCE ]; then
+ cd $REMASTER_PATH
+ echo "Detarring knoppix source file, this can take some minutes"
+ tar -xjf $KNOPPIX_SOURCE
+ elif [ ${KNOPPIX_SOURCE:0:4} == "http"]; then
+ cd $REMASTER_PATH
+ if [ -f `which wget`]; then
+ wget $KNOPPIX_SOURCE
+ elif [ -f `which curl`]; then
+ curl $KNOPPIX_SOURCE > knoppix.source.tar.bz2
+ else
+ "could not download $KNOPPIX_SOURCE, please do it by hand and edit config"
+ fi
+ else
+ echo "problem with accessing knoppix source file"
+ fi
+fi
--- /dev/null
+#!/bin/sh
+
+TOPDIR=`pwd`
+
+LOOP2=/tmp/bacula_rescue_loop2
+rm -rf $LOOP2
+mkdir -p $LOOP2
+
+# Assume that everything to be loaded into memory with the
+# RAM disk image (initrd) is is in the roottree directory.
+
+echo "Creating the Initial RAM disk image.... "
+
+# first find out how much space we need.
+ISIZE=`du -s -k roottree/ | awk '{print $1}'`
+
+# add 2 Meg for extra
+ISIZE=`expr $ISIZE + 2048`
+echo "Initial RAM disk contents will be $ISIZE KB"
+
+# delete the existing RAM disk image, if there is one
+rm -f root
+
+dd if=/dev/zero of=$TOPDIR/root bs=1k count=$ISIZE
+
+# cleanup any prior left over stuff
+umount $LOOP2 2>/dev/null >/dev/null
+losetup -d /dev/loop2 2>/dev/null >/dev/null
+
+# associate it with /dev/loop2
+losetup /dev/loop2 $TOPDIR/root
+
+# make an ext2 filesystem on it. Set reserve to 0
+mke2fs -q -m 0 /dev/loop2 $ISIZE
+if [ $? != 0 ] ; then
+ echo "Build failed."
+ exit 1
+fi
+
+# we mount it...
+mount /dev/loop2 $LOOP2
+# ... and delete the lost+found directory
+rm -rf $LOOP2/lost+found
+
+# then we copy the contents of our roottree to this filesystem
+cp -dpR roottree/* $LOOP2/
+cprtn=$?
+
+# and unmount and divorce /dev/loop2
+umount $LOOP2
+losetup -d /dev/loop2
+rm -rf $LOOP2
+
+# If above copy failed, bail out
+if [ $cprtn != 0 ] ; then
+ echo "RAM disk build failed."
+ exit 1
+fi
+
+# This is a newer way of creating a ramfs, which we don't use
+# (cd roottree; find . | cpio --quiet -c -o) >root
+
+echo "Building initial RAM disk done"
+
+# Now we have the image of the RAM disk in $TOPDIR/loopfiles/root. We
+# compress this one and write the compressed image to the boot tree:
+
+echo "Compressing the RAM disk image.... "
+
+# delete any existing one
+rm -f cdtree/boot/isolinux/initrd.img
+
+# and gzip our RAM disk image and put it in the right place.
+gzip -9 -c root >cdtree/boot/isolinux/initrd.img
+if [ $? != 0 ] ; then
+ echo "Build failed"
+ exit 1
+fi
+
+rdsize=`expr $ISIZE \* 1024`
+echo "Ramdisk size is $rdsize"
+
+echo "Making isolinux.cfg"
+cat >cdtree/boot/isolinux/isolinux.cfg <<END_OF_DATA
+default linux
+prompt 1
+display boot.msg
+timeout 300
+F1 boot.msg
+F2 options.msg
+F3 general.msg
+F4 kernel.msg
+label linux
+ kernel vmlinuz
+ append ramdisk_size=$rdsize initrd=initrd.img
+label memtest86
+ kernel memtest
+ append -
+END_OF_DATA
+
+# we are done with the RAM disk image, delete it
+rm -f root
+
+echo "Initial RAM disk initrd.img is built."
--- /dev/null
+#! /bin/sh
+
+# This script updates the kernel and modules from your
+# current system.
+#
+
+TOPDIR=`pwd`
+KERNEL=$1
+if test x${KERNEL} = x ; then
+ KERNEL=`uname -r`
+fi
+
+rm -rf roottree/dev
+tar xfz dev.tar.gz -C roottree
+if [ $? != 0 ] ; then
+ echo "Update failed."
+ exit 1
+fi
+
+#
+# Update modules in root RAM disk
+# Keep kernel directory structure
+#
+echo "Updating modules in root RAM disk"
+rm -rf roottree/lib/modules
+mkdir -p roottree/lib/modules
+cp -af /lib/modules/$KERNEL/ roottree/lib/modules/
+
+# clean up just a bit removing stuff we do not support
+rm -rf roottree/lib/modules/$KERNEL/build
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/bluetooth
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/pcmcia
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/usb
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/video
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/isdn
+rm -rf roottree/lib/modules/$KERNEL/kernel/sound
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/sound
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/crypto
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/net/wireless
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/net/appletalk
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/net/tokenring
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/net/irda
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/media
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/infiniband
+rm -rf roottree/lib/modules/$KERNEL/kernel/drivers/crypto
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/appletalk
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/bluetooth
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/ipv6
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/irda
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/atm
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/bridge
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/sunrpc
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/wanrouter
+rm -rf roottree/lib/modules/$KERNEL/kernel/net/tux
+
+
+
+kernel="/boot/vmlinuz-$KERNEL"
+echo "Coping $kernel to $TOPDIR/cdtree/boot/isolinux/vmlinuz"
+cp -f $kernel $TOPDIR/cdtree/boot/isolinux/vmlinuz
+if [ $? != 0 ] ; then
+ echo "Could not find kernel. Update failed."
+ exit 1
+fi
+if [ -e /boot/map ] ; then
+ cp -f /boot/map $TOPDIR/cdtree/boot/isolinux/map
+ if [ $? != 0 ] ; then
+ echo "Update failed."
+ exit 1
+ fi
+fi