From: <smi...@us...> - 2003-12-23 16:05:36
|
Update of /cvsroot/devil-linux/build/config/etc/init.d In directory sc8-pr-cvs1:/tmp/cvs-serv2081/config/etc/init.d Modified Files: functions jail Log Message: - save-config now uses devices from devfs (more dynamic) - better handling of subdirectories & links in jail script (fl) - initrd script now uses devfs for finding the floppy drives (this was broken in older kernels) - initrd script now searches scsi partitions first for etc.tar.bz2 Index: functions =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/init.d/functions,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- functions 20 Aug 2003 19:15:35 -0000 1.10 +++ functions 23 Dec 2003 16:05:33 -0000 1.11 @@ -23,8 +23,11 @@ NORMAL="echo -en \\033[0;39m" SUCCESS="echo -en \\033[1;32m" +GREEN=$SUCCESS WARNING="echo -en \\033[1;33m" +YELLOW=$WARNING FAILURE="echo -en \\033[1;31m" +RED=$FAILURE print_error_msg() { Index: jail =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/init.d/jail,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- jail 20 Dec 2003 01:10:30 -0000 1.22 +++ jail 23 Dec 2003 16:05:33 -0000 1.23 @@ -74,7 +74,7 @@ ls -l $1 | cut -d ">" -f 2 | cut -c 2- } -# copies the files given in $1 to $2 +# copies the files given in $1 to $JAILDIR # preserve attributes # if file is a link follow this and copy all necessary links/files # @@ -82,17 +82,25 @@ { FILES=$1 [ -d "$FILES" ] && FILES=$FILES/* + for FILE in $(ls -d $FILES) do - TARGETDIR=${FILE%/*} - FILE=$FILE - mkdir -p $JAILDIR$TARGETDIR - cp -dfpR $FILE $JAILDIR$TARGETDIR - if [ -L "$FILE" ]; then - LINK=$(read_link $FILE) - LINKDIR=${LINK%/*} - [ "$LINKDIR" = "$LINK" ] && LINK=$TARGETDIR/$LINK - copy_files_links $LINK + if [ -d "$FILE" ]; then + # a subdirectory found + copy_files_links $FILE + else + # a file or symlink found + TARGETDIR=${FILE%/*} + FILE=$FILE + mkdir -p $JAILDIR/$TARGETDIR + chown -f --reference=$TARGETDIR $JAILDIR/$TARGETDIR + cp -dfpR $FILE $JAILDIR/$TARGETDIR + if [ -L "$FILE" ]; then + LINK=$(read_link $FILE) + LINKDIR=${LINK%/*} + [ "$LINKDIR" = "$LINK" ] && LINK=$TARGETDIR/$LINK + copy_files_links $LINK + fi fi done } |