[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to copy files into target created by simple-cdd (corrected)

Am Montag, 14. Juli 2008 16:24 schrieb Mindaugas Mardosas:
> Hello, I need a hint on adding custom files to /usr/src directory
> using the Simple-CDD builder. Could anyone give me a hint or link?

put this in your profile.conf file:

export DISC_START_HOOK="$simple_cdd_dir/disc-start-hook.sh"

and here the content of this script:

# $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)


echo "Script $0 called with this params:


"  > $log

if [ "$3"=1 ] ; then
    cp -a $simple_cdd_dir/SRC $1/$CODENAME/CD1/ 2>&1 >>$log || true
# assuming that SRC is a directory under your simple-cdd-dir

Now, you have the files on CD. The next script will copy the files to 
the new installed system-

Create a script under profiles named <my-profil>.postinst and make it 
executeable, or add to default.postinst

#!/bin/sh -e

# CD is unmounted
mount /cdrom -o ro || /bin/true
# be sure the target dir exist
mkdir -p /usr/src/ || /bin/true
cp -a /cdrom/SRC/* /usr/src/ || /bin/true
# umount the CD
umount /cdrom  || /bin/true

That's it :-)


        Harry Jede

Reply to: