[maemo-commits] [maemo-commits] r15113 - in projects/haf/trunk/dosfstools/debian: . patches

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jan 23 14:57:48 EET 2008
Author: kihamala
Date: 2008-01-23 14:57:48 +0200 (Wed, 23 Jan 2008)
New Revision: 15113

Added:
   projects/haf/trunk/dosfstools/debian/patches/00-dosfstools_2.11-2.3.diff
Modified:
   projects/haf/trunk/dosfstools/debian/changelog
Log:
added patches from Debian


Modified: projects/haf/trunk/dosfstools/debian/changelog
===================================================================
--- projects/haf/trunk/dosfstools/debian/changelog	2008-01-23 08:53:28 UTC (rev 15112)
+++ projects/haf/trunk/dosfstools/debian/changelog	2008-01-23 12:57:48 UTC (rev 15113)
@@ -1,3 +1,9 @@
+dosfstools (2.11-0osso7~unreleased) unstable; urgency=low
+
+  * Added patches from Debian. Fixes: NB#79621
+
+ -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Wed, 23 Jan 2008 14:37:27 +0200
+
 dosfstools (2.11-0osso6) unstable; urgency=low
 
   * Trying to fix compilation.

Added: projects/haf/trunk/dosfstools/debian/patches/00-dosfstools_2.11-2.3.diff
===================================================================
--- projects/haf/trunk/dosfstools/debian/patches/00-dosfstools_2.11-2.3.diff	2008-01-23 08:53:28 UTC (rev 15112)
+++ projects/haf/trunk/dosfstools/debian/patches/00-dosfstools_2.11-2.3.diff	2008-01-23 12:57:48 UTC (rev 15113)
@@ -0,0 +1,310 @@
+--- dosfstools-2.11.orig/dosfsck/check.c
++++ dosfstools-2.11/dosfsck/check.c
+@@ -305,14 +305,14 @@
+ static void auto_rename(DOS_FILE *file)
+ {
+     DOS_FILE *first,*walk;
+-    int number;
++    unsigned long int number;
+ 
+     if (!file->offset) return;	/* cannot rename FAT32 root dir */
+     first = file->parent ? file->parent->first : root;
+     number = 0;
+     while (1) {
+-	sprintf(file->dir_ent.name,"FSCK%04d",number);
+-	strncpy(file->dir_ent.ext,"REN",3);
++	sprintf(file->dir_ent.name, "FSCK%04d", number / 1000);
++	sprintf(file->dir_ent.name, "%03d", number % 1000);
+ 	for (walk = first; walk; walk = walk->next)
+ 	    if (walk != file && !strncmp(walk->dir_ent.name,file->dir_ent.
+ 	      name,MSDOS_NAME)) break;
+@@ -321,6 +321,9 @@
+ 	    return;
+ 	}
+ 	number++;
++	if (number > 9999999) {
++		die("Too many files need repair.");
++	}
+     }
+     die("Can't generate a unique name.");
+ }
+@@ -450,10 +453,10 @@
+ 	    break;
+ 	}
+ 	if (!(file->dir_ent.attr & ATTR_DIR) && CF_LE_L(file->dir_ent.size) <=
+-	  clusters*fs->cluster_size) {
+-	    printf("%s\n  File size is %u bytes, cluster chain length is > %lu "
++	  (unsigned long long)clusters*fs->cluster_size) {
++	    printf("%s\n  File size is %u bytes, cluster chain length is > %llu "
+ 	      "bytes.\n  Truncating file to %u bytes.\n",path_name(file),
+-	      CF_LE_L(file->dir_ent.size),clusters*fs->cluster_size,
++	      CF_LE_L(file->dir_ent.size),(unsigned long long)clusters*fs->cluster_size,
+ 	      CF_LE_L(file->dir_ent.size));
+ 	    truncate_file(fs,file,clusters);
+ 	    break;
+@@ -469,20 +472,20 @@
+ 		else clusters2++;
+ 	    restart = file->dir_ent.attr & ATTR_DIR;
+ 	    if (!owner->offset) {
+-		printf( "  Truncating second to %lu bytes because first "
+-			"is FAT32 root dir.\n", clusters2*fs->cluster_size );
++		printf( "  Truncating second to %llu bytes because first "
++			"is FAT32 root dir.\n", (unsigned long long)clusters2*fs->cluster_size );
+ 		do_trunc = 2;
+ 	    }
+ 	    else if (!file->offset) {
+-		printf( "  Truncating first to %lu bytes because second "
+-			"is FAT32 root dir.\n", clusters*fs->cluster_size );
++		printf( "  Truncating first to %llu bytes because second "
++			"is FAT32 root dir.\n", (unsigned long long)clusters*fs->cluster_size );
+ 		do_trunc = 1;
+ 	    }
+ 	    else if (interactive)
+-		printf("1) Truncate first to %lu bytes%s\n"
+-		  "2) Truncate second to %lu bytes\n",clusters*fs->cluster_size,
+-		  restart ? " and restart" : "",clusters2*fs->cluster_size);
+-	    else printf("  Truncating second to %lu bytes.\n",clusters2*
++		printf("1) Truncate first to %llu bytes%s\n"
++		  "2) Truncate second to %llu bytes\n",(unsigned long long)clusters*fs->cluster_size,
++		  restart ? " and restart" : "",(unsigned long long)clusters2*fs->cluster_size);
++	    else printf("  Truncating second to %llu bytes.\n",(unsigned long long)clusters2*
+ 		  fs->cluster_size);
+ 	    if (do_trunc != 2 &&
+ 		(do_trunc == 1 ||
+@@ -494,12 +497,13 @@
+ 		    if (this == curr) {
+ 			if (prev) set_fat(fs,prev,-1);
+ 			else MODIFY_START(owner,0,fs);
+-			MODIFY(owner,size,CT_LE_L(clusters*fs->cluster_size));
++			MODIFY(owner,size,CT_LE_L((unsigned long long)clusters*fs->cluster_size));
+ 			if (restart) return 1;
+ 			while (this > 0 && this != -1) {
+ 			    set_owner(fs,this,NULL);
+ 			    this = next_cluster(fs,this);
+ 			}
++			this = curr;
+ 			break;
+ 		    }
+ 		    clusters++;
+@@ -520,11 +524,11 @@
+ 	prev = curr;
+     }
+     if (!(file->dir_ent.attr & ATTR_DIR) && CF_LE_L(file->dir_ent.size) >
+-      clusters*fs->cluster_size) {
+-	printf("%s\n  File size is %u bytes, cluster chain length is %lu bytes."
++      (unsigned long long)clusters*fs->cluster_size) {
++	printf("%s\n  File size is %u bytes, cluster chain length is %llu bytes."
+ 	  "\n  Truncating file to %lu bytes.\n",path_name(file),CF_LE_L(file->
+-	  dir_ent.size),clusters*fs->cluster_size,clusters*fs->cluster_size);
+-	MODIFY(file,size,CT_LE_L(clusters*fs->cluster_size));
++	  dir_ent.size),(unsigned long long)clusters*fs->cluster_size,(unsigned long long)clusters*fs->cluster_size);
++	MODIFY(file,size,CT_LE_L((unsigned long long)clusters*fs->cluster_size));
+     }
+     return 0;
+ }
+--- dosfstools-2.11.orig/dosfsck/fat.c
++++ dosfstools-2.11/dosfsck/fat.c
+@@ -54,7 +54,7 @@
+     void *first,*second,*use;
+     int first_ok,second_ok;
+ 
+-    eff_size = ((fs->clusters+2)*fs->fat_bits+7)/8;
++    eff_size = ((fs->clusters+2ULL)*fs->fat_bits+7)/8ULL;
+     first = alloc(eff_size);
+     fs_read(fs->fat_start,eff_size,first);
+     use = first;
+@@ -97,7 +97,7 @@
+ 	    exit(1);
+ 	}
+     }
+-    fs->fat = qalloc(&mem_queue,sizeof(FAT_ENTRY)*(fs->clusters+2));
++    fs->fat = qalloc(&mem_queue,sizeof(FAT_ENTRY)*(fs->clusters+2ULL));
+     for (i = 2; i < fs->clusters+2; i++) get_fat(&fs->fat[i],use,i,fs);
+     for (i = 2; i < fs->clusters+2; i++)
+ 	if (fs->fat[i].value >= fs->clusters+2 &&
+@@ -177,7 +177,7 @@
+ 
+ loff_t cluster_start(DOS_FS *fs,unsigned long cluster)
+ {
+-    return fs->data_start+((loff_t)cluster-2)*fs->cluster_size;
++    return fs->data_start+((loff_t)cluster-2)*(unsigned long long)fs->cluster_size;
+ }
+ 
+ 
+@@ -225,8 +225,8 @@
+ 	    reclaimed++;
+ 	}
+     if (reclaimed)
+-	printf("Reclaimed %d unused cluster%s (%d bytes).\n",reclaimed,
+-	  reclaimed == 1 ?  "" : "s",reclaimed*fs->cluster_size);
++	printf("Reclaimed %d unused cluster%s (%llu bytes).\n",reclaimed,
++	  reclaimed == 1 ?  "" : "s",(unsigned long long)reclaimed*fs->cluster_size);
+ }
+ 
+ 
+@@ -305,8 +305,8 @@
+ 	    fs_write(offset,sizeof(DIR_ENT),&de);
+ 	}
+     if (reclaimed)
+-	printf("Reclaimed %d unused cluster%s (%d bytes) in %d chain%s.\n",
+-	  reclaimed,reclaimed == 1 ? "" : "s",reclaimed*fs->cluster_size,files,
++	printf("Reclaimed %d unused cluster%s (%llu bytes) in %d chain%s.\n",
++	  reclaimed,reclaimed == 1 ? "" : "s",(unsigned long long)reclaimed*fs->cluster_size,files,
+ 	  files == 1 ? "" : "s");
+ }
+ 
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.8
++++ dosfstools-2.11/mkdosfs/mkdosfs.8
+@@ -79,19 +79,19 @@
+ .I block-count
+ is the number of blocks on the device.  If omitted,
+ .B mkdosfs
+-automatically determiness the file system size.
++automatically determines the file system size.
+ .SH OPTIONS
+ .TP
+ .B \-A
+-Use Atari variation of the MS-DOS filesystem. This is default if
++Use Atari variation of the MS-DOS file system. This is default if
+ \fBmkdosfs\fP is run on an Atari, then this option turns off Atari
+ format. There are some differences when using Atari format: If not
+ directed otherwise by the user, \fBmkdosfs\fP will always use 2
+ sectors per cluster, since GEMDOS doesn't like other values very much.
+ It will also obey the maximum number of sectors GEMDOS can handle.
+-Larger filesystems are managed by raising the logical sector size.
++Larger file systems are managed by raising the logical sector size.
+ Under Atari format, an Atari-compatible serial number for the
+-filesystem is generated, and a 12 bit FAT is used only for filesystems
++file system is generated, and a 12 bit FAT is used only for file systems
+ that have one of the usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a
+ 16 bit FAT otherwise. This can be overridden with the \fB\-F\fP
+ option. Some PC-specific boot sector fields aren't written, and a boot
+@@ -126,7 +126,7 @@
+ .BI \-F " FAT-size"
+ Specifies the type of file allocation tables used (12, 16 or 32 bit).
+ If nothing is specified, \fBmkdosfs\fR will automatically select
+-between 12 and 16 bit, whatever fits better for the filesystem size.
++between 12 and 16 bit, whatever fits better for the file system size.
+ 32 bit FAT (FAT32 format) must (still) be selected explicitly if you
+ want it.
+ .TP
+@@ -137,17 +137,17 @@
+ \'0\' if no value is given on the command line.
+ .TP
+ .I \-i " volume-id"
+-Sets the volume ID of the newly created filesystem;
++Sets the volume ID of the newly created file system;
+ .I volume-id
+ is a 32-bit hexadecimal number (for example, 2e24ec82).  The default
+-is a number which depends on the filesystem creation time.
++is a number which depends on the file system creation time.
+ .TP
+ .B \-I
+ Normally you are not allowed to use any 'full' fixed disk devices.
+ .B mkdosfs
+ will complain and tell you that it refuses to work.  This is different
+-when usind MO disks.  One doesn't always need partitions on MO disks.
+-The filesytem can go directly to the whole disk.  Under other OSes
++when using MO disks.  One doesn't always need partitions on MO disks.
++The file system can go directly to the whole disk.  Under other OSes
+ this is known as the 'superfloppy' format.
+ 
+ This switch will force
+@@ -159,14 +159,14 @@
+ .IR filename .
+ .TP
+ .BI \-m " message-file"
+-Sets the message the user receives on attempts to boot this filesystem
++Sets the message the user receives on attempts to boot this file system
+ without having properly installed an operating system.  The message
+ file must not exceed 418 bytes once line feeds have been converted to
+ carriage return-line feed combinations, and tabs have been expanded.
+ If the filename is a hyphen (-), the text is taken from standard input. 
+ .TP
+ .BI \-n " volume-name"
+-Sets the volume name (label) of the filesystem.  The volume name can
++Sets the volume name (label) of the file system.  The volume name can
+ be up to 11 characters long.  The default is no label.
+ .TP
+ .BI \-r " root-dir-entries"
+@@ -174,7 +174,7 @@
+ default is 112 or 224 for floppies and 512 for hard disks.
+ .TP
+ .BI \-R " number-of-reserved-sectors "
+-Select the number of reserved sectos. With FAT32 format at least 2
++Select the number of reserved sectors. With FAT32 format at least 2
+ reserved sectors are needed, the default is 32. Otherwise the default
+ is 1 (only the boot sector).
+ .TP
+@@ -191,7 +191,7 @@
+ Verbose execution.
+ .SH BUGS
+ .B mkdosfs
+-can not create bootable filesystems. This isn't as easy as you might
++can not create boot-able file systems. This isn't as easy as you might
+ think at first glance for various reasons and has been discussed a lot
+ already.
+ .B mkdosfs
+--- dosfstools-2.11.orig/debian/README.Atari
++++ dosfstools-2.11/debian/README.Atari
+@@ -0,0 +1,60 @@
++
++Atari format support
++====================
++
++Both mkdosfs and dosfsck now can also handle the Atari variation of
++the MS-DOS filesystem format. The Atari format has some minor
++differences, some caused by the different machine architecture (m68k),
++some being "historic" (Atari didn't change some things that M$
++changed).
++
++Both tools automatically select Atari format if they run on an Atari.
++Additionally the -A switch toggles between Atari and MS-DOS format.
++I.e., on an Atari it selects plain DOS format, on any other machine it
++switches to Atari format.
++
++The differences are in detail:
++
++ - Atari TOS doesn't like cluster sizes != 2, so the usual solution
++   for bigger partitions was to increase the logical sector size. So
++   mkdosfs can handle sector sizes != 512 now, you can also manually
++   select it with the -S option. On filesystems larger than approx. 32
++   MB, the sector size is automatically increased (stead of the
++   cluster size) to make the filesystem fit. mkdosfs will always use 2
++   sectors per cluster (also with the floppy standard configurations),
++   except when directed otherwise on the command line.
++
++ - From the docs, all values between 0xfff8 and 0xffff in the FAT mark
++   an end-of-file. However, DOS usually uses 0xfff8 and Atari 0xffff.
++   This seems to be only an consmetic difference. At least TOS doesn't
++   complain about 0xffff EOF marks. Don't know what DOS thinks of
++   0xfff8 :-) Anyway, both tools use the EOF mark common to the
++   system (DOS/Atari).
++
++ - Something similar of the bad cluster marks: On Atari the FAT values
++   0xfff0 to 0xfff7 are used for this, under DOS only 0xfff7 (the
++   others can be normal cluster numbers, allowing 7 more clusters :-)
++   However, both systems usually mark with 0xfff7. Just dosfsck has to
++   interpret 0xfff0...0xfff7 differently.
++
++ - Some fields in the boot sector are interpreted differently. For
++   example, Atari has a disk serial number (used to aid disk change
++   detection) where DOS stores the system name; the 'hidden' field is
++   32 bit for DOS, but 16 bit for Atari, and there's no 'total_sect'
++   field; the 12/16 bit FAT decision is different: it's not based on
++   the number of clusters, but always FAT12 on floppies and FAT16 on
++   hard disks. mkdosfs nows about these differences and constructs the
++   boot sector accordingly.
++
++ - In dosfsck, the boot sector differences also have to known, to not
++   warn about things that are no error on Atari. In addition, most
++   Atari formatting tools fill the 'tracks' and 'heads' fields with 0
++   for hard disks, because they're meaningless on SCSI disks (Atari
++   has/had no IDE). Due to this, the check that they should be
++   non-zero is switched off.
++
++ - Under Atari TOS, some other characters are illegal in filenames:
++   '<', '>', '|', '"', and ':' are allowed, but all non-ASCII chars
++   (codes >= 128) are forbidden.
++
++- Roman <Roman.Hodek at informatik.uni-erlangen.de>


More information about the maemo-commits mailing list