New version

Resolves: rhbz#1922767
This commit is contained in:
Jaroslav Škarvada 2021-02-01 13:23:39 +01:00
parent 92741e4bd8
commit 27137b5a3f
4 changed files with 14 additions and 39 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
dosfstools-*.tar.xz
/dosfstools-3.0.25.tar.gz
/dosfstools-4.2.tar.gz

View File

@ -1,30 +0,0 @@
diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
index 5843550..29fbf55 100644
--- a/src/mkfs.fat.c
+++ b/src/mkfs.fat.c
@@ -507,6 +507,7 @@ static void establish_params(struct device_info *info)
unsigned int heads = 255;
unsigned int media = 0xf8;
unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
+ unsigned int sector_size_mult = 1; /* x 512 == sector_size */
int def_root_dir_entries = 512;
if (info->size < 512 * 1024 * 1024) {
@@ -580,11 +581,15 @@ static void establish_params(struct device_info *info)
* fs size > 32G: 32k clusters
*
* This only works correctly for 512 byte sectors!
+ * For other sector sizes it tries to approximate.
*/
uint32_t sz_mb = info->size / (1024 * 1024);
+ if (info->sector_size > 0)
+ sector_size_mult = info->sector_size / 512;
cluster_size =
- sz_mb > 32 * 1024 ? 64 : sz_mb > 16 * 1024 ? 32 : sz_mb >
- 8 * 1024 ? 16 : sz_mb > 260 ? 8 : 1;
+ sz_mb > 32 * 1024 * sector_size_mult ? 64 : sz_mb >
+ 16 * 1024 * sector_size_mult ? 32 : sz_mb >
+ 8 * 1024 * sector_size_mult ? 16 : sz_mb > 260 * sector_size_mult ? 8 : 1;
}
if (info->geom_heads > 0) {

View File

@ -1,12 +1,10 @@
Name: dosfstools
Summary: Utilities for making and checking MS-DOS FAT filesystems on Linux
Version: 4.1
Release: 13%{?dist}
Version: 4.2
Release: 1%{?dist}
License: GPLv3+
Source0: http://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz
URL: http://github.com/dosfstools/dosfstools
# https://github.com/dosfstools/dosfstools/issues/111
Patch0: dosfstools-4.1-fix-cluster-size-auto-detect-for-4k-disks.patch
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
URL: https://github.com/dosfstools/dosfstools
BuildRequires: gcc
BuildRequires: make
@ -18,7 +16,6 @@ drives or on floppies.
%prep
%setup -q
%patch0 -p1 -b .fix-cluster-size-auto-detect-for-4k-disks
%build
%configure --enable-compat-symlinks
@ -27,14 +24,21 @@ drives or on floppies.
%install
%make_install PREFIX=%{_prefix}
# license file is in the licenses not in the doc
rm -f %{buildroot}%{_docdir}/%{name}/COPYING
%files
%license COPYING
%doc ChangeLog doc/*
%doc NEWS README ChangeLog doc/*
%{_sbindir}/*
%{_mandir}/man8/*
%changelog
* Mon Feb 1 2021 Jaroslav Škarvada <jskarvad@redhat.com> - 4.2-1
- New version
Resolves: rhbz#1922767
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (dosfstools-4.1.tar.xz) = e7a8aab34255d15e6865a7b031971352af1255134fab83389673bcc3cbd6ba255241bd2429070aeb4b927f8d7d73ccf1aeafe94566b133e88e7586897c317b78
SHA512 (dosfstools-4.2.tar.gz) = 3cc0808edb4432428df8a67da4bb314fd1f27adc4a05754c1a492091741a7b6875ebd9f6a509cc4c5ad85643fc40395b6e0cadee548b25cc439cc9b725980156