summaryrefslogtreecommitdiffstats
path: root/util/gen-sample-fs
blob: 8e139160fd01573d2e94f1cd7293b88ff51d8383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

MNT=/mnt
FS=/tmp/foo.img

cp /dev/null $FS
mke2fs -q -t ext4 -O inline_data,^has_journal -I 256 -b 4096 -N 64 $FS 256
mount -t ext4 $FS $MNT
ln -s symlink_data $MNT/symlink
for i in 30 70 500 1023 1024; 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 -q -s foo -V bar $MNT/xattr
echo -e "one\n\ttwo" | attr -q -s quux $MNT/xattr
echo -e "abc\001\002\003" | attr -q -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
mkdir $MNT/sdir
touch $MNT/sdir/1
touch $MNT/sdir/2
touch $MNT/sdir/3
touch $MNT/sdir/4
mkdir $MNT/mdir
touch $MNT/mdir/1
touch $MNT/mdir/2
touch $MNT/mdir/3
touch $MNT/mdir/4
touch $MNT/mdir/5
umount $MNT
e2fsck -fp $FS