Skip to content

Commit

Permalink
Merge pull request #54 from namjaejeon/exfat-next
Browse files Browse the repository at this point in the history
Exfat next
  • Loading branch information
namjaejeon authored Jul 10, 2021
2 parents 23bdc9a + ca42da0 commit 9b6cba0
Show file tree
Hide file tree
Showing 41 changed files with 2,675 additions and 870 deletions.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ notifications:
before_script:
- sudo apt-get install linux-headers-$(uname -r)
- git clone --branch=exfat-next https://github.com/namjaejeon/exfat_oot
- ./.travis_get_mainline_kernel
- export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
- export PATH=/usr/local/lib:$PATH

script:
# run checkpatch.pl
- git format-patch -20
- ./linux/scripts/checkpatch.pl *.patch || true
# build & install exfatprogs
- ./autogen.sh > /dev/null
- ./configure > /dev/null
- make -j$((`nproc`+1)) > /dev/null
Expand All @@ -30,8 +35,13 @@ script:
- i=1;while [ $i -le 10000 ];do sudo touch file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
- sync
- sudo rm -rf *
- i=1;while [ $i -le 10000 ];do sudo mkdir file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
- i=1;while [ $i -le 10000 ];do sudo mkdir dir$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
- sync
- sudo rm -rf *
- i=1;while [ $i -le 10000 ];do sudo touch file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
- i=1;while [ $i -le 10000 ];do sudo mkdir dir$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
- sync
- sudo fsck.exfat /dev/loop22
- sudo find . -delete
- sudo fsck.exfat /dev/loop22
- cd -
39 changes: 39 additions & 0 deletions .travis_get_mainline_kernel
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

#
# A simple script we are using to get the latest mainline kernel
# tar ball
#

wget https://www.kernel.org/releases.json
if [ $? -ne 0 ]; then
echo "Could not download kernel.org/releases.json"
exit 1
fi

VER=$(cat releases.json | python2.7 -c "import sys, json; print json.load(sys.stdin)['latest_stable']['version']")
if [ $? -ne 0 ]; then
echo "Could not parse release.json"
exit 1
fi

if [ "z$VER" = "z" ]; then
echo "Could not determine latest release version"
exit 1
fi

MVER=$(echo $VER | cut -d. -f1)

wget https://cdn.kernel.org/pub/linux/kernel/v"$MVER".x/linux-"$VER".tar.gz
if [ $? -ne 0 ]; then
echo "Could not download $VER kernel version"
exit 1
fi

tar xf linux-"$VER".tar.gz
if [ $? -ne 0 ]; then
echo "Could not untar kernel tar ball"
exit 1
fi

mv linux-"$VER" linux
4 changes: 4 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ cc_library_headers {
"include",
"mkfs",
"fsck",
"tune",
"label",
"dump",
],
}

cc_defaults {
name: "exfatprogs-defaults",
header_libs: ["libexfatprogs-headers"],
export_header_lib_headers: ["libexfatprogs-headers"],
cflags: ["-D_FILE_OFFSET_BITS=64"],
}
8 changes: 6 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

ACLOCAL_AMFLAGS = -I m4

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

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

# other stuff
EXTRA_DIST = \
Expand All @@ -18,4 +20,6 @@ EXTRA_DIST = \
mkfs/Android.bp \
tune/Android.bp \
fsck/Android.bp \
label/Android.bp \
dump/Android.bp \
README.md
58 changes: 58 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
exfatprogs 1.1.2 - released 2021-05-20
======================================

CHANGES :
* mkfs.exfat: set 0x80 to DriveSelect of the boot sector

BUG FIXES :
* Fix issues on 4KB logical sector devices
* Fix issues when the sector size of of a file system is different from
that of a block device.

exfatprogs 1.1.1 - released 2021-04-21
======================================

CHANGES :
* mkfs.exfat: adjust the boundary alignment calculations to compensate
for the volume offset.

NEW FEATURES :
* mkfs.exfat: add the "--pack-bitmap" option to relocate the allocation
bitmap to allow the FAT and the bitmap to share the same allocation
unit on flash media.

BUG FIXES :
* Fix wrong bit operations on 64-bit big.
* Fix memory leaks in error paths.

exfatprogs 1.1.0 - released 2021-02-09
======================================

CHANGES :
* fsck.exfat: recover corrupted boot region.

NEW FEATURES :
* exfatlabel: Print or Set volume label and serial.
* dump.exfat: Show the on-disk metadata information and the statistics.

BUG FIXES :
* set _FILE_OFFSET_BITS=64 for Android build.

exfatprogs 1.0.4 - released 2020-07-31
======================================

CHANGES :
* fsck.exfat: display sector, cluster, and volume sizes in the human
readable format.
* fsck.exfat: reduce the elapsed time using read-ahead.

NEW FEATURES :
* mkfs.exfat: generate pseudo unique serials while creating filesystems.
* mkfs.exfat: add the "-b" option to align the start offset of FAT and
data clusters.
* fsck.exfat: repair zero-byte files which have the NoFatChain attribute.

BUG FIXES :
* Fix memory leaks on error handling paths.
* fsck.exfat: fix the bug that cannot access space beyond 2TB.

exfatprogs 1.0.3 - released 2020-05-12
======================================

Expand Down
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Usage example:
mkfs.exfat -f /dev/sda1
4. For set volume label, use -l option with string user want.
mkfs.exfat -L "my usb" /dev/sda1
5. To change boundary alignment(KB or MB or Byte) user want
mkfs.exfat -b 16777216 /dev/sda1
mkfs.exfat -b 16384K /dev/sda1
mkfs.exfat -b 16M /dev/sda1
- fsck.exfat:
Check the consistency of your exfat filesystem and optionally repair a corrupted device formatted by exfat.
Expand All @@ -59,12 +63,57 @@ Usage example:
tune.exfat -l /dev/sda1
2. set new volume label.
tune.exfat -L "new label" /dev/sda1
3. print current volume serial.
tune.exfat -i /dev/sda1
4. set new volume serial.
tune.exfat -I 0x12345678 /dev/sda1
- exfatlabel:
Get or Set volume label or serial
Usage example:
1. get current volume label.
exfatlabel /dev/sda1
2. set new volume label.
exfatlabel /dev/sda1 "new label"
3. get current volume serial.
exfatlabel -i /dev/sda1
4. set new volume serial.
exfatlabel -i /dev/sda1 0x12345678
- dump.exfat:
Show on-disk information
Usage example:
dump.exfat /dev/sda1
```

## Benchmarks

Some fsck implementations were tested and compared for Samsung 64GB Pro
microSDXC UHS-I Class 10 which was filled up to 35GB with 9948 directories
and 16506 files by fsstress.

The difference in the execution time for each testing is very small.


| Implementation | version | execution time (seconds) |
|----------------------|-----------------|--------------------------|
| **exfatprogs fsck** | 1.0.4 | 11.561 |
| Windows fsck | Windows 10 1809 | 11.449 |
| [exfat-fuse fsck] | 1.3.0 | 68.977 |

[exfat-fuse fsck]: https://github.com/relan/exfat

## Sending feedback
If you have any issues, please create [issues][1] or contact to [Namjae Jeon](mailto:[email protected]) and
[Hyunchul Lee](mailto:[email protected]).
[Contributions][2] are also welcome.

[1]: https://github.com/exfatprogs/exfatprogs/issues
[2]: https://github.com/exfatprogs/exfatprogs/pulls

## Contributor information
* Please base your pull requests on the `exfat-next` branch.
* Make sure you add 'Signed-Off' information to your commits (e. g. `git commit --signoff`).
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign tar-pax subdir-objects])
AM_INIT_AUTOMAKE([foreign tar-pax dist-xz subdir-objects])

AC_LANG([C])
AC_PROG_CC
Expand All @@ -30,6 +30,8 @@ AC_CONFIG_FILES([
mkfs/Makefile
fsck/Makefile
tune/Makefile
label/Makefile
dump/Makefile
])

AC_OUTPUT
11 changes: 11 additions & 0 deletions dump/Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2021 The Android Open Source Project

cc_binary {
name: "dump.exfat",

srcs: [
"dump.c",
],
defaults: ["exfatprogs-defaults"],
static_libs: ["libexfat"],
}
6 changes: 6 additions & 0 deletions dump/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AM_CFLAGS = -Wall -include $(top_builddir)/config.h -I$(top_srcdir)/include -fno-common
dump_exfat_LDADD = $(top_builddir)/lib/libexfat.a

sbin_PROGRAMS = dump.exfat

dump_exfat_SOURCES = dump.c
Loading

0 comments on commit 9b6cba0

Please sign in to comment.