Compare commits

...

No commits in common. "c8s" and "c9" have entirely different histories.
c8s ... c9

4 changed files with 50 additions and 44 deletions

View File

@ -1 +1 @@
814e2d5842c62e328dfc8947178a0a4e45a1c028 SOURCES/dosfstools-4.1.tar.xz
14efc68c64987a9067b6a919ad2870007247686b SOURCES/dosfstools-4.2.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/dosfstools-4.1.tar.xz
SOURCES/dosfstools-4.2.tar.gz

View File

@ -1,30 +0,0 @@
diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
index a7609b0..26ce3fd 100644
--- a/src/mkfs.fat.c
+++ b/src/mkfs.fat.c
@@ -517,6 +517,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) {
@@ -590,11 +591,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,13 @@
Name: dosfstools
Summary: Utilities for making and checking MS-DOS FAT filesystems on Linux
Version: 4.1
Release: 6%{?dist}
Version: 4.2
Release: 3%{?dist}
License: GPLv3+
Group: Applications/System
Source0: http://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz
URL: http://github.com/dosfstools/dosfstools
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
%description
The dosfstools package includes the mkdosfs and dosfsck utilities,
@ -15,25 +16,60 @@ drives or on floppies.
%prep
%setup -q
%patch0 -p1 -b .fix-cluster-size-auto-detect-for-4k-disks
%build
%configure --enable-compat-symlinks
make %{?_smp_mflags} CFLAGS="%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
%make_build CFLAGS="%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
%install
make DESTDIR=%{buildroot} install PREFIX=%{_prefix}
%make_install PREFIX=%{_prefix}
# license file is in the licenses not in the doc
rm -f %{buildroot}%{_docdir}/%{name}/COPYING
%files
%doc ChangeLog COPYING doc/*
%license COPYING
%doc NEWS README ChangeLog doc/*
%{_sbindir}/*
%{_mandir}/man8/*
%changelog
* Fri Feb 22 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 4.1-6
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 4.2-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 4.2-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* 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
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 4.1-11
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 9 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 4.1-7
- Fixed mkfs.fat cluster size calculation for disks with 4k sectors
Resolves: rhbz#1651496
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild