]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fstyp(8): Show exFAT volume labels with -l flag
authorcem <cem@FreeBSD.org>
Sun, 22 Dec 2019 03:19:17 +0000 (03:19 +0000)
committercem <cem@FreeBSD.org>
Sun, 22 Dec 2019 03:19:17 +0000 (03:19 +0000)
commit73773fcda9f69ce7ee0c73292f273bab940223bf
tree87be274972528cb0428ea5baa6610ab47a269c95
parent9f0058d67341cab0968562ea573120910cb9edad
fstyp(8): Show exFAT volume labels with -l flag

exfat is fundamentally the same design as fat32.  The superblock differs
marginally, and there are some additional optional features irrelevant to
fstype(8); the structure of dirents has changed slightly to enable, among
other things, larger files; the directory entries are no longer DOS 8.3
ASCII or local 8-bit encoding, but instead explicitly UCS-2-LE.

(As a result, this change uses iconv to convert a found exfat volume label
to the user's locale.)

Locating the volume label is identical to FAT32: locate the root directory
and walk through dirents until you find a volume label.  Like FAT32, follow
the FAT chain between root directory clusters as necessary.

PR: 242225
Reported by: Victor Sudakov <vas AT sibptus.ru>
usr.sbin/fstyp/exfat.c
usr.sbin/fstyp/fstyp.c
usr.sbin/fstyp/fstyp.h
usr.sbin/fstyp/tests/fstyp_test.sh