Made the diff stat from inside the testfs, so new users/groups would stat correctly. Changed disco-ball fetch to fetch into the testfs, not into / (yikes!). New disco-ball command spin does what the main disco loop used to do for each module. Added the "users" disco ball to the standard library.

This commit is contained in:
2012-08-23 00:16:22 -04:00
parent ef0a3488ae
commit ab74e27bb8
7 changed files with 81 additions and 25 deletions

View File

@@ -18,7 +18,12 @@ function colorize() {
}
function report() {
for module in $(ls /var/disco/reports/)
if [ "$1" != "" ]; then
MODULELIST="$1"
else
MODULELIST=$(ls /var/disco/reports/)
fi
for module in $MODULELIST;
do
BASE="report: $module:"
for file in $(ls /var/disco/reports/${module})
@@ -51,18 +56,7 @@ function dance() {
for module in $(cat /tmp/$$.tsort | tsort | tac)
do
echo "info: Processing ${module}"
NOOP="true" disco-ball template $module
NOOP=true /usr/bin/time -f "$TIME" -o /var/disco/reports/${module}/diff disco-fs-diff
if [ "$NOOP" == "" ]; then
rsync -aWH /var/disco/testfs/noop/scratchfs/. /.
fi
NOOP="$NOOP" disco-ball exec $module
RETVAL=$?
rm -rf /var/disco/testfs/noop/scratchfs/*
if [ $RETVAL -ne 0 ]; then
echo "error: Failed to apply $module."
fi
disco-ball spin ${module}
done
if [ "$REPORT" != "" ]; then

View File

@@ -23,7 +23,7 @@ while read LINE
do
FNAME=$(echo $LINE | cut -d : -f 4 | sed s/"^ *"/""/ | sed s/" *$"/""/)
MD5_NEW=$(md5sum ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null| cut -d " " -f 1)
STAT_NEW=$(stat --format "owner='%G:%U', selinux='%C', md5='${MD5_NEW}'" ${DISCOROOT}/scratchfs/${FNAME} 2>/dev/null)
STAT_NEW=$(chroot ${DISCOROOT}/chroot stat --format "owner='%G:%U', selinux='%C', md5='${MD5_NEW}'" /${FNAME} 2>/dev/null)
if [ ! -d ${FNAME} ] && [ ! -d ${DISCOROOT}/scratchfs${FNAME} ]; then
diff -N ${FNAME} ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null > /tmp/$$.diff
fi

View File

@@ -1,6 +1,7 @@
#!/bin/bash
DISCOCFG=/etc/disco
if [ "$NOOP" != "" ]; then
DISCOROOT=/var/disco/testfs/noop
else

View File

@@ -8,7 +8,7 @@ fi
mount | grep $DISCOROOT >/dev/null 2>&1
if [ $? -ne 0 ]; then
./disco-fs-mount || exit 1
echo "disco filesystem is not mounted; please mount it and try again."
fi
# Strip out any shebang and put the script in the root