Support tmpfs and ramfs lower file systems.
authorErez_Zadok <ezk@cs.sunysb.edu>
Tue, 10 Jul 2007 03:47:34 +0000 (23:47 -0400)
committerErez_Zadok <ezk@cs.sunysb.edu>
Tue, 10 Jul 2007 03:47:34 +0000 (23:47 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
brm.conf
default.conf
run-tests
t-mmap.sh
thor.conf

index 2a0b8da7f1eb3d0894ca05534b1bd7bac24d0c21..0e3a478cf9ffb2dbb93dd0cbfbb7c326e91aea32 100644 (file)
--- a/brm.conf
+++ b/brm.conf
@@ -42,10 +42,13 @@ DEV2=/dev/loop3
 DEV3=/dev/loop4
 
 # Name of file systems to format your device.  Supported file systems
-# include: ext2, ext3, xfs, reiserfs, nfs, nfs2, nfs3, nfs4, and jffs2.
+# Include the following:
+# 1. Disk based: ext2, ext3, ext4, reiserfs, and xfs.
+# 2. Network: nfs, nfs2, and nfs3 (nfs4 support pending).
+# 3. Special: jffs2, ramfs, and tmpfs.
 case ${MYFS} in
        # jffs2 is special: only the leftmost filesystem uses it
-       jffs* )
+       jffs* | ramfs | tmpfs )
                FS0=${MYFS}
                FS1=ext2
                FS2=ext2
index 66232f5d2d662edac740418d7ce35f67f62c8cd4..a8a63051e7e7a73bd10d68c0ad80e4d70801afaa 100644 (file)
@@ -44,10 +44,13 @@ DEV2=/dev/loop2
 DEV3=/dev/loop3
 
 # Name of file systems to format your device.  Supported file systems
-# include: ext2, ext3, xfs, reiserfs, nfs, nfs2, nfs3, nfs4, and jffs2.
+# Include the following:
+# 1. Disk based: ext2, ext3, ext4, reiserfs, and xfs.
+# 2. Network: nfs, nfs2, and nfs3 (nfs4 support pending).
+# 3. Special: jffs2, ramfs, and tmpfs.
 case ${MYFS} in
        # jffs2 is special: only the leftmost filesystem uses it
-       jffs* )
+       jffs* | ramfs | tmpfs )
                FS0=${MYFS}
                FS1=ext2
                FS2=ext2
index bf6914457223ea3447a17afd00200442fb5228bc..a9d3915c12af227c99b579a75bc585b47ce4280a 100755 (executable)
--- a/run-tests
+++ b/run-tests
@@ -70,18 +70,19 @@ function setup_lower
        fs=$(eval echo \$FS$i)
 
        case "$dev" in
-           /dev/loop*|/dev/.static/dev/loop*)
+           /dev/loop*|/dev/.static/dev/loop* )
                case "$fs" in
                    jffs2 )
                        runcmd cp jffs2-empty.img /tmp/fs.$$.$i
+                       runcmd losetup $dev /tmp/fs.$$.$i
+                       ;;
+                   ramfs | tmpfs ) # nothing needed
                        ;;
                    * )
                        runcmd dd if=/dev/zero of=/tmp/fs.$$.$i bs=1024k count=1 seek=100 2> /dev/null
+                       runcmd losetup $dev /tmp/fs.$$.$i
                        ;;
                esac
-               runcmd losetup $dev /tmp/fs.$$.$i
-               ;;
-           *)
                ;;
        esac
 
@@ -134,6 +135,9 @@ function setup_lower
                runcmd mkdir -p /n/lower/b$i
                runcmd mount -t ext4dev $dev /n/lower/b$i
                ;;
+           ramfs | tmpfs )
+               runcmd mount -t $fs -o size=100m /n/lower/b$i /n/lower/b$i
+               ;;
            * )
                runcmd mkfs -t $fs -q $dev
                runcmd mkdir -p /n/lower/b$i
@@ -165,16 +169,17 @@ function do_umount
            runcmd rmmod block2mtd
            runcmd rmmod mtdblock
            ;;
-       * )
-           ;;
     esac
     case "$dev" in
        /dev/loop*|/dev/.static/dev/loop*)
-           runcmd losetup -d $dev
-           runcmd rm -f /tmp/fs.$$.$branch
-           ;;
-       *)
-           ;;
+               case "$fs" in
+                   ramfs | tmpfs ) # nothing needed
+                       ;;
+                   * )
+                       runcmd losetup -d $dev
+                       runcmd rm -f /tmp/fs.$$.$branch
+                       ;;
+               esac
     esac
 }
 
index 5c21409e12746dd32f42a154b188c2c599c1e012..5ada47b1236e10e292f3d4f16aadf8b7ee005fb5 100755 (executable)
--- a/t-mmap.sh
+++ b/t-mmap.sh
@@ -63,9 +63,10 @@ function test_rw {
 }
 
 test_ro
-# skip on jffs2 (doesn't support writeable mappings)
-if test "$FS0" != "jffs2" ; then
-    test_rw
-fi
+# skip on file systems which do not allow writeable mappings
+case "$FS0" in
+    jffs2 | ramfs ) ;;
+    * ) test_rw ;;
+esac
 
 complete_test
index 775488dbc615b9d94f1bf6de416f8f95212b0d31..19c4e4aa71ea13c0e39479a511e437608e52cc33 100644 (file)
--- a/thor.conf
+++ b/thor.conf
@@ -43,10 +43,13 @@ DEV2=/dev/.static/dev/loop2
 DEV3=/dev/.static/dev/loop3
 
 # Name of file systems to format your device.  Supported file systems
-# include: ext2, ext3, xfs, reiserfs, nfs, nfs2, nfs3, nfs4, and jffs2.
+# Include the following:
+# 1. Disk based: ext2, ext3, ext4, reiserfs, and xfs.
+# 2. Network: nfs, nfs2, and nfs3 (nfs4 support pending).
+# 3. Special: jffs2, ramfs, and tmpfs.
 case ${MYFS} in
        # jffs2 is special: only the leftmost filesystem uses it
-       jffs* )
+       jffs* | ramfs | tmpfs )
                FS0=${MYFS}
                FS1=ext2
                FS2=ext2