if [ -f locations.include ] ; then . ./locations.include else if [ -f ../locations.include ] ; then . ../locations.include fi fi UPDATES=/tmp/updates.img MNTPOINT=/tmp/rhupdates RHupdates=$TREE/$SITEDIR/RHupdates if [ ! -d $RHupdates ] ; then echo "Not making a updates.img since there is no RHupdates directory" exit fi IMAGESIZE=`du -s $RHupdates | cut -f1` if [ $IMAGESIZE -le 65 ] ; then echo "Image was too small so had to make it bigger" IMAGESIZE=65 fi IMAGESIZE=`expr $IMAGESIZE + 1` echo "IMAGESIZE IS $IMAGESIZE" INODES=`find $RHupdates -print | wc -l` INODES=`expr $INODES + 10` echo "INODES is $INODES" dd if=/dev/zero of=$UPDATES bs=1k count=$IMAGESIZE /sbin/mke2fs -F -m 0 -q -N $INODES -b 1024 $UPDATES $IMAGESIZE rm -rf $MNTPOINT mkdir $MNTPOINT mount -o loop,sync -t ext2 $UPDATES $MNTPOINT /bin/rm -r $MNTPOINT/lost+found (cd $RHupdates ; find . | cpio -pvdum $MNTPOINT) sync sync sync df -k $MNTPOINT df -i $MNTPOINT umount $MNTPOINT #CJS we need to verify that what we think we copied to the .img is really there mount -o loop,ro -t ext2 $UPDATES $MNTPOINT diff -r $MNTPOINT $RHupdates if [ $? != 0 ] ; then echo "The newly created $UPDATES does not match $RHupdates" umount $MNTPOINT exit 1 else umount $MNTPOINT fi cp -v $UPDATES $TREE/$SITEDIR/images/ pwd