Unionfs ODF regression: Support creation/detection of pipes and character/block devices
authorRachita Kothiyal <rachita@louie.fsl.cs.sunysb.edu>
Fri, 28 Dec 2007 04:45:59 +0000 (23:45 -0500)
committerRachita Kothiyal <rachita@louie.fsl.cs.sunysb.edu>
Fri, 28 Dec 2007 04:45:59 +0000 (23:45 -0500)
Signed-off-by: Rachita Kothiyal <rachita@fsl.cs.sunysb.edu>
scaffold

index a3db2a944d54077a5da6b462df7b930f12201a5e..d97bbd2a1e2fa0136b60cdbc2b20cd88b82f672c 100644 (file)
--- a/scaffold
+++ b/scaffold
@@ -65,13 +65,17 @@ function create_hierarchy {
                        NAME=`echo $LINE | cut -d' ' -f 2`
                fi
 
-               unset DIR FILE IMMUTABLE SOURCE SYMLINK WH OPQ
+               unset DIR FILE IMMUTABLE SOURCE SYMLINK BLOCKDEV CHARDEV PIPE WH OPQ
 
                ( echo $TYPE | grep -q d ) && DIR=1
                ( echo $TYPE | grep -q f ) && FILE=1
                ( echo $TYPE | grep -q i ) && IMMUTABLE=1
                ( echo $TYPE | grep -q s ) && SOURCE=1
                ( echo $TYPE | grep -q l ) && SYMLINK=1
+               ( echo $TYPE | grep -q b ) && BLOCKDEV=1
+               ( echo $TYPE | grep -q c ) && CHARDEV=1
+               ( echo $TYPE | grep -q p ) && PIPE=1
+
                ( echo $TYPE | grep -q w ) && WH=1
                ( echo $TYPE | grep -q o ) && OPQ=1
 
@@ -124,6 +128,19 @@ function create_hierarchy {
                        fi
                 elif [ ! -z "$SYMLINK" ] ; then
                        ln -s "linktext:$NAME" $NAME
+               elif [ ! -z "$BLOCKDEV" ] ; then
+                       mkdir -p `dirname $NAME` || exit $?
+                       # re-create /dev/loop7 (better be free)
+                       mknod $NAME b 7 7 || exit $?
+                       chmod 644 $NAME || exit $?
+               elif [ ! -z "$CHARDEV" ] ; then
+                       mkdir -p `dirname $NAME` || exit $?
+                       # re-create a /dev/null
+                       mknod $NAME c 1 3 || exit $?
+                       chmod 644 $NAME || exit $?
+               elif [ ! -z "$PIPE" ] ; then
+                       mkfifo $NAME || exit $?
+                       chmod 644 $NAME || exit $?
                elif [ ! -z "$WH" ]; then
                        if [ "$ODF" -eq "1" ]; then
                                mkdir -p `dirname $ODF_DIR"/ns/"$NAME` || exit $?
@@ -234,6 +251,8 @@ function check_hierarchy {
            find $i -type b -printf 'b %p\n'
            find $i -type c -printf 'c %p\n'
            find $i -type l -printf 'l %p\n'
+           find $1 -type p -printf 'p %p\n'
+           find $1 -type s -printf 's %p\n'
        ) | sort >> /tmp/check-$$
        done