From 937ef436e1633945ea7e5f62f6a3c489426555c9e62818241a7d675d734f145e Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 10 Sep 2007 22:41:41 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dosfstools?expand=0&rev=6 --- dosfstools-2.11_determine-sector-size.patch | 35 +++++++++++++++++++++ dosfstools.changes | 7 +++++ dosfstools.spec | 8 ++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 dosfstools-2.11_determine-sector-size.patch diff --git a/dosfstools-2.11_determine-sector-size.patch b/dosfstools-2.11_determine-sector-size.patch new file mode 100644 index 0000000..4dda797 --- /dev/null +++ b/dosfstools-2.11_determine-sector-size.patch @@ -0,0 +1,35 @@ +--- mkdosfs/mkdosfs.c ++++ mkdosfs/mkdosfs.c +@@ -1424,6 +1424,7 @@ + int i = 0, pos, ch; + int create = 0; + unsigned long long cblocks; ++ int min_sector_size; + + if (argc && *argv) { /* What's the program name? */ + char *p; +@@ -1712,6 +1713,24 @@ + ) + die ("Will not try to make filesystem on full-disk device '%s' (use -I if wanted)"); + ++ if (sector_size_set) ++ { ++ if (ioctl(dev, BLKSSZGET, &min_sector_size) >= 0) ++ if (sector_size < min_sector_size) ++ { ++ sector_size = min_sector_size; ++ fprintf(stderr, "Warning: sector size was set to %d (minimal for this device)\n", sector_size); ++ } ++ } ++ else ++ { ++ if (ioctl(dev, BLKSSZGET, &min_sector_size) >= 0) ++ { ++ sector_size = min_sector_size; ++ sector_size_set = 1; ++ } ++ } ++ + establish_params (statbuf.st_rdev,statbuf.st_size); + /* Establish the media parameters */ + diff --git a/dosfstools.changes b/dosfstools.changes index f7f0c34..82ea294 100644 --- a/dosfstools.changes +++ b/dosfstools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Sep 6 16:26:57 CEST 2007 - pgajdos@suse.cz + +- determine sector size of device automatically or if -S parameter + present, verify, that it's not under physical sector size + (determine-sector-size.patch) + ------------------------------------------------------------------- Thu Aug 9 17:08:41 CEST 2007 - olh@suse.de diff --git a/dosfstools.spec b/dosfstools.spec index 984d0e7..a022cbe 100644 --- a/dosfstools.spec +++ b/dosfstools.spec @@ -17,7 +17,7 @@ Group: System/Filesystems Autoreqprov: on Summary: Utilities for Making and Checking MS-DOS FAT File Systems on Linux Version: 2.11 -Release: 71 +Release: 78 URL: ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools Source: %{name}-%{version}.src.tar.bz2 Patch0: %{name}-%{version}-linuxfs.patch @@ -25,6 +25,7 @@ Patch1: %{name}-%{version}-unaligned.patch Patch2: %{name}-%{version}-buffer.patch Patch3: %{name}-%{version}-o_excl.patch Patch4: %{name}-%{version}-mkdosfs-geo0.diff +Patch5: %{name}-%{version}_determine-sector-size.patch Obsoletes: mkdosfs dosfsck dosfstls BuildRoot: %{_tmppath}/%{name}-%{version}-build Supplements: filesystem(vfat) @@ -49,6 +50,7 @@ Authors: %patch2 %patch3 %patch4 -p1 +%patch5 %build make OPTFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $RPM_OPT_FLAGS" @@ -89,6 +91,10 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/*.gz %changelog +* Thu Sep 06 2007 - pgajdos@suse.cz +- determine sector size of device automatically or if -S parameter + present, verify, that it's not under physical sector size + (determine-sector-size.patch) * Thu Aug 09 2007 - olh@suse.de - remove inclusion of asm/unaligned.h, use private copy of asm-generic/unaligned.h