Skip to content

Instantly share code, notes, and snippets.

@h-yamamo
Last active August 6, 2020 05:19
Show Gist options
  • Save h-yamamo/9a5bca90738d27936f0924967c22d0d5 to your computer and use it in GitHub Desktop.
Save h-yamamo/9a5bca90738d27936f0924967c22d0d5 to your computer and use it in GitHub Desktop.
exFAT: Build exfat-dkms debian/ubuntu package to get the same usability as vfat(FAT32)

exFAT: Build and install exfat-dkms debian/ubuntu package

exFAT supported mainline kernel from linux-5.4. Regarding distribution support, it was supported by Ubuntu focal and it is supported by Debian bullseye. Until now, I used exfat-fuse. But with fuse, it's just a step away from usability. Native kernel support is easier to use.

Native support even before buster and bionic I wanted the same usability as the above, so I searched for the exfat dkms module. The exfat-dkms package was found in Ubuntu PPA below.

launchpad.net/~arter97/+archive/ubuntu/exfat-linux

It worked well when I tried it. But the problem is that it has some features that I don't need. The same functionality as vfat in mainline kernel is sufficient.

New in exfat code from linux-5.7. Reading that code, the handling of timestamps was implemented as per Microsoft's published specifications. First, I decided to incorporate this into the exfat module of arter97's ubuntu ppa source code. After that, optimized and deleted unnecessary parts.

If you install the created exfat-dkms package, you can use exFAT as follows. An example /etc/fstab for people who mount manually. You can mount and use it without being aware of the difference between FAT32 and exFAT storage media.

#/etc/fstab

/dev/sdb1  /mp/u1  exfat,vfat  user,noauto,fmask=133,dmask=22,codepage=932,iocharset=utf8  0  0

Build and Install do not have to run on the same machine, but the same distribution version is preferred.

Build

  • Required packages: packaging-dev, dkms
(# in some directory)
wget -O - https://gist.github.com/h-yamamo/9a5bca90738d27936f0924967c22d0d5/archive/0f2f7982023a02b2eb3a4bda3a3666e5c49ed095.tar.gz | \
  tar xzf - -O --no-anchored exfat-linux-2.2.0.tar.xz > exfat-dkms_2.2.0+3arter97.orig.tar.xz
(# available branches are jessie, stretch, buster, xenial and bionic)
git clone -b (branch) https://gist.github.com/h-yamamo/9a5bca90738d27936f0924967c22d0d5
tar xf exfat-dkms_2.2.0+3arter97.orig.tar.xz
cd exfat-linux-2.2.0
tar xvf ../9a5bca90738d27936f0924967c22d0d5/debian.tar.xz
debuild -uc -us

Install

  • Required packages: dkms, appropriate linux-headers package

Note: This exfat module requires the nls_utf8 module, but it is not included in the linux-modules-(version-variant) package but is included in the linux-modules-extra-(version-variant) package in Ubuntu.

(# if installed)
sudo apt-get remove exfat-fuse

(# in directory where the package is exists)
sudo dpkg -i exfat-dkms_2.2.0+3arter97-r2~(distribution)_all.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment