From 6c8c8532dcbaeeadba7cd96d1ed25bb858401111 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 30 Sep 2008 14:55:52 +0000 Subject: [PATCH] update to 3.0.0 --- .cvsignore | 2 +- dosfstools-2.11-assumeKernel26.patch | 67 ------ dosfstools-2.11-fortify.patch | 15 -- dosfstools-2.11-label.patch | 298 --------------------------- dosfstools-2.7-argfix.patch | 16 -- dosfstools.spec | 44 +--- sources | 2 +- 7 files changed, 13 insertions(+), 431 deletions(-) delete mode 100644 dosfstools-2.11-assumeKernel26.patch delete mode 100644 dosfstools-2.11-fortify.patch delete mode 100644 dosfstools-2.11-label.patch delete mode 100644 dosfstools-2.7-argfix.patch diff --git a/.cvsignore b/.cvsignore index 8168551..8738f09 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -dosfstools-2.11.src.tar.gz +dosfstools-3.0.0.tar.bz2 diff --git a/dosfstools-2.11-assumeKernel26.patch b/dosfstools-2.11-assumeKernel26.patch deleted file mode 100644 index f865d34..0000000 --- a/dosfstools-2.11-assumeKernel26.patch +++ /dev/null @@ -1,67 +0,0 @@ -/* - * LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) does not work with glibc-kernheaders-2.4-9.1.94 - * pvrabec@redhat.com - */ - ---- dosfstools-2.11/dosfsck/common.h.assumeKernel26 2005-10-12 10:49:47.000000000 -0400 -+++ dosfstools-2.11/dosfsck/common.h 2005-10-12 10:51:34.000000000 -0400 -@@ -2,13 +2,8 @@ - - /* Written 1993 by Werner Almesberger */ - --#include --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) --# define __KERNEL__ - # include --# undef __KERNEL__ - # define MSDOS_FAT12 4084 /* maximum number of clusters in a 12 bit FAT */ --#endif - - #ifndef _COMMON_H - #define _COMMON_H ---- dosfstools-2.11/dosfsck/file.c.assumeKernel26 2005-10-12 10:49:24.000000000 -0400 -+++ dosfstools-2.11/dosfsck/file.c 2005-10-12 10:50:52.000000000 -0400 -@@ -16,12 +16,7 @@ - #define _LINUX_STRING_H_ /* hack to avoid inclusion of */ - #define _LINUX_FS_H /* hack to avoid inclusion of */ - --#include --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) --# define __KERNEL__ - # include --# undef __KERNEL__ --#endif - - #include - ---- dosfstools-2.11/dosfsck/dosfsck.h.assumeKernel26 2005-10-12 10:50:02.000000000 -0400 -+++ dosfstools-2.11/dosfsck/dosfsck.h 2005-10-12 10:51:52.000000000 -0400 -@@ -14,13 +14,8 @@ - #define _LINUX_STRING_H_ /* hack to avoid inclusion of */ - #define _LINUX_FS_H /* hack to avoid inclusion of */ - --#include --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) --# define __KERNEL__ - # include - # include --# undef __KERNEL__ --#endif - - #include - ---- dosfstools-2.11/mkdosfs/mkdosfs.c.assumeKernel26 2005-10-12 10:50:12.000000000 -0400 -+++ dosfstools-2.11/mkdosfs/mkdosfs.c 2005-10-12 10:52:30.000000000 -0400 -@@ -66,12 +66,7 @@ - #include - #include - --#include --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) --# define __KERNEL__ - # include --# undef __KERNEL__ --#endif - - #if __BYTE_ORDER == __BIG_ENDIAN - diff --git a/dosfstools-2.11-fortify.patch b/dosfstools-2.11-fortify.patch deleted file mode 100644 index 90535ab..0000000 --- a/dosfstools-2.11-fortify.patch +++ /dev/null @@ -1,15 +0,0 @@ -This violates -D_FORTIFY_SOURCE=2 (which is stricter than C standard), -but isn't actually any buffer overflow. -But using memcpy is more efficient anyway. - ---- dosfstools-2.11/mkdosfs/mkdosfs.c.jj 2005-12-18 14:49:16.000000000 -0500 -+++ dosfstools-2.11/mkdosfs/mkdosfs.c 2005-12-18 14:49:16.000000000 -0500 -@@ -805,7 +805,7 @@ setup_tables (void) - /* 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 ); -+ memcpy( bs.system_id-1, "mkdosf", 6 ); - else - strcpy (bs.system_id, "mkdosfs"); - if (sectors_per_cluster) diff --git a/dosfstools-2.11-label.patch b/dosfstools-2.11-label.patch deleted file mode 100644 index 344d4ba..0000000 --- a/dosfstools-2.11-label.patch +++ /dev/null @@ -1,298 +0,0 @@ ---- dosfstools-2.11/dosfsck/Makefile.label 1999-07-06 10:23:11.000000000 -0400 -+++ dosfstools-2.11/dosfsck/Makefile 2007-01-11 16:33:54.000000000 -0500 -@@ -1,9 +1,12 @@ - --OBJECTS = boot.o check.o common.o dosfsck.o fat.o file.o io.o lfn.o -+OBJECTS = boot.o check.o common.o fat.o file.o io.o lfn.o - --all: dosfsck -+all: dosfsck dosfslabel - --dosfsck: $(OBJECTS) -+dosfsck: $(OBJECTS) dosfsck.o -+ $(CC) -o $@ $(LDFLAGS) $^ -+ -+dosfslabel : $(OBJECTS) dosfslabel.o - $(CC) -o $@ $(LDFLAGS) $^ - - .c.o: -@@ -15,8 +18,10 @@ - install -m 644 dosfsck.8 $(MANDIR) - rm -f $(SBINDIR)/fsck.msdos - rm -f $(SBINDIR)/fsck.vfat -+ rm -f $(SBINDIR)/dosfslabel - ln -s dosfsck $(SBINDIR)/fsck.msdos - ln -s dosfsck $(SBINDIR)/fsck.vfat -+ ln -s dosfslabel $(SBINDIR)/dosfslabel - rm -f $(MANDIR)/fsck.msdos.8 - ln -s dosfsck.8 $(MANDIR)/fsck.msdos.8 - ln -s dosfsck.8 $(MANDIR)/fsck.vfat.8 -@@ -25,7 +30,7 @@ - rm -f *.o *.s *.i *~ \#*# tmp_make .#* .new* - - distclean: clean -- rm -f *.a dosfsck -+ rm -f *.a dosfsck dosfslabel - - dep: - sed '/\#\#\# Dependencies/q' tmp_make -@@ -38,6 +43,7 @@ - common.o: common.c common.h - dosfsck.o: dosfsck.c common.h dosfsck.h io.h boot.h fat.h file.h \ - check.h -+dosfslabel.o: dosfslabel.c common.h dosfsck.h io.h boot.h fat.h file.h check.h - fat.o: fat.c common.h dosfsck.h io.h check.h fat.h - file.o: file.c common.h file.h - io.o: io.c dosfsck.h common.h io.h ---- dosfstools-2.11/dosfsck/dosfsck.h.label 2007-01-11 16:33:54.000000000 -0500 -+++ dosfstools-2.11/dosfsck/dosfsck.h 2007-01-11 16:33:54.000000000 -0500 -@@ -65,10 +65,47 @@ - __u32 root_cluster; /* first cluster in root directory */ - __u16 info_sector; /* filesystem info sector */ - __u16 backup_boot; /* backup boot sector */ -- __u16 reserved2[6]; /* Unused */ -+ __u8 reserved2[12]; /* Unused */ -+ -+ __u8 drive_number; /* Logical Drive Number */ -+ __u8 reserved3; /* Unused */ -+ -+ __u8 extended_sig; /* Extended Signature (0x29) */ -+ __u32 serial; /* Serial number */ -+ __u8 label[11]; /* FS label */ -+ __u8 fs_type[8]; /* FS Type */ -+ -+ /* fill up to 512 bytes */ -+ __u8 junk[422]; -+} __attribute__ ((packed)); -+ -+struct boot_sector_16 { -+ __u8 ignored[3]; /* Boot strap short or near jump */ -+ __u8 system_id[8]; /* Name - can be used to special case -+ partition manager volumes */ -+ __u8 sector_size[2]; /* bytes per logical sector */ -+ __u8 cluster_size; /* sectors/cluster */ -+ __u16 reserved; /* reserved sectors */ -+ __u8 fats; /* number of FATs */ -+ __u8 dir_entries[2]; /* root directory entries */ -+ __u8 sectors[2]; /* number of sectors */ -+ __u8 media; /* media code (unused) */ -+ __u16 fat_length; /* sectors/FAT */ -+ __u16 secs_track; /* sectors per track */ -+ __u16 heads; /* number of heads */ -+ __u32 hidden; /* hidden sectors (unused) */ -+ __u32 total_sect; /* number of sectors (if sectors == 0) */ -+ -+ __u8 drive_number; /* Logical Drive Number */ -+ __u8 reserved2; /* Unused */ -+ -+ __u8 extended_sig; /* Extended Signature (0x29) */ -+ __u32 serial; /* Serial number */ -+ __u8 label[11]; /* FS label */ -+ __u8 fs_type[8]; /* FS Type */ - - /* fill up to 512 bytes */ -- __u8 junk[448]; -+ __u8 junk[450]; - } __attribute__ ((packed)); - - struct info_sector { -@@ -128,6 +165,7 @@ - long free_clusters; - loff_t backupboot_start; /* 0 if not present */ - FAT_ENTRY *fat; -+ char *label; - } DOS_FS; - - #ifndef offsetof ---- /dev/null 2006-12-18 18:52:37.519428789 -0500 -+++ dosfstools-2.11/dosfsck/dosfslabel.c 2007-01-11 16:35:00.000000000 -0500 -@@ -0,0 +1,110 @@ -+/* dosfslabel.c - User interface */ -+ -+/* Copyright 2007 Red Hat, Inc. -+ * Portions copyright 1998 Roman Hodek. -+ * Portions copyright 1993 Werner Almesberger. -+ */ -+ -+#include "../version.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "common.h" -+#include "dosfsck.h" -+#include "io.h" -+#include "boot.h" -+#include "fat.h" -+#include "file.h" -+#include "check.h" -+ -+ -+int interactive = 0,list = 0,test = 0,verbose = 0,write_immed = 0; -+int atari_format = 0; -+unsigned n_files = 0; -+void *mem_queue = NULL; -+ -+ -+static void usage(int error) -+{ -+ FILE *f = error ? stderr : stdout; -+ int status = error ? 1 : 0; -+ -+ fprintf(f,"usage: dosfslabel device [label]\n"); -+ exit(status); -+} -+ -+/* -+ * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant -+ * of MS-DOS filesystem by default. -+ */ -+static void check_atari( void ) -+{ -+#ifdef __mc68000__ -+ FILE *f; -+ char line[128], *p; -+ -+ if (!(f = fopen( "/proc/hardware", "r" ))) { -+ perror( "/proc/hardware" ); -+ return; -+ } -+ -+ while( fgets( line, sizeof(line), f ) ) { -+ if (strncmp( line, "Model:", 6 ) == 0) { -+ p = line + 6; -+ p += strspn( p, " \t" ); -+ if (strncmp( p, "Atari ", 6 ) == 0) -+ atari_format = 1; -+ break; -+ } -+ } -+ fclose( f ); -+#endif -+} -+ -+ -+int main(int argc, char *argv[]) -+{ -+ DOS_FS fs; -+ int rw = 0; -+ -+ char *device = NULL; -+ char *label = NULL; -+ -+ check_atari(); -+ -+ if (argc < 2 || argc > 3) -+ usage(1); -+ -+ if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) -+ usage(0); -+ else if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) { -+ printf( "dosfslabel " VERSION ", " VERSION_DATE ", FAT32, LFN\n" ); -+ exit(0); -+ } -+ -+ device = argv[1]; -+ if (argc == 3) { -+ label = argv[2]; -+ if (strlen(label) > 11) { -+ fprintf(stderr, -+ "dosfslabel: labels can be no longer than 11 characters\n"); -+ exit(1); -+ } -+ rw = 1; -+ } -+ -+ fs_open(device, rw); -+ read_boot(&fs); -+ if (!rw) { -+ fprintf(stdout, "%s\n", fs.label); -+ exit(0); -+ } -+ -+ write_label(&fs, label); -+ return fs_close(rw) ? 1 : 0; -+} ---- dosfstools-2.11/dosfsck/boot.h.label 1997-06-18 06:09:38.000000000 -0400 -+++ dosfstools-2.11/dosfsck/boot.h 2007-01-11 16:33:54.000000000 -0500 -@@ -7,6 +7,7 @@ - #define _BOOT_H - - void read_boot(DOS_FS *fs); -+void write_label(DOS_FS *fs, char *label); - - /* Reads the boot sector from the currently open device and initializes *FS */ - ---- dosfstools-2.11/dosfsck/boot.c.label 2005-03-12 09:16:22.000000000 -0500 -+++ dosfstools-2.11/dosfsck/boot.c 2007-01-11 16:33:54.000000000 -0500 -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - - #include "common.h" - #include "dosfsck.h" -@@ -348,6 +349,21 @@ - /* On FAT32, the high 4 bits of a FAT entry are reserved */ - fs->eff_fat_bits = (fs->fat_bits == 32) ? 28 : fs->fat_bits; - fs->fat_size = fat_length*logical_sector_size; -+ -+ fs->label = calloc(12, sizeof (__u8)); -+ if (fs->fat_bits == 12 || fs->fat_bits == 16) { -+ struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b; -+ if (b16->extended_sig == 0x29) -+ memmove(fs->label, b16->label, 11); -+ else -+ fs->label = NULL; -+ } else if (fs->fat_bits == 32) { -+ if (b.extended_sig == 0x29) -+ memmove(fs->label, &b.label, 11); -+ else -+ fs->label = NULL; -+ } -+ - if (fs->clusters > ((unsigned long long)fs->fat_size*8/fs->fat_bits)-2) - die("File system has %d clusters but only space for %d FAT entries.", - fs->clusters,((unsigned long long)fs->fat_size*8/fs->fat_bits)-2); -@@ -365,6 +381,36 @@ - if (verbose) dump_boot(fs,&b,logical_sector_size); - } - -+void write_label(DOS_FS *fs, char *label) -+{ -+ struct boot_sector b; -+ struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b; -+ int l = strlen(label); -+ -+ while (l < 11) -+ label[l++] = ' '; -+ -+ fs_read(0, sizeof(b), &b); -+ if (fs->fat_bits == 12 || fs->fat_bits == 16) { -+ if (b16->extended_sig != 0x29) { -+ b16->extended_sig = 0x29; -+ b16->serial = 0; -+ memmove(b16->fs_type, fs->fat_bits == 12 ?"FAT12 ":"FAT16 ", 8); -+ } -+ memmove(b16->label, label, 11); -+ } else if (fs->fat_bits == 32) { -+ if (b.extended_sig != 0x29) { -+ b.extended_sig = 0x29; -+ b.serial = 0; -+ memmove(b.fs_type, "FAT32 ", 8); -+ } -+ memmove(b.label, label, 11); -+ } -+ fs_write(0, sizeof(b), &b); -+ if (fs->fat_bits == 32 && fs->backupboot_start) -+ fs_write(fs->backupboot_start, sizeof(b), &b); -+} -+ - /* Local Variables: */ - /* tab-width: 8 */ - /* End: */ diff --git a/dosfstools-2.7-argfix.patch b/dosfstools-2.7-argfix.patch deleted file mode 100644 index 5825fc8..0000000 --- a/dosfstools-2.7-argfix.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up dosfstools-2.11/mkdosfs/mkdosfs.c.argfix dosfstools-2.11/mkdosfs/mkdosfs.c ---- dosfstools-2.11/mkdosfs/mkdosfs.c.argfix 2005-03-12 11:12:16.000000000 -0500 -+++ dosfstools-2.11/mkdosfs/mkdosfs.c 2008-07-16 17:26:49.000000000 -0400 -@@ -1634,6 +1634,12 @@ main (int argc, char **argv) - if (optind < argc) - { - device_name = argv[optind]; /* Determine the number of blocks in the FS */ -+ -+ if (!device_name) { -+ printf("No device specified.\n"); -+ usage(); -+ } -+ - if (!create) - cblocks = count_blocks (device_name); /* Have a look and see! */ - } diff --git a/dosfstools.spec b/dosfstools.spec index 1efcfa5..ebb1f18 100644 --- a/dosfstools.spec +++ b/dosfstools.spec @@ -1,15 +1,11 @@ Name: dosfstools Summary: Utilities for making and checking MS-DOS FAT filesystems on Linux -Version: 2.11 -Release: 10%{?dist} -License: GPLv2+ +Version: 3.0.0 +Release: 1%{?dist} +License: GPLv3+ Group: Applications/System -Source: ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-%{version}.src.tar.gz -URL: ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools -Patch1: dosfstools-2.7-argfix.patch -Patch2: dosfstools-2.11-assumeKernel26.patch -Patch4: dosfstools-2.11-fortify.patch -Patch5: dosfstools-2.11-label.patch +Source: http://www.daniel-baumann.ch/software/dosfstools/%{name}-%{version}.tar.bz2 +URL: http://www.daniel-baumann.ch/software/dosfstools/ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Obsoletes: mkdosfs-ygg Provides: mkdosfs-ygg = %{version} @@ -21,45 +17,27 @@ drives or on floppies. %prep %setup -q -%patch1 -p1 -b .argfix -%patch2 -p1 -b .assumeKernel26 -%patch4 -p1 -b .fortify -%patch5 -p1 -b .label %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" %install rm -rf %{buildroot} -mkdir -p %{buildroot}/sbin -mkdir -p %{buildroot}/%{_mandir}/man8 - -install -m755 mkdosfs/mkdosfs %{buildroot}/sbin/mkdosfs -ln %{buildroot}/sbin/mkdosfs %{buildroot}/sbin/mkfs.vfat -ln %{buildroot}/sbin/mkdosfs %{buildroot}/sbin/mkfs.msdos - -install -m755 dosfsck/dosfsck %{buildroot}/sbin/dosfsck -ln %{buildroot}/sbin/dosfsck %{buildroot}/sbin/fsck.msdos -ln %{buildroot}/sbin/dosfsck %{buildroot}/sbin/fsck.vfat - -install -m 644 mkdosfs/mkdosfs.8 %{buildroot}%{_mandir}/man8 -ln -sf mkdosfs.8.gz %{buildroot}%{_mandir}/man8/mkfs.msdos.8.gz -ln -sf mkdosfs.8.gz %{buildroot}%{_mandir}/man8/mkfs.vfat.8.gz - -install -m 644 dosfsck/dosfsck.8 %{buildroot}%{_mandir}/man8 -ln -sf dosfsck.8.gz %{buildroot}%{_mandir}/man8/fsck.vfat.8.gz - -install -m755 dosfsck/dosfslabel %{buildroot}/sbin/dosfslabel +make DESTDIR=%{buildroot} install PREFIX=%{_prefix} SBINDIR=/sbin %clean rm -rf %{buildroot} %files -%defattr(-,root,root) +%defattr(-,root,root,-) +%doc %{_datadir}/doc/%{name}/ /sbin/* %{_mandir}/man8/* %changelog +* Tue Sep 30 2008 Tom "spot" Callaway - 3.0.0-1 +- update to 3.0.0 + * Wed Jul 16 2008 Tom "spot" Callaway - 2.11-10 - fix license tag - fix patch to apply with fuzz=0 diff --git a/sources b/sources index e026088..1bb4153 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -407d405ade410f7597d364ab5dc8c9f6 dosfstools-2.11.src.tar.gz +659687063b60efa1bde1463eb2ffa695 dosfstools-3.0.0.tar.bz2