Skip to content

Commit

Permalink
exfatprogs: add exfat2img to dump a partition
Browse files Browse the repository at this point in the history
Add exfat2img to dump metadata of an exFAT filesystem.
It dump boot sector, FAT, bitmap, all metadata which
can reach from root directory.

exfat2img -o sda1.dump /dev/sda1
exfat2img -o - /dev/sda1 | bzip2 > sda1.dump.bz

When restoring a partition from a dump image generated
from stdout, exfat2img should be used like the following:

bzip2 -dc sda1.dump.bz2 | exfat2img -o /dev/sdb1 -

Signed-off-by: Hyunchul Lee <[email protected]>
  • Loading branch information
hclee committed Sep 6, 2022
1 parent a3da451 commit b9806de
Show file tree
Hide file tree
Showing 6 changed files with 1,102 additions and 2 deletions.
1 change: 1 addition & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cc_library_headers {
"tune",
"label",
"dump",
"exfat2img",
],
}

Expand Down
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = lib mkfs fsck tune label dump
SUBDIRS = lib mkfs fsck tune label dump exfat2img

# manpages
dist_man8_MANS = \
manpages/fsck.exfat.8 \
manpages/tune.exfat.8 \
manpages/mkfs.exfat.8 \
manpages/exfatlabel.8 \
manpages/dump.exfat.8
manpages/dump.exfat.8 \
manpages/exfat2img.8

# other stuff
EXTRA_DIST = \
Expand All @@ -22,4 +23,5 @@ EXTRA_DIST = \
fsck/Android.bp \
label/Android.bp \
dump/Android.bp \
exfat2img/Android.bp \
README.md
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ AC_CONFIG_FILES([
tune/Makefile
label/Makefile
dump/Makefile
exfat2img/Makefile
])

AC_OUTPUT
6 changes: 6 additions & 0 deletions exfat2img/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AM_CFLAGS = -Wall -Wextra -include $(top_builddir)/config.h -I$(top_srcdir)/include -fno-common
exfat2img_LDADD = $(top_builddir)/lib/libexfat.a

sbin_PROGRAMS = exfat2img

exfat2img_SOURCES = exfat2img.c
Loading

0 comments on commit b9806de

Please sign in to comment.