History log of /freebsd-current/usr.sbin/fstyp/fstyp.c
Revision Date Author Comments
# 4d65a7c6 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# da0c0e01 17-Aug-2021 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

fstyp: bump WARNS to default and work around warnings

Differential Revision: https://reviews.freebsd.org/D31588


# 0e92585c 17-Aug-2021 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

fstyp: add BeFS support

A simple support for detecting BeFS (BeOS) filesystem

Submitted by: Miguel Gocobachi
Differential Revision: https://reviews.freebsd.org/D29917


# bce7ee9d 28-Oct-2020 Edward Tomasz Napierala <trasz@FreeBSD.org>

Drop "All rights reserved" from all my stuff. This includes
Foundation copyrights, approved by emaste@. It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.

Reviewed by: emaste, imp, gbe (manpages)
Differential Revision: https://reviews.freebsd.org/D26980


# 509798ea 24-Dec-2019 Pedro F. Giffuni <pfg@FreeBSD.org>

sbin/fstyp: recgonize Dragonfly's hammer and hammer2.

This is based on DragonFly's implementation from about 2019-09-13. It
only contains the basic code and header information to identify the
disks.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D13369


# 5ab1cb52 23-Dec-2019 Conrad Meyer <cem@FreeBSD.org>

fstyp(8): Fix WITHOUT_ICONV build

Reported by: olivier


# e41d6276 22-Dec-2019 Conrad Meyer <cem@FreeBSD.org>

fstyp(8): Detect APFS containers

APFS NXSBs are more like slices (or zvols?) than individual filesystem,
but go ahead and detect them nicely as well.


# 50c59bbb 22-Dec-2019 Conrad Meyer <cem@FreeBSD.org>

fstyp(8): Detect HFS+ / HFSX volumes


# ec80d2ee 22-Dec-2019 Conrad Meyer <cem@FreeBSD.org>

fstyp(8): Use iconv(3) to convert NTFS vol labels correctly

Rather than hackily extracting only the ASCII subset of UTF-16LE, go ahead
and convert the label to the user's locale correctly.


# 85b4c344 21-Dec-2019 Conrad Meyer <cem@FreeBSD.org>

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>


# 1afab1fe 15-Jul-2018 Mariusz Zaborski <oshogbo@FreeBSD.org>

Use capsicum helpers in fstype and ctld.

Reviewed by: trasz


# 56226f9c 26-Apr-2017 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make fstyp(8) recognize exFAT even without the -u option.

While it's not directly mountable with mount(8), it's something that's
mountable - differently from GELI or zpools.

MFC after: 2 weeks


# e2660756 12-Jan-2017 Conrad Meyer <cem@FreeBSD.org>

fstyp(8): Detect exFAT filesystems

Simply detect the exFAT filesystem name in the Volume Boot Record
(superblock).

PR: 214908
Reported by: <vermaden at interia.pl>


# d11537c7 13-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use NULL instead of 0 for pointers.

The malloc will return a pointer to the allocated memory if successful,
otherwise a NULL pointer is returned.


# ca001338 28-Dec-2015 Xin LI <delphij@FreeBSD.org>

Eliminate unneeded includes.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D4716


# 69f172f2 23-Jun-2015 Allan Jude <allanjude@FreeBSD.org>

Switch fstyp build to toggle ZFS support on WITHOUT_ZFS rather than WITHOUT_CDDL

PR: 200976
Approved by: imp
MFC after: 1 week
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2045


# 398e498e 18-Jun-2015 Allan Jude <allanjude@FreeBSD.org>

Add the ability to detect ZFS and GELI encrypted file systems to fstyp(8)

Functionality is hidden behind the -u flag to avoid confusing automounters

PR: 200823
Reviewed by: asomers, eadler, wblock (man page)
Approved by: trasz
MFC after: 10 days
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2045


# 628b7128 18-Jun-2015 Edward Tomasz Napierala <trasz@FreeBSD.org>

Fix off-by-one error in fstyp(8) and geom_label(4) that made them use
a single space (" ") as a CD9660 label name when no label was present.
Similar problem was also present in msdosfs label recognition.

PR: 200828
Differential Revision: https://reviews.freebsd.org/D2830
Reviewed by: asomers@, emaste@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# be3a49ee 10-Dec-2014 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add fstyp(8). This utility, named after its SVR4 counterpart, detects
filesystems. It differs from file(1) in that it gives machine-parseable
output, it outputs filesystem labels, doesn't get confused by other
formats metadata, and runs in Capsicum sandbox.

Differential Revision: https://reviews.freebsd.org/D1255
Relnotes: yes
Sponsored by: The FreeBSD Foundation