From 134a833ae46183b26cccc9c61e9e438c9388fa87 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 31 Jan 2017 01:02:03 -0500 Subject: [PATCH] Add utility script which generates a small sample file system Signed-off-by: Theodore Ts'o --- util/gen-sample-fs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 util/gen-sample-fs 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 + + -- 1.8.3.1