xref: /aosp_15_r20/external/e2fsprogs/util/gen-sample-fs (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Worker#!/bin/bash
2*6a54128fSAndroid Build Coastguard Worker
3*6a54128fSAndroid Build Coastguard WorkerMNT=/mnt
4*6a54128fSAndroid Build Coastguard WorkerFS=/tmp/foo.img
5*6a54128fSAndroid Build Coastguard Worker
6*6a54128fSAndroid Build Coastguard Workercp /dev/null $FS
7*6a54128fSAndroid Build Coastguard Workermke2fs -q -t ext4 -O inline_data,^has_journal -I 256 -b 4096 -N 64 $FS 256
8*6a54128fSAndroid Build Coastguard Workermount -t ext4 $FS $MNT
9*6a54128fSAndroid Build Coastguard Workerln -s symlink_data $MNT/symlink
10*6a54128fSAndroid Build Coastguard Workerfor i in 30 70 500 1023 1024; do
11*6a54128fSAndroid Build Coastguard Worker	ln -s /$(perl -e "print 'x' x $i;") $MNT/l_$i
12*6a54128fSAndroid Build Coastguard Workerdone
13*6a54128fSAndroid Build Coastguard Workertouch $MNT/acl
14*6a54128fSAndroid Build Coastguard Workersetfacl -m u:daemon:r $MNT/acl
15*6a54128fSAndroid Build Coastguard Workersetfacl -m u:bin:rx $MNT/acl
16*6a54128fSAndroid Build Coastguard Workersetfacl -m g:mail:rw $MNT/acl
17*6a54128fSAndroid Build Coastguard Workersetfacl -m g:daemon:r $MNT/acl
18*6a54128fSAndroid Build Coastguard Workertouch $MNT/simple_acl
19*6a54128fSAndroid Build Coastguard Workersetfacl -m u:daemon:r $MNT/simple_acl
20*6a54128fSAndroid Build Coastguard Workertouch $MNT/xattr
21*6a54128fSAndroid Build Coastguard Workerattr -q -s foo -V bar $MNT/xattr
22*6a54128fSAndroid Build Coastguard Workerecho -e "one\n\ttwo" | attr -q -s quux $MNT/xattr
23*6a54128fSAndroid Build Coastguard Workerecho -e "abc\001\002\003" | attr -q -s def $MNT/xattr
24*6a54128fSAndroid Build Coastguard Workerecho file_data > $MNT/small_inline
25*6a54128fSAndroid Build Coastguard Workera="I am a very model of a modern major general;"
26*6a54128fSAndroid Build Coastguard Workera="$a I've information vegetable, animal and mineral"
27*6a54128fSAndroid Build Coastguard Workerecho $a > $MNT/big_inline
28*6a54128fSAndroid Build Coastguard Workermkdir $MNT/sdir
29*6a54128fSAndroid Build Coastguard Workertouch $MNT/sdir/1
30*6a54128fSAndroid Build Coastguard Workertouch $MNT/sdir/2
31*6a54128fSAndroid Build Coastguard Workertouch $MNT/sdir/3
32*6a54128fSAndroid Build Coastguard Workertouch $MNT/sdir/4
33*6a54128fSAndroid Build Coastguard Workermkdir $MNT/mdir
34*6a54128fSAndroid Build Coastguard Workertouch $MNT/mdir/1
35*6a54128fSAndroid Build Coastguard Workertouch $MNT/mdir/2
36*6a54128fSAndroid Build Coastguard Workertouch $MNT/mdir/3
37*6a54128fSAndroid Build Coastguard Workertouch $MNT/mdir/4
38*6a54128fSAndroid Build Coastguard Workertouch $MNT/mdir/5
39*6a54128fSAndroid Build Coastguard Workerumount $MNT
40*6a54128fSAndroid Build Coastguard Workere2fsck -fp $FS
41