-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjustfile
60 lines (49 loc) · 1.66 KB
/
justfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
image := "_build/default/src/test.img"
HOME := env_var("HOME")
block_size := "4096"
program_block_size := "16"
test_img:
dune build @default
dd if=/dev/zero of={{image}} bs=64K count=1
_build/default/src/chamelon.exe format {{image}}
read: test_img mount
sudo mkdir /mnt/lib
sudo cp lib/block.ml /mnt/lib
_build/default/src/chamelon.exe read {{image}} {{block_size}} lib/block.ml
hardtail: test_img mount
#!/bin/bash
for i in `seq 1 10`; do
sudo dd if=/dev/zero of=/mnt/$i bs=500 count=1
done
sudo umount /mnt
_build/default/src/chamelon.exe ls {{image}} {{block_size}} /
_build/default/src/chamelon.exe read {{image}} {{block_size}} 10
for i in `seq 1 20`; do
_build/default/src/chamelon.exe write {{image}} {{block_size}} /moar$i "moar data yey $i"
done
echo ""
_build/default/src/chamelon.exe ls {{image}} {{block_size}} /
_build/default/src/chamelon.exe read {{image}} {{block_size}} /moar2
test: read hardtail
dune runtest -f
readmdir BLOCK:
readmdir.py -a --log {{image}} {{block_size}} {{BLOCK}}
readtree:
readtree.py -a --log {{image}} {{block_size}} 0 1
umount:
sudo umount -q /mnt || true
sudo losetup -d /dev/loop0 || true
sudo rm -r /mnt/* || true
mount: umount
sudo losetup /dev/loop0 {{image}}
sudo chmod a+rw /dev/loop0
sudo {{HOME}}/fuse-littlefs/lfs --block_size={{block_size}} -s /dev/loop0 /mnt
# nb: `ls /mnt` will fail if there are no files at all in the filesystem.
fuse-format:
dd if=/dev/zero of={{image}} bs=64K count=1
sudo umount -q /mnt || true
sudo losetup -d /dev/loop0 || true
sudo losetup /dev/loop0 {{image}}
sudo {{HOME}}/fuse-littlefs/lfs --block_size={{block_size}} --format /dev/loop0
hexdump:
xxd {{image}} | less