From 12a170898a5f58fac44070cbefd416e1e56d396a Mon Sep 17 00:00:00 2001 From: Erez_Zadok Date: Mon, 9 Jul 2007 23:47:34 -0400 Subject: [PATCH] Support tmpfs and ramfs lower file systems. Signed-off-by: Erez Zadok --- brm.conf | 7 +++++-- default.conf | 7 +++++-- run-tests | 27 ++++++++++++++++----------- t-mmap.sh | 9 +++++---- thor.conf | 7 +++++-- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/brm.conf b/brm.conf index 2a0b8da..0e3a478 100644 --- 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 diff --git a/default.conf b/default.conf index 66232f5..a8a6305 100644 --- a/default.conf +++ b/default.conf @@ -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 diff --git a/run-tests b/run-tests index bf69144..a9d3915 100755 --- 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 } diff --git a/t-mmap.sh b/t-mmap.sh index 5c21409..5ada47b 100755 --- 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 diff --git a/thor.conf b/thor.conf index 775488d..19c4e4a 100644 --- 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 -- 2.43.0