Accepting request 30899 from Base:System
Copy from Base:System/dosfstools based on submit request 30899 from user pgajdos OBS-URL: https://build.opensuse.org/request/show/30899 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dosfstools?expand=0&rev=11
This commit is contained in:
parent
676d1ab311
commit
eb4432cd5a
@ -1,11 +0,0 @@
|
||||
--- mkdosfs/mkdosfs.c
|
||||
+++ mkdosfs/mkdosfs.c
|
||||
@@ -809,7 +809,7 @@
|
||||
/* On Atari, the first few bytes of the boot sector are assigned
|
||||
* differently: The jump code is only 2 bytes (and m68k machine code
|
||||
* :-), then 6 bytes filler (ignored), then 3 byte serial number. */
|
||||
- strncpy( bs.system_id-1, "mkdosf", 6 );
|
||||
+ strncpy( bs.system_id, "mkdosf", 6);
|
||||
else
|
||||
strcpy (bs.system_id, "mkdosfs");
|
||||
if (sectors_per_cluster)
|
@ -1,13 +0,0 @@
|
||||
Index: mkdosfs/mkdosfs.c
|
||||
===================================================================
|
||||
--- mkdosfs/mkdosfs.c.orig
|
||||
+++ mkdosfs/mkdosfs.c
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <linux/hdreg.h>
|
||||
-#include <linux/fs.h>
|
||||
+#include <sys/mount.h>
|
||||
#include <linux/fd.h>
|
||||
#include <endian.h>
|
||||
#include <mntent.h>
|
@ -1,35 +0,0 @@
|
||||
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);
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
--- mkdosfs/mkdosfs.c
|
||||
+++ mkdosfs/mkdosfs.c
|
||||
@@ -1673,7 +1673,7 @@
|
||||
|
||||
if (!create) {
|
||||
check_mount (device_name); /* Is the device already mounted? */
|
||||
- dev = open (device_name, O_RDWR); /* Is it a suitable device to build the FS on? */
|
||||
+ dev = open (device_name, O_EXCL|O_RDWR); /* Is it a suitable device to build the FS on? */
|
||||
if (dev < 0)
|
||||
die ("unable to open %s");
|
||||
}
|
||||
@@ -1681,7 +1681,7 @@
|
||||
off_t offset = blocks*BLOCK_SIZE - 1;
|
||||
char null = 0;
|
||||
/* create the file */
|
||||
- dev = open( device_name, O_RDWR|O_CREAT|O_TRUNC, 0666 );
|
||||
+ dev = open( device_name, O_EXCL|O_RDWR|O_CREAT|O_TRUNC, 0666 );
|
||||
if (dev < 0)
|
||||
die("unable to create %s");
|
||||
/* seek to the intended end-1, and write one byte. this creates a
|
@ -1,145 +0,0 @@
|
||||
---
|
||||
dosfsck/boot.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 120 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/dosfsck/boot.c
|
||||
+++ b/dosfsck/boot.c
|
||||
@@ -34,18 +34,127 @@ static struct {
|
||||
{ 0xff, "5.25\" 320k floppy 2s/40tr/8sec" },
|
||||
};
|
||||
|
||||
-#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__
|
||||
-/* Unaligned fields must first be copied byte-wise */
|
||||
-#define GET_UNALIGNED_W(f) \
|
||||
- ({ \
|
||||
- unsigned short __v; \
|
||||
- memcpy( &__v, &f, sizeof(__v) ); \
|
||||
- CF_LE_W( *(unsigned short *)&f ); \
|
||||
- })
|
||||
-#else
|
||||
-#define GET_UNALIGNED_W(f) CF_LE_W( *(unsigned short *)&f )
|
||||
-#endif
|
||||
|
||||
+/*
|
||||
+ * For the benefit of those who are trying to port Linux to another
|
||||
+ * architecture, here are some C-language equivalents.
|
||||
+ *
|
||||
+ * This is based almost entirely upon Richard Henderson's
|
||||
+ * asm-alpha/unaligned.h implementation. Some comments were
|
||||
+ * taken from David Mosberger's asm-ia64/unaligned.h header.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
+/*
|
||||
+ * The main single-value unaligned transfer routines.
|
||||
+ */
|
||||
+#define get_unaligned(ptr) \
|
||||
+ __get_unaligned((ptr), sizeof(*(ptr)))
|
||||
+#define put_unaligned(x,ptr) \
|
||||
+ __put_unaligned((__u64)(x), (ptr), sizeof(*(ptr)))
|
||||
+
|
||||
+/*
|
||||
+ * This function doesn't actually exist. The idea is that when
|
||||
+ * someone uses the macros below with an unsupported size (datatype),
|
||||
+ * the linker will alert us to the problem via an unresolved reference
|
||||
+ * error.
|
||||
+ */
|
||||
+extern void bad_unaligned_access_length(void) __attribute__((noreturn));
|
||||
+
|
||||
+struct __una_u64 { __u64 x __attribute__((packed)); };
|
||||
+struct __una_u32 { __u32 x __attribute__((packed)); };
|
||||
+struct __una_u16 { __u16 x __attribute__((packed)); };
|
||||
+
|
||||
+/*
|
||||
+ * Elemental unaligned loads
|
||||
+ */
|
||||
+
|
||||
+static inline __u64 __uldq(const __u64 *addr)
|
||||
+{
|
||||
+ const struct __una_u64 *ptr = (const struct __una_u64 *) addr;
|
||||
+ return ptr->x;
|
||||
+}
|
||||
+
|
||||
+static inline __u32 __uldl(const __u32 *addr)
|
||||
+{
|
||||
+ const struct __una_u32 *ptr = (const struct __una_u32 *) addr;
|
||||
+ return ptr->x;
|
||||
+}
|
||||
+
|
||||
+static inline __u16 __uldw(const __u16 *addr)
|
||||
+{
|
||||
+ const struct __una_u16 *ptr = (const struct __una_u16 *) addr;
|
||||
+ return ptr->x;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Elemental unaligned stores
|
||||
+ */
|
||||
+
|
||||
+static inline void __ustq(__u64 val, __u64 *addr)
|
||||
+{
|
||||
+ struct __una_u64 *ptr = (struct __una_u64 *) addr;
|
||||
+ ptr->x = val;
|
||||
+}
|
||||
+
|
||||
+static inline void __ustl(__u32 val, __u32 *addr)
|
||||
+{
|
||||
+ struct __una_u32 *ptr = (struct __una_u32 *) addr;
|
||||
+ ptr->x = val;
|
||||
+}
|
||||
+
|
||||
+static inline void __ustw(__u16 val, __u16 *addr)
|
||||
+{
|
||||
+ struct __una_u16 *ptr = (struct __una_u16 *) addr;
|
||||
+ ptr->x = val;
|
||||
+}
|
||||
+
|
||||
+#define __get_unaligned(ptr, size) ({ \
|
||||
+ const void *__gu_p = ptr; \
|
||||
+ __u64 val; \
|
||||
+ switch (size) { \
|
||||
+ case 1: \
|
||||
+ val = *(const __u8 *)__gu_p; \
|
||||
+ break; \
|
||||
+ case 2: \
|
||||
+ val = __uldw(__gu_p); \
|
||||
+ break; \
|
||||
+ case 4: \
|
||||
+ val = __uldl(__gu_p); \
|
||||
+ break; \
|
||||
+ case 8: \
|
||||
+ val = __uldq(__gu_p); \
|
||||
+ break; \
|
||||
+ default: \
|
||||
+ bad_unaligned_access_length(); \
|
||||
+ }; \
|
||||
+ (__typeof__(*(ptr)))val; \
|
||||
+})
|
||||
+
|
||||
+#define __put_unaligned(val, ptr, size) \
|
||||
+do { \
|
||||
+ void *__gu_p = ptr; \
|
||||
+ switch (size) { \
|
||||
+ case 1: \
|
||||
+ *(__u8 *)__gu_p = val; \
|
||||
+ break; \
|
||||
+ case 2: \
|
||||
+ __ustw(val, __gu_p); \
|
||||
+ break; \
|
||||
+ case 4: \
|
||||
+ __ustl(val, __gu_p); \
|
||||
+ break; \
|
||||
+ case 8: \
|
||||
+ __ustq(val, __gu_p); \
|
||||
+ break; \
|
||||
+ default: \
|
||||
+ bad_unaligned_access_length(); \
|
||||
+ }; \
|
||||
+} while(0)
|
||||
+
|
||||
+
|
||||
+#define GET_UNALIGNED_W(f) CF_LE_W( get_unaligned ((unsigned short *)&f))
|
||||
|
||||
static char *get_media_descr( unsigned char media )
|
||||
{
|
@ -1,14 +0,0 @@
|
||||
--- mkdosfs/mkdosfs.c
|
||||
+++ mkdosfs/mkdosfs.c
|
||||
@@ -1731,6 +1731,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (sector_size > 4096)
|
||||
+ fprintf(stderr,
|
||||
+ "Warning: sector size is set to %d > 4096, such filesystem will not propably mount\n",
|
||||
+ sector_size);
|
||||
+
|
||||
establish_params (statbuf.st_rdev,statbuf.st_size);
|
||||
/* Establish the media parameters */
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0db13d3c863b35b8dc0fd378a61aa02b92a388c12433e7927eba5e5f9b3048aa
|
||||
size 55729
|
@ -1,35 +0,0 @@
|
||||
--- 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 */
|
||||
|
@ -1,3 +1,39 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 1 10:36:51 CET 2010 - pgajdos@suse.cz
|
||||
|
||||
- updated to 3.0.9:
|
||||
* A bug in aligning was fixed.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 25 13:13:32 CET 2010 - pgajdos@suse.cz
|
||||
|
||||
- new upstream
|
||||
http://freshmeat.net/projects/dosfstools
|
||||
- updated to 3.0.8
|
||||
- removed upstreamed/obsoleted patches
|
||||
* linuxfs.patch
|
||||
* buffer.patch
|
||||
* o_excl.patch
|
||||
* mkdosfs-geo0.diff
|
||||
* determine-sector-size.patch
|
||||
* unsupported-sector-size.patch
|
||||
* unaligned.patch
|
||||
- major changes:
|
||||
* aligning structures to cluster boundaries,
|
||||
64bit and crosscompile fixes
|
||||
* bugfix in dosfslabel, cleanups for FORTIFY_SOURCE
|
||||
* bugfix in dosfsck on big-endian systems,
|
||||
bugfix in dosfck cluster handling
|
||||
* bugfix and cleanup for VFAT patent avoidance
|
||||
kernel patch
|
||||
* compatible with VFAT patent avoidance kernel
|
||||
patch, bugfix in dosfsck repair mode
|
||||
* supporting limited-memory embedded systems
|
||||
* fixes rare dosfsck corruption
|
||||
* improves dosfsck cluster handling, fixes timing
|
||||
issues
|
||||
* merged patches from various distributions
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 3 19:09:13 UTC 2009 - coolo@novell.com
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package dosfstools (Version 2.11)
|
||||
# spec file for package dosfstools (Version 3.0.9)
|
||||
#
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -20,22 +20,14 @@
|
||||
|
||||
Name: dosfstools
|
||||
Provides: mkdosfs dosfsck
|
||||
License: GPL v2 or later
|
||||
License: GPLv3
|
||||
Group: System/Filesystems
|
||||
AutoReqProv: on
|
||||
Summary: Utilities for Making and Checking MS-DOS FAT File Systems on Linux
|
||||
Version: 2.11
|
||||
Release: 146
|
||||
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}-buffer.patch
|
||||
Patch3: %{name}-%{version}-o_excl.patch
|
||||
Patch4: %{name}-%{version}-mkdosfs-geo0.diff
|
||||
Patch5: %{name}-%{version}_determine-sector-size.patch
|
||||
Patch6: %{name}-%{version}-unsupported-sector-size.patch
|
||||
Obsoletes: mkdosfs dosfsck dosfstls
|
||||
Version: 3.0.9
|
||||
Release: 1
|
||||
Url: http://freshmeat.net/projects/dosfstools
|
||||
Source: %{name}_%{version}.orig.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Supplements: filesystem(vfat)
|
||||
|
||||
@ -54,13 +46,6 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup
|
||||
%patch0
|
||||
%patch1 -p1
|
||||
%patch2
|
||||
%patch3
|
||||
%patch4 -p1
|
||||
%patch5
|
||||
%patch6
|
||||
|
||||
%build
|
||||
make OPTFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $RPM_OPT_FLAGS"
|
||||
@ -69,27 +54,25 @@ make OPTFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $RPM_OPT_FLAGS"
|
||||
# directories
|
||||
install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man8}
|
||||
# binaries
|
||||
install -m755 mkdosfs/mkdosfs $RPM_BUILD_ROOT/sbin/
|
||||
install -m755 dosfsck/dosfsck $RPM_BUILD_ROOT/sbin/
|
||||
install -m755 mkdosfs $RPM_BUILD_ROOT/sbin/
|
||||
install -m755 dosfsck $RPM_BUILD_ROOT/sbin/
|
||||
# alternative names
|
||||
ln -sf mkdosfs $RPM_BUILD_ROOT/sbin/mkfs.msdos
|
||||
ln -sf dosfsck $RPM_BUILD_ROOT/sbin/fsck.msdos
|
||||
ln -sf mkdosfs $RPM_BUILD_ROOT/sbin/mkfs.vfat
|
||||
ln -sf dosfsck $RPM_BUILD_ROOT/sbin/fsck.vfat
|
||||
# man pages
|
||||
install -m 644 mkdosfs/mkdosfs.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
install -m 644 dosfsck/dosfsck.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
install -m 644 man/mkdosfs.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
install -m 644 man/dosfsck.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
install -m 644 man/dosfslabel.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
# man pages for alternative names
|
||||
ln -sf mkdosfs.8.gz $RPM_BUILD_ROOT%{_mandir}/man8/mkfs.msdos.8.gz
|
||||
ln -sf dosfsck.8.gz $RPM_BUILD_ROOT%{_mandir}/man8/fsck.msdos.8.gz
|
||||
ln -sf mkdosfs.8.gz $RPM_BUILD_ROOT%{_mandir}/man8/mkfs.vfat.8.gz
|
||||
ln -sf dosfsck.8.gz $RPM_BUILD_ROOT%{_mandir}/man8/fsck.vfat.8.gz
|
||||
# documentation
|
||||
install -m755 -d $RPM_BUILD_ROOT/%{_docdir}/%{name}/dosfsck
|
||||
install -m755 -d $RPM_BUILD_ROOT/%{_docdir}/%{name}/mkdosfs
|
||||
install -m644 CHANGES TODO README.Atari $RPM_BUILD_ROOT/%{_docdir}/%{name}/
|
||||
install -m644 dosfsck/{COPYING,README} $RPM_BUILD_ROOT/%{_docdir}/%{name}/dosfsck
|
||||
install -m644 mkdosfs/{COPYING,README} $RPM_BUILD_ROOT/%{_docdir}/%{name}/mkdosfs
|
||||
install -d $RPM_BUILD_ROOT/%{_docdir}/%{name}/
|
||||
install -m644 ChangeLog COPYING doc/* $RPM_BUILD_ROOT/%{_docdir}/%{name}/
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
3
dosfstools_3.0.9.orig.tar.bz2
Normal file
3
dosfstools_3.0.9.orig.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3f63676faeac507e909d84c8920ddb6597da1eb688577c2fc9c756b821d0458f
|
||||
size 69186
|
Loading…
Reference in New Issue
Block a user