diff --git a/dosfstools-2.11-mkdosfs-geo0.diff b/dosfstools-2.11-mkdosfs-geo0.diff new file mode 100644 index 0000000..f037f2d --- /dev/null +++ b/dosfstools-2.11-mkdosfs-geo0.diff @@ -0,0 +1,35 @@ +the HDIO_GETGEO ioctl works on device mapper devices but returns +zero heads and sectors. Therefore let's a) assume dummy values in +that case in mkdosfs and b) don't consider such fat file systems as +invalid in dosfsck. The Linux kernel accepts them anyways. +Index: dosfstools-2.11/mkdosfs/mkdosfs.c +=================================================================== +--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c ++++ dosfstools-2.11/mkdosfs/mkdosfs.c +@@ -751,8 +751,8 @@ establish_params (int device_num,int siz + { + /* Can we get the drive geometry? (Note I'm not too sure about */ + /* whether to use HDIO_GETGEO or HDIO_REQ) */ +- if (ioctl (dev, HDIO_GETGEO, &geometry)) { +- printf ("unable to get drive geometry, using default 255/63"); ++ if (ioctl (dev, HDIO_GETGEO, &geometry) || geometry.sectors == 0 || geometry.heads == 0) { ++ printf ("unable to get drive geometry, using default 255/63\n"); + bs.secs_track = CT_LE_W(63); + bs.heads = CT_LE_W(255); + } +Index: dosfstools-2.11/dosfsck/boot.c +=================================================================== +--- dosfstools-2.11.orig/dosfsck/boot.c ++++ dosfstools-2.11/dosfsck/boot.c +@@ -353,9 +353,11 @@ void read_boot(DOS_FS *fs) + if (logical_sector_size & (SECTOR_SIZE-1)) + die("Logical sector size (%d bytes) is not a multiple of the physical " + "sector size.",logical_sector_size); ++#if 0 /* linux kernel doesn't check that either */ + /* ++roman: On Atari, these two fields are often left uninitialized */ + if (!atari_format && (!b.secs_track || !b.heads)) + die("Invalid disk format in boot sector."); ++#endif + if (verbose) dump_boot(fs,&b,logical_sector_size); + } + diff --git a/dosfstools-2.11-subfs.patch b/dosfstools-2.11-subfs.patch deleted file mode 100644 index 698e770..0000000 --- a/dosfstools-2.11-subfs.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- mkdosfs/mkdosfs.c -+++ mkdosfs/mkdosfs.c -@@ -592,11 +592,15 @@ - FILE *f; - struct mntent *mnt; - -- if ((f = setmntent (MOUNTED, "r")) == NULL) -- return; -+ if ((f = setmntent ("/proc/mounts", "r")) == NULL) -+ if ((f = setmntent (MOUNTED, "r")) == NULL) -+ return; - while ((mnt = getmntent (f)) != NULL) - if (strcmp (device_name, mnt->mnt_fsname) == 0) -- die ("%s contains a mounted file system."); -+ if (strcmp ("subfs", mnt->mnt_type) != 0) -+ die ("%s contains a mounted file system."); -+ else -+ printf("Device mounted using subfs, please do not access it while creating filesystem\n"); - endmntent (f); - } - diff --git a/dosfstools.changes b/dosfstools.changes index c302cd7..cf3465e 100644 --- a/dosfstools.changes +++ b/dosfstools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 26 12:14:35 CEST 2007 - lnussel@suse.de + +- remove obsolete subfs patch +- fix handling of zero heads and sectors + ------------------------------------------------------------------- Wed Apr 4 10:29:59 CEST 2007 - pgajdos@suse.cz diff --git a/dosfstools.spec b/dosfstools.spec index b5cb739..0ad8306 100644 --- a/dosfstools.spec +++ b/dosfstools.spec @@ -17,14 +17,14 @@ Group: System/Filesystems Autoreqprov: on Summary: Utilities for Making and Checking MS-DOS FAT File Systems on Linux Version: 2.11 -Release: 46 +Release: 51 URL: ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools Source: %{name}-%{version}.src.tar.bz2 Patch0: %{name}-%{version}-linuxfs.patch Patch1: %{name}-%{version}-unaligned.patch -Patch2: %{name}-%{version}-subfs.patch -Patch3: %{name}-%{version}-buffer.patch -Patch4: %{name}-%{version}-o_excl.patch +Patch2: %{name}-%{version}-buffer.patch +Patch3: %{name}-%{version}-o_excl.patch +Patch4: %{name}-%{version}-mkdosfs-geo0.diff Obsoletes: mkdosfs dosfsck dosfstls BuildRoot: %{_tmppath}/%{name}-%{version}-build Supplements: filesystem(vfat) @@ -48,7 +48,7 @@ Authors: %patch1 %patch2 %patch3 -%patch4 +%patch4 -p1 %build make OPTFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $RPM_OPT_FLAGS" @@ -89,6 +89,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/*.gz %changelog +* Thu Apr 26 2007 - lnussel@suse.de +- remove obsolete subfs patch +- fix handling of zero heads and sectors * Wed Apr 04 2007 - pgajdos@suse.cz - added Supplements: filesystem(vfat) line to spec file [fate#301966]