Howto: Call the debian-cd hooks from simple-cdd
Hi
in your script:
/usr/share/simple-cdd/tools/build/debian-cd
i've found this notice:
# TODO: use the hook mechanism of debian-cd to first indicate the
# size that must be reserved and then copy the files at the appropriate time in
# the process (see RESERVED_BLOCKS_HOOK and DISC_START_HOOK). The current
# approach can overflow the media.
cp -a $extras_base_dir/. $TDIR/$CODENAME/CD1
Currently i am playing with simple-cdd to port a german school-server
to debian. May be we are using simple-cdd to burn a cdrom.
To use the hooks from debian-cd, i've done the following things:
1. Create a script which calls simple-cdd (ark45cdd)
2. export the hook you want to use
3. create the script which is called from the hook
In our case, i am only interested in the DISC_START_HOOK, because i
want to copy additional files to the CD.
Here is the approach:
cat ark45-cdd
#!/bin/sh
export simple_cdd_dir="/home/hjede/my-simple-cdd"
export DISC_START_HOOK="$simple_cdd_dir/disc-start-hook.sh"
/usr/share/simple-cdd/build-simple-cdd \
--conf $simple_cdd_dir/profiles/ARK45.conf \
--dist etch \
"$@"
#end of ark45-cdd
cat disc-start-hook.sh
#!/bin/sh
# $TDIR (the temporary dir containing the build tree)
# $MIRROR (the location of the mirror)
# $DISKNUM (the image number in the set)
# $CDDIR (the root of the temp disc tree)
# $ARCHES (the set of architectures chosen)
# The disc_start hook. This will be called near the beginning of the
# start_new_disc script, just after the directory tree has been created
# but before any files have been added
#export DISC_START_HOOK=/bin/true
echo "Script $0 wurde gestartet.
mit folgenden Parametern:
TDIR=$1
MIRROR=$2
DISKNUM=$3
CDDIR=$4
ARCHES=$5
" > $simple_cdd_dir/disc-start-hook.log
if [ "$3"=1 ] ; then
cp -a $simple_cdd_dir/preseed.cfg $1/$CODENAME/CD1/
fi
#end of disc-start-hook.sh
That's it.
Here the log after building the CD.
cat disc-start-hook.log
Script /home/hjede/my-simple-cdd/disc-start-hook.sh wurde gestartet.
mit folgenden Parametern:
TDIR=/home/hjede/my-simple-cdd/tmp//cd-build
MIRROR=/home/hjede/my-simple-cdd/tmp//mirror
DISKNUM=1
CDDIR=/home/hjede/my-simple-cdd/tmp//cd-build/etch/CD1
ARCHES=i386
#end of logfile
--
Gruss
Harry Jede
Reply to: