Thu Mar 4 10:02:44 2021 UTC ()
dosfstools: Update to 4.2

dosfstools 4.2 - released 2021-01-31
====================================

fatlabel now accepts two new options. When given the -i or --volume-id option,
fatlabel changes to an alternate mode where it displays or changes the volume
serial number instead of the volume label. With the -r or --reset option, it
will remove the label or (in the alternate mode) generate a new volume serial
number.

The user prompting for interactive fsck has been overhauled. Now it will
directly react to a pressed key without the user having to additionally press
enter. The changed prompting is also consistently repeating the prompt when
invalid input is given.

The legacy check whether it is running on Atari hardware when compiled for 68k
in order to automatically switch to Atari mode is now disabled by default. It
can be compiled in with the new configure switch --enable-atari-check.

Both mkfs and fsck now have a new option --variant=TYPE where TYPE can be
'standard' or 'atari' to explicitly select one of those variants rather than
having to toggle between them with -A.

fsck, mkfs and fatlabel were fixed to process volume label correctly. Previously
there were many issues during processing labels. Fixes issues are: leading byte
0xE5 of root label needs to be handled in special way, label cannot contain some
special characters, label itself is stored according to the current DOS codepage
which may be specified by a new --codepage option. fatlabel now reads volume
label only from the root directory to be compatible with existing systems like
MS-DOS 5.00, MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP, Windows 7, 8, 10
and also with the Linux mlabel from mtools project. fsck was extended to fix
incorrect volume labels and ensure that volume label from the root directory is
same as the volume label stored in boot sector. Old versions of dosfslabel read
label only from the boot sector. So with all these changes fsck now ensures
compatibility with both MS-DOS/Windows and old Linux/dosfslabel world.

fsck now allows spaces in the middle of SFNs. Previous behavior (when spaces
are disallowed) can be achieved by a new option -S.

Both mkfs and fsck now have fixed Year 2038 Bug. mkfs may still set filesystem
timestamp to 1980-01-01 00:00:00 (beginning of the FAT era) in case operating
system has Year 2038 Bug and cannot provide current time in time_t variable.

Some memory leaks were fixed in fatlabel and fsck to make valgrind happy.

Processing of command line arguments in all tools were fixed to ensure that
invalid options are not accepted anymore and proper error message is thrown
instead of trying to continue with uninitialized or undefined value.

In fsck and fatlabel were fixed issues that faulty filesystems were able to
trigger integer overflows during reading them.

mkfs now has a new option --offset for specifying offset at which filesystem
would start. This is useful when formatting FAT filesystem on disk image with
MBR table without need to use loopback kernel driver with partx to access only
specific partition.

All tools now can be compiled without iconv library and in this case they
support only CP850 codepage which is integrated into tools. This internal
CP850 codepage can be used also when tools were compiled with iconv library
which do not support CP850 (e.g. iconv from GNU libc without installed gconv
shared libraries).

Manual pages were updated to clarify some ambiguous options and descriptions.
fatlabel has a new section with details about volume label and codepage issues.

mkfs now has a new option --mbr which fills (fake) MBR table with one partition
which spans whole disk device. This (fake) MBR table is needed only for
non-removable disks used on Microsoft Windows systems and only when formatting
whole unpartitioned disk.

mkfs now calculates CHS geometry according to the SD Card Part 2 File System
Specification. For SD cards with more than 256MB capacity is this new CHS
calculation same as CHS calculation defined for hard disks via LBA-Assist
Translation. So CHS geometry calculation in mkfs is now compatible with both
SD Card specification and also LBA-Assist Translation. Moreover mkfs now has
also a new option -g for specifying CHS geometry manually if it is needed for
compatibility with some SD card readers. CHS geometry is part of FAT boot
sector which mkfs.fat must fill.

fsck now checks for DOS Clean Shutdown bit and marks filesystem as clean after
successful run. This is for compatibility with Microsft Windows 98 and also with
Windows NT-based variants.

Dependency on systemd/udev was completely removed from mkfs tool. But there is
no lost or removed functionality. Existing systemd/udev code was rewritten to
directly access sysfs and new implementation has less lines of code as previous
implementation which used systemd/udev libraries.

mkfs was fixed to setup FAT32 backup boot sector correctly.

mkfs's -D option (BIOS drive number) was relaxed to support also higher level
hard disk and floppy devices (second, third, ...).

fsck now preserve reserved fields in info sector. They are used by other systems
(e.g. FSIBOOT stage of lDOS boot32.asm), hence why are reserved.

fsck was extended to check and fix that first two entires in directory
structures are . and ..

mkfs now aligns total number of sectors to be multiple of the value of sectors
per track which is stored in FAT boot sector. This requirement is needed by DOS
systems and also by Linux FAT tools from mtools project. Alignment can be turned
off by -a option.

mkfs is now able to calculate FAT32 cluster size also for disks which have
sector size different than 512 bytes. Note that this calculation is not optimal.
It is just first step which ensures that mkfs does not fail during formatting
Native 4K disks.

mkfs cluster calculation was fixed to correctly handle differences between
FAT12 and FAT16 variants. mkfs now explicitly disallow to create FAT filesystem
with 4085 or 4086 clusters because Windows fastfat.sys detects such filesystem
as FAT12 but Linux msdos.ko/vfat.ko detects it as FAT16. mkfs now avoids this
situation to happen by fully automatic increasing or decreasing cluster size.

fsck now has a new option -F which can be used to specify FAT table used for
reading whole FAT filesystem. It can be useful in situation when user wants
to do recovery and filesystem repairing from second FAT table independently
of what fsck thinks that is the best.

fsck was extended to try fixing first FAT cluster but only when -F option is
specified. Previously when first FAT cluster was broken, fsck just printed
error: "Both FATs appear to be corrupt. Giving up." and failed.

fatlabel was fixed to not call parts of fsck procedure and to not print
warning or log messages on stdout as it conflicts with expected label
output on stdout.

A test suite was heavily extended and now it also checks that fsck repairs
broken filesystem into the expected state.

List of fixed issues:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391
https://github.com/dosfstools/dosfstools/issues/13
https://github.com/dosfstools/dosfstools/issues/18
https://github.com/dosfstools/dosfstools/issues/22
https://github.com/dosfstools/dosfstools/issues/29
https://github.com/dosfstools/dosfstools/issues/32
https://github.com/dosfstools/dosfstools/issues/38
https://github.com/dosfstools/dosfstools/issues/39
https://github.com/dosfstools/dosfstools/issues/43
https://github.com/dosfstools/dosfstools/issues/45
https://github.com/dosfstools/dosfstools/issues/52
https://github.com/dosfstools/dosfstools/issues/53
https://github.com/dosfstools/dosfstools/issues/54
https://github.com/dosfstools/dosfstools/issues/64
https://github.com/dosfstools/dosfstools/issues/66
https://github.com/dosfstools/dosfstools/issues/69
https://github.com/dosfstools/dosfstools/issues/70
https://github.com/dosfstools/dosfstools/issues/74
https://github.com/dosfstools/dosfstools/issues/88
https://github.com/dosfstools/dosfstools/issues/99
https://github.com/dosfstools/dosfstools/issues/111
https://github.com/dosfstools/dosfstools/issues/139
https://github.com/dosfstools/dosfstools/issues/151


(nia)
diff -r1.1 -r1.2 pkgsrc/sysutils/dosfstools/Makefile
diff -r1.1 -r1.2 pkgsrc/sysutils/dosfstools/PLIST
diff -r1.2 -r1.3 pkgsrc/sysutils/dosfstools/distinfo
diff -r0 -r1.1 pkgsrc/sysutils/dosfstools/patches/patch-src_blkdev_blkdev.c
diff -r1.1 -r1.2 pkgsrc/sysutils/dosfstools/patches/patch-src_device__info.c

cvs diff -r1.1 -r1.2 pkgsrc/sysutils/dosfstools/Makefile (expand / switch to unified diff)

--- pkgsrc/sysutils/dosfstools/Makefile 2018/06/24 11:13:58 1.1
+++ pkgsrc/sysutils/dosfstools/Makefile 2021/03/04 10:02:44 1.2
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1# $NetBSD: Makefile,v 1.1 2018/06/24 11:13:58 bsiegert Exp $ 1# $NetBSD: Makefile,v 1.2 2021/03/04 10:02:44 nia Exp $
2 2
3DISTNAME= dosfstools-4.1 3DISTNAME= dosfstools-4.2
4CATEGORIES= sysutils 4CATEGORIES= sysutils
5MASTER_SITES= ${MASTER_SITE_GITHUB:=dosfstools/} 5MASTER_SITES= ${MASTER_SITE_GITHUB:=dosfstools/}
6GITHUB_RELEASE= v4.1 6GITHUB_RELEASE= v${PKGVERSION_NOREV}
7 7
8MAINTAINER= bsiegert@NetBSD.org 8MAINTAINER= bsiegert@NetBSD.org
9HOMEPAGE= https://github.com/dosfstools/dosfstools/ 9HOMEPAGE= https://github.com/dosfstools/dosfstools
10COMMENT= Tools for working with FAT filesystems 10COMMENT= Tools for working with FAT filesystems
11LICENSE= gnu-gpl-v3 11LICENSE= gnu-gpl-v3
12 12
13GNU_CONFIGURE= yes 13GNU_CONFIGURE= yes
14 14
15.include "../../mk/bsd.pkg.mk" 15.include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/sysutils/dosfstools/PLIST (expand / switch to unified diff)

--- pkgsrc/sysutils/dosfstools/PLIST 2018/06/24 11:13:58 1.1
+++ pkgsrc/sysutils/dosfstools/PLIST 2021/03/04 10:02:44 1.2
@@ -1,15 +1,19 @@ @@ -1,15 +1,19 @@
1@comment $NetBSD: PLIST,v 1.1 2018/06/24 11:13:58 bsiegert Exp $ 1@comment $NetBSD: PLIST,v 1.2 2021/03/04 10:02:44 nia Exp $
2man/man8/fatlabel.8 2man/man8/fatlabel.8
3man/man8/fsck.fat.8 3man/man8/fsck.fat.8
4man/man8/mkfs.fat.8 4man/man8/mkfs.fat.8
5sbin/fatlabel 5sbin/fatlabel
6sbin/fsck.fat 6sbin/fsck.fat
7sbin/mkfs.fat 7sbin/mkfs.fat
8share/doc/dosfstools/ANNOUNCE.mkdosfs 8share/doc/dosfstools/ANNOUNCE.mkdosfs
 9share/doc/dosfstools/COPYING
 10share/doc/dosfstools/ChangeLog
9share/doc/dosfstools/ChangeLog.dosfsck 11share/doc/dosfstools/ChangeLog.dosfsck
10share/doc/dosfstools/ChangeLog.dosfstools-2.x 12share/doc/dosfstools/ChangeLog.dosfstools-2.x
11share/doc/dosfstools/ChangeLog.mkdosfs 13share/doc/dosfstools/ChangeLog.mkdosfs
 14share/doc/dosfstools/NEWS
 15share/doc/dosfstools/README
12share/doc/dosfstools/README.dosfsck 16share/doc/dosfstools/README.dosfsck
13share/doc/dosfstools/README.dosfstools-2.x 17share/doc/dosfstools/README.dosfstools-2.x
14share/doc/dosfstools/README.mkdosfs 18share/doc/dosfstools/README.mkdosfs
15share/doc/dosfstools/TODO.dosfstools-2.x 19share/doc/dosfstools/TODO.dosfstools-2.x

cvs diff -r1.2 -r1.3 pkgsrc/sysutils/dosfstools/distinfo (expand / switch to unified diff)

--- pkgsrc/sysutils/dosfstools/distinfo 2019/09/09 09:26:00 1.2
+++ pkgsrc/sysutils/dosfstools/distinfo 2021/03/04 10:02:44 1.3
@@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
1$NetBSD: distinfo,v 1.2 2019/09/09 09:26:00 nia Exp $ 1$NetBSD: distinfo,v 1.3 2021/03/04 10:02:44 nia Exp $
2 2
3SHA1 (dosfstools-4.1.tar.gz) = db39f667c3cb51bdf321f07f9cf17c726ca50323 3SHA1 (dosfstools-4.2.tar.gz) = 14efc68c64987a9067b6a919ad2870007247686b
4RMD160 (dosfstools-4.1.tar.gz) = 537b5418e6a78728ff8b94023966ce2155d64d6a 4RMD160 (dosfstools-4.2.tar.gz) = 5f9ae26d49fbc5cefc26eab8b02313a1ebfd9e69
5SHA512 (dosfstools-4.1.tar.gz) = c45b26779c126c128ff64668403d552b9ed70e9205ced968fa9c80e7220c2b24c3f24007ae41ee20e8993637ec2aca584142458d25db42df6488edf18fb6185b 5SHA512 (dosfstools-4.2.tar.gz) = 3cc0808edb4432428df8a67da4bb314fd1f27adc4a05754c1a492091741a7b6875ebd9f6a509cc4c5ad85643fc40395b6e0cadee548b25cc439cc9b725980156
6Size (dosfstools-4.1.tar.gz) = 233766 bytes 6Size (dosfstools-4.2.tar.gz) = 320917 bytes
7SHA1 (patch-src_device__info.c) = c342d080fb1b64d71813516e0aef4736587e6a3a 7SHA1 (patch-src_blkdev_blkdev.c) = dd39aa031b83429770a6164556f91d58bf88c3d5
 8SHA1 (patch-src_device__info.c) = 46102c27a601de7297a4ce3488bf327e818b8fa6

File Added: pkgsrc/sysutils/dosfstools/patches/patch-src_blkdev_blkdev.c
$NetBSD: patch-src_blkdev_blkdev.c,v 1.1 2021/03/04 10:02:44 nia Exp $

https://github.com/dosfstools/dosfstools/commit/8a917ed2afb2dd2a165a93812b6f52b9060eec5f.patch

--- src/blkdev/blkdev.c.orig	2021-01-31 12:49:12.000000000 +0000
+++ src/blkdev/blkdev.c
@@ -7,7 +7,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/sysmacros.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+# include <sys/sysmacros.h>
+#endif
 #include <unistd.h>
 #include <stdint.h>
 #include <stdio.h>

cvs diff -r1.1 -r1.2 pkgsrc/sysutils/dosfstools/patches/patch-src_device__info.c (expand / switch to unified diff)

--- pkgsrc/sysutils/dosfstools/patches/patch-src_device__info.c 2019/09/09 09:26:00 1.1
+++ pkgsrc/sysutils/dosfstools/patches/patch-src_device__info.c 2021/03/04 10:02:44 1.2
@@ -1,18 +1,32 @@ @@ -1,18 +1,32 @@
1$NetBSD: patch-src_device__info.c,v 1.1 2019/09/09 09:26:00 nia Exp $ 1$NetBSD: patch-src_device__info.c,v 1.2 2021/03/04 10:02:44 nia Exp $
 2
 3https://github.com/dosfstools/dosfstools/commit/8a917ed2afb2dd2a165a93812b6f52b9060eec5f.patch
2 4
3Support netbsd's spelling for statfs. 5Support netbsd's spelling for statfs.
4 6
5--- src/device_info.c.orig 2016-09-15 23:17:27.000000000 +0000 7--- src/device_info.c.orig 2021-01-31 12:49:12.000000000 +0000
6+++ src/device_info.c 8+++ src/device_info.c
7@@ -318,7 +318,11 @@ int is_device_mounted(const char *path) 9@@ -24,7 +24,10 @@
 10 #include <sys/types.h>
 11 #include <sys/stat.h>
 12 #include <sys/ioctl.h>
 13-#include <sys/sysmacros.h>
 14+
 15+#ifdef HAVE_SYS_SYSMACROS_H
 16+# include <sys/sysmacros.h>
 17+#endif
 18
 19 #ifdef HAVE_LINUX_LOOP_H
 20 #include <linux/loop.h>
 21@@ -334,7 +337,11 @@ int is_device_mounted(const char *path)
8 #endif 22 #endif
9  23
10 #if HAVE_DECL_GETMNTINFO 24 #if HAVE_DECL_GETMNTINFO
11+#ifdef __NetBSD__ 25+#ifdef __NetBSD__
12+ struct statvfs *stat; 26+ struct statvfs *stat;
13+#else 27+#else
14 struct statfs *stat; 28 struct statfs *stat;
15+#endif 29+#endif
16 int count, i; 30 int count, i;
17  31
18 count = getmntinfo(&stat, 0); 32 count = getmntinfo(&stat, 0);