]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Add utility script which generates a small sample file system
authorTheodore Ts'o <tytso@mit.edu>
Tue, 31 Jan 2017 06:02:03 +0000 (01:02 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 31 Jan 2017 06:02:03 +0000 (01:02 -0500)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
util/gen-sample-fs [new file with mode: 0644]

diff --git a/util/gen-sample-fs b/util/gen-sample-fs
new file mode 100644 (file)
index 0000000..a6d7b31
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+MNT=/mnt
+FS=/tmp/foo.img
+
+cp /dev/null $FS
+mke2fs -t ext4 -O inline_data -I 256 -b 4096 $FS 256
+mount -t ext4 $FS $MNT
+ln -s symlink_data $MNT/symlink
+for i in 30 70 500 1023 1024 1500; do
+       ln -s /$(perl -e "print 'x' x $i;") $MNT/l_$i
+done
+touch $MNT/acl
+setfacl -m u:daemon:r $MNT/acl
+setfacl -m u:bin:rx $MNT/acl
+setfacl -m g:mail:rw $MNT/acl
+setfacl -m g:daemon:r $MNT/acl
+touch $MNT/simple_acl
+setfacl -m u:daemon:r $MNT/simple_acl
+touch $MNT/xattr
+attr -s foo -V bar $MNT/xattr
+echo -e "one\n\ttwo" | attr -s quux $MNT/xattr
+echo -e "abc\001\002\003" | attr -s def $MNT/xattr
+echo file_data > $MNT/small_inline
+a="I am a very model of a modern major general;"
+a="$a I've information vegetable, animal and mineral"
+echo $a > $MNT/big_inline
+umount $MNT
+
+