From 1208f5d267572b530fb19e9fcd8795511aef8641 Mon Sep 17 00:00:00 2001 From: Kermorgant Date: Wed, 5 Apr 2006 11:43:18 +0000 Subject: [PATCH] removed unused scripts from knoppix/cdrom FAQ : explains how to customize the iso gestdiskinfo : added netmask to the start_network script and creation of tmp, proc and sys on demand make_static_bacula : use of sed to modify the WorkingDirectory directive (use of /tmp while commenting out original value) --- rescue/knoppix/.cvsignore | 10 ++ rescue/knoppix/Makefile.in | 13 +++ rescue/knoppix/cdrom/FAQ | 45 +++++++++ rescue/knoppix/cdrom/README | 6 +- rescue/knoppix/cdrom/makebinaries | 160 ------------------------------ rescue/knoppix/cdrom/makecdimage | 110 -------------------- rescue/knoppix/cdrom/makeinitrd | 104 ------------------- rescue/knoppix/cdrom/makekernel | 71 ------------- 8 files changed, 71 insertions(+), 448 deletions(-) create mode 100644 rescue/knoppix/.cvsignore create mode 100644 rescue/knoppix/Makefile.in create mode 100644 rescue/knoppix/cdrom/FAQ delete mode 100644 rescue/knoppix/cdrom/makebinaries delete mode 100644 rescue/knoppix/cdrom/makecdimage delete mode 100644 rescue/knoppix/cdrom/makeinitrd delete mode 100644 rescue/knoppix/cdrom/makekernel diff --git a/rescue/knoppix/.cvsignore b/rescue/knoppix/.cvsignore new file mode 100644 index 0000000..ee40e78 --- /dev/null +++ b/rescue/knoppix/.cvsignore @@ -0,0 +1,10 @@ +Makefile +diskinfo +format.hda +mount_drives +partition.hda +sfdisk +start_network +1 +bacula-fd +bacula-fd.conf diff --git a/rescue/knoppix/Makefile.in b/rescue/knoppix/Makefile.in new file mode 100644 index 0000000..f6b06c7 --- /dev/null +++ b/rescue/knoppix/Makefile.in @@ -0,0 +1,13 @@ + +all: + +install: + +uninstall: + +clean: + (cd cdrom; make clean) + +distclean: + +depend: diff --git a/rescue/knoppix/cdrom/FAQ b/rescue/knoppix/cdrom/FAQ new file mode 100644 index 0000000..25ed491 --- /dev/null +++ b/rescue/knoppix/cdrom/FAQ @@ -0,0 +1,45 @@ +Questions : +* CAN I MODIFY THE BACULA-KNOPPIX ISO ? +* HOW DO I MODIFY THE ISO ? +* WHERE CAN I LEARN MORE ON REMASTERING KNOPPIX ? + + +Answers : + +* CAN I MODIFY THE BACULA-KNOPPIX ISO ? + Yes. It should be very easy provided you know a bit about debian (apt-get, apt-cache, debian structure) + + + +* HOW DO I MODIFY THE ISO ? + If you have already built an iso, you should have a directory containing Knoppix's source (see cdrom/config file). + If not, cd to knoppix/cdrom, edit 'config' file and type 'make environment' + + Do the following : + +# cd knoppix/cdrom +# . config +# chroot $REMASTER_PATH/source/KNOPPIX +# mount -t proc /proc proc +# apt-get update + + Warning : Do not do an 'apt-get upgrade' + Now, you can install packages with apt-get or edit config files. + + When you have finished, do +# umount /proc +# exit +if you have gathered all the client configurations under roottree (see README), do : +# make knoppix + + +* WHERE CAN I LEARN MORE ON REMASTERING KNOPPIX ? + + The Remastering Howto : + http://www.knoppix.net/wiki/Knoppix_Remastering_Howto + + The Remastering forum : + http://www.knoppix.net/forum/viewforum.php?f=2 + + HOWTO: Upgrading the kernel : + http://www.knoppix.net/forum/viewtopic.php?t=21145 diff --git a/rescue/knoppix/cdrom/README b/rescue/knoppix/cdrom/README index 4ec5e3b..70550e1 100644 --- a/rescue/knoppix/cdrom/README +++ b/rescue/knoppix/cdrom/README @@ -1,6 +1,6 @@ This folder knoppix/cdrom was created by Mikael Kermorgant on Thu, 30 Mar 2006 -It contains scripts aimed at creating a bootable rescue cd based on knoppix (see http://www.knoppix.org). +It contains a modified copy of the linux/cdrom folder created by Kern Sibbald for the Bacula Rescue CD and 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: @@ -8,7 +8,7 @@ Requirements: - 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) - + - already installed, configured and running bacula-fd (optional but helps having a working configuration on the cd) A - To build an ISO image for burning a CD, do the following : @@ -47,4 +47,4 @@ B - Build an iso image for multiple clients Copy bacula-.tar.gz on the machine you built the iso and extract it in bacula-rescue-/knoppix/cdrom/roottree and execute : - make knoppix \ No newline at end of file + make knoppix diff --git a/rescue/knoppix/cdrom/makebinaries b/rescue/knoppix/cdrom/makebinaries deleted file mode 100644 index 97b6c06..0000000 --- a/rescue/knoppix/cdrom/makebinaries +++ /dev/null @@ -1,160 +0,0 @@ -#!/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/ diff --git a/rescue/knoppix/cdrom/makecdimage b/rescue/knoppix/cdrom/makecdimage deleted file mode 100644 index 7e1128d..0000000 --- a/rescue/knoppix/cdrom/makecdimage +++ /dev/null @@ -1,110 +0,0 @@ -#! /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 </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 <