99.7. dosfstools-4.2
Various utilities for use with the FAT family of file systems
| Version | 4.2, release 1 |
| Shelf | filesystem — Filesystem utilities, FUSE, and network or encrypted filesystems |
| Phase | 41_system (System), 507 of 1047 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://github.com/dosfstools/dosfstools |
| Build time | 0.1 SBU |
| Installed size | 513.7 KiB in 33 files |
| Recipe | ports/core/filesystem/dosfstools/kpkgbuild |
About
dosfstools creates, checks and labels FAT filesystems: mkfs.fat, fsck.fat and fatlabel. EFI system partitions are FAT, so KDOS needs it wherever it writes one: kinstall formats the ESP of a new install with mkfs.vfat -F 32 -n KDOS_EFI, and its first page marks the install as failing preflight when mkfs.vfat is missing; kdos rebuild checks for mkfs.fat before it makes a new medium. libblockdev and gparted depend on it too.
Sources
dosfstools-4.2.tar.gz(313.4 KiB)
sha25664926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527
upstream: https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz
archive copy: sources-2/filesystem--dosfstools-4.2.tar.gz
Dependencies
Depends on: nothing a recipe names.
Required by (3): gparted, kpmcore, libblockdev.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install dosfstools'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/filesystem/dosfstools.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/filesystem/dosfstools
echo '64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527 dosfstools-4.2.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/dosfstools
SRC=$SRC_ROOT/dosfstools-4.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf dosfstools-4.2.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
./configure --prefix=/usr \
--enable-compat-symlinks \
--docdir=/usr/share/doc/$name
make
make DESTDIR=$PKG install
The switches, and why each is set:
--enable-compat-symlinks— Also installs the tools under their older names, as links:mkfs.vfat,mkfs.msdosandmkdosfstomkfs.fat;fsck.vfat,fsck.msdosanddosfscktofsck.fat; anddosfslabeltofatlabel. They are off by default, andkinstallrunsmkfs.vfatby that name, so without them it finds no FAT formatter.fsck -t vfatalso looks forfsck.vfat.--docdir=/usr/share/doc/$name— Where the documentation goes. It is the same directory as configure’s default,/usr/share/doc/dosfstools.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/dosfstools, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf dosfstools-4.2-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/dosfstools, and runs the triggers its paths call for.
Contents
Installed programs: dosfsck, dosfslabel, fatlabel, fsck.fat, fsck.msdos, fsck.vfat, mkdosfs, mkfs.fat, mkfs.msdos, mkfs.vfat.
Installed directories: /usr/share/doc/dosfstools, /usr/share/licenses/dosfstools.
Short descriptions
fatlabel |
set or get MS-DOS filesystem label or volume ID |
fsck.fat |
check and repair MS-DOS FAT filesystems |
mkfs.fat |
create an MS-DOS FAT filesystem |