From: Theodore Ts'o Date: Tue, 31 Jan 2017 06:02:03 +0000 (-0500) Subject: Add utility script which generates a small sample file system X-Git-Tag: v1.43.4~17 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=134a833ae46183b26cccc9c61e9e438c9388fa87;p=tools%2Fe2fsprogs.git Add utility script which generates a small sample file system Signed-off-by: Theodore Ts'o --- diff --git a/util/gen-sample-fs b/util/gen-sample-fs new file mode 100644 index 0000000..a6d7b31 --- /dev/null +++ b/util/gen-sample-fs @@ -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 + +