aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dumpf2fs.sh
diff options
context:
space:
mode:
authorBrint E. Kriebel <bekit@cyngn.com>2014-11-03 18:57:56 -0800
committerBrint E. Kriebel <bekit@cyngn.com>2014-11-03 18:57:56 -0800
commitf25e7804729d25bcfde575b78b501e06a8cbb708 (patch)
treed98e3220a7522671e6ce82a2d40bf878dfa3eccc /scripts/dumpf2fs.sh
parent5668a2234ad79ffd45838679692d10236a3e965f (diff)
parent4f5a66a6eb77baa896d3adfb12139a830573f609 (diff)
downloadandroid_external_f2fs-tools-stable/cm-11.0-XNF9X.tar.gz
android_external_f2fs-tools-stable/cm-11.0-XNF9X.tar.bz2
android_external_f2fs-tools-stable/cm-11.0-XNF9X.zip
Conflicts: Android.mk VERSION fsck/dump.c fsck/f2fs.h fsck/fsck.c fsck/main.c fsck/mount.c include/f2fs_fs.h include/f2fs_version.h lib/libf2fs.c mkfs/Makefile.am mkfs/f2fs_format.c mkfs/f2fs_format_utils.c mkfs/f2fs_format_utils.h tools/f2fstat.c tools/fibmap.c Change-Id: I5cc044a6fe47bac6cab8d845f8d63729f765de50
Diffstat (limited to 'scripts/dumpf2fs.sh')
-rwxr-xr-xscripts/dumpf2fs.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/scripts/dumpf2fs.sh b/scripts/dumpf2fs.sh
new file mode 100755
index 0000000..2c2a273
--- /dev/null
+++ b/scripts/dumpf2fs.sh
@@ -0,0 +1,61 @@
+#!/system/bin/sh
+DEV=/dev/block/mmcblk0p16
+
+CMD=$1
+BASE=0x200000
+BASE_MAIN=0xac00000
+
+case $CMD in
+cp1)
+ echo dump cp1
+ let addr=$BASE
+ echo $addr
+ hexdump -s $addr -n 4096 $DEV;;
+cp2)
+ echo dump cp2
+ let addr=$BASE+0x200000
+ hexdump -s $addr -n 4096 $DEV;;
+cp)
+ echo dump cp1 and cp2
+ let addr=$BASE
+ hexdump -s $addr -n 409 $DEV
+ let addr=$BASE+0x200000
+ hexdump -s $addr -n 4096 $DEV;;
+cp1_all)
+ echo dump cp1 all
+ let addr=$BASE
+ hexdump -s $addr -n 20480 $DEV;;
+cp2_all)
+ echo dump cp2 all
+ let addr=$BASE+0x200000
+ hexdump -s $addr -n 20480 $DEV;;
+cp_all)
+ echo dump cp1 and cp2 all
+ let addr=$BASE
+ hexdump -s $addr -n 20480 $DEV
+ let addr=$BASE+0x200000
+ hexdump -s $addr -n 20480 $DEV;;
+blk)
+ let addr=$BASE_MAIN+$2*0x200000+$3*0x1000
+ hexdump -s $addr -n 4096 $DEV
+ echo ;;
+inode)
+ let addr=$BASE_MAIN+$2*0x200000+$3*0x1000
+ for i in `seq $3 511`
+ do
+ hexdump -s $addr -n 8 $DEV
+ let end=$addr+0x0ff0
+ hexdump -s $end -n 16 $DEV
+ let addr=$addr+0x1000
+ done
+ echo ;;
+*)
+ let addr=$1*0x1000
+ let segno=$addr-$BASE_MAIN
+ let segno=$segno/0x200000
+ let off=$addr-$BASE_MAIN
+ let off=$off%0x200000/0x1000
+ echo $segno, $off
+ hexdump -s $addr -n 4096 $DEV
+ echo ;;
+esac