Accepting request 158252 from Base:System

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/158252
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dosfstools?expand=0&rev=32
This commit is contained in:
Stephan Kulow 2013-03-12 10:07:23 +00:00 committed by Git OBS Bridge
commit 687e8b5ba2
9 changed files with 56 additions and 254 deletions

View File

@ -1,16 +0,0 @@
Index: dosfstools-3.0.10/src/check.c
===================================================================
--- dosfstools-3.0.10.orig/src/check.c
+++ dosfstools-3.0.10/src/check.c
@@ -174,7 +174,10 @@ loff_t alloc_rootdir_entry(DOS_FS *fs, D
offset = fs->root_start+next_free*sizeof(DIR_ENT);
memset(de,0,sizeof(DIR_ENT));
while (1) {
- sprintf(de->name,pattern,curr_num);
+ char expanded[12];
+ sprintf(expanded, pattern, curr_num);
+ memcpy(de->name, expanded, 8);
+ memcpy(de->ext, expanded+8, 3);
for (scan = 0; scan < fs->root_entries; scan++)
if (scan != next_free &&
!strncmp(root[scan].name,de->name,MSDOS_NAME))

View File

@ -1,189 +0,0 @@
Index: dosfstools-3.0.10/src/dosfslabel.c
===================================================================
--- dosfstools-3.0.10.orig/src/dosfslabel.c
+++ dosfstools-3.0.10/src/dosfslabel.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
+#include <ctype.h>
#include "common.h"
#include "dosfsck.h"
@@ -89,7 +90,14 @@ int main(int argc, char *argv[])
rw = 0;
char *device = NULL;
- char *label = NULL;
+ char label[11];
+
+ int i;
+
+ loff_t offset;
+ DIR_ENT de;
+
+ memset(&fs, 0, sizeof(fs));
check_atari();
@@ -105,19 +113,31 @@ int main(int argc, char *argv[])
device = argv[1];
if (argc == 3) {
- label = argv[2];
- if (strlen(label) > 11) {
+ if (strlen(argv[2]) > 11) {
fprintf(stderr,
"dosfslabel: labels can be no longer than 11 characters\n");
exit(1);
}
+ strncpy(label, argv[2], 11);
+ for (i = 0; i < 11; i++)
+ if (islower(label[i]))
+ {
+ fprintf(stderr,
+ "dosfslabel: labels cannot contain lower case characters\n");
+ exit(1);
+ }
rw = 1;
}
fs_open(device, rw);
read_boot(&fs);
+ read_fat(&fs);
if (!rw) {
- fprintf(stdout, "%s\n", fs.label);
+ offset = find_volume_de(&fs, &de);
+ if (offset == 0)
+ fprintf(stdout, "%s\n", fs.label);
+ else
+ fprintf(stdout, "%.8s%.3s\n", de.name, de.ext);
exit(0);
}
Index: dosfstools-3.0.10/src/mkdosfs.c
===================================================================
--- dosfstools-3.0.10.orig/src/mkdosfs.c
+++ dosfstools-3.0.10/src/mkdosfs.c
@@ -105,6 +105,7 @@
#define HARD_SECTOR_SIZE 512
#define SECTORS_PER_BLOCK ( BLOCK_SIZE / HARD_SECTOR_SIZE )
+#define NO_NAME "NO NAME "
/* Macro definitions */
@@ -285,7 +286,7 @@ static int verbose = 0; /* Default to v
static long volume_id; /* Volume ID number */
static time_t create_time; /* Creation time */
static struct timeval create_timeval; /* Creation time */
-static char volume_name[] = " "; /* Volume name */
+static char volume_name[] = NO_NAME; /* Volume name */
static unsigned long long blocks; /* Number of blocks in filesystem */
static int sector_size = 512; /* Size of a logical sector */
static int sector_size_set = 0; /* User selected sector size */
@@ -1248,7 +1249,7 @@ setup_tables (void)
}
printf ("Volume ID is %08lx, ", volume_id &
(atari_format ? 0x00ffffff : 0xffffffff));
- if ( strcmp(volume_name, " ") )
+ if ( strcmp(volume_name, NO_NAME) )
printf("volume label %s.\n", volume_name);
else
printf("no volume label.\n");
@@ -1287,7 +1288,7 @@ setup_tables (void)
}
memset(root_dir, 0, size_root_dir);
- if ( memcmp(volume_name, " ", 11) )
+ if ( memcmp(volume_name, NO_NAME, 11) )
{
struct msdos_dir_entry *de = &root_dir[0];
memcpy(de->name, volume_name, 8);
@@ -1630,6 +1631,8 @@ main (int argc, char **argv)
case 'n': /* n : Volume name */
sprintf(volume_name, "%-11.11s", optarg);
+ for (i = 0; i < 11; i++)
+ volume_name[i] = toupper(volume_name[i]);
break;
case 'r': /* r : Root directory entries */
Index: dosfstools-3.0.10/src/boot.c
===================================================================
--- dosfstools-3.0.10.orig/src/boot.c
+++ dosfstools-3.0.10/src/boot.c
@@ -34,6 +34,7 @@
#include "fat.h"
#include "io.h"
#include "boot.h"
+#include "check.h"
#define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
@@ -453,7 +454,7 @@ static void write_boot_label(DOS_FS *fs,
fs_write(fs->backupboot_start, sizeof(b), &b);
}
-static loff_t find_volume_de(DOS_FS *fs, DIR_ENT *de)
+loff_t find_volume_de(DOS_FS *fs, DIR_ENT *de)
{
unsigned long cluster;
loff_t offset;
@@ -492,7 +493,10 @@ static void write_volume_label(DOS_FS *f
offset = find_volume_de(fs, &de);
if (offset == 0)
- return;
+ {
+ offset = alloc_rootdir_entry(fs, &de, label);
+ /*return 0;*/
+ }
memcpy(de.name, label, 11);
de.time = CT_LE_W((unsigned short)((mtime->tm_sec >> 1) +
@@ -501,7 +505,16 @@ static void write_volume_label(DOS_FS *f
de.date = CT_LE_W((unsigned short)(mtime->tm_mday +
((mtime->tm_mon+1) << 5) +
((mtime->tm_year-80) << 9)));
- fs_write(offset, sizeof(DIR_ENT), &de);
+ de.attr = ATTR_VOLUME;
+ de.ctime_ms = 0;
+ de.ctime = de.time;
+ de.cdate = de.date;
+ de.adate = de.date;
+ de.starthi = CT_LE_W(0);
+ de.start = CT_LE_W(0);
+ de.size = CT_LE_L(0);
+
+ fs_write(offset, sizeof(DIR_ENT), &de);
}
void write_label(DOS_FS *fs, char *label)
Index: dosfstools-3.0.10/src/check.c
===================================================================
--- dosfstools-3.0.10.orig/src/check.c
+++ dosfstools-3.0.10/src/check.c
@@ -133,8 +133,8 @@ loff_t alloc_rootdir_entry(DOS_FS *fs, D
while (1) {
char expanded[12];
sprintf(expanded, pattern, curr_num);
- memcpy(de->name+4, expanded, 4);
- memcpy(de->ext, expanded+4, 3);
+ memcpy(de->name, expanded, 8);
+ memcpy(de->ext, expanded+8, 3);
clu_num = fs->root_cluster;
i = 0;
offset2 = cluster_start(fs,clu_num);
Index: dosfstools-3.0.10/src/boot.h
===================================================================
--- dosfstools-3.0.10.orig/src/boot.h
+++ dosfstools-3.0.10/src/boot.h
@@ -25,6 +25,7 @@
void read_boot(DOS_FS *fs);
void write_label(DOS_FS *fs, char *label);
+loff_t find_volume_de(DOS_FS *fs, DIR_ENT *de);
/* Reads the boot sector from the currently open device and initializes *FS */

View File

@ -1,20 +0,0 @@
Index: src/mkdosfs.c
===================================================================
--- src/mkdosfs.c.orig
+++ src/mkdosfs.c
@@ -1763,10 +1763,11 @@ main (int argc, char **argv)
* this is a MO disk I introduce a -I (ignore) switch. -Joey
*/
if (!ignore_full_disk && (
- (statbuf.st_rdev & 0xff3f) == 0x0300 || /* hda, hdb */
- (statbuf.st_rdev & 0xff0f) == 0x0800 || /* sd */
- (statbuf.st_rdev & 0xff3f) == 0x0d00 || /* xd */
- (statbuf.st_rdev & 0xff3f) == 0x1600 ) /* hdc, hdd */
+ (statbuf.st_rdev & 0xfff3f) == 0x00300 ||
+ (major(statbuf.st_rdev) == 3 && (minor(statbuf.st_rdev) % 64) == 0) || /* hda, hdb */
+ (major(statbuf.st_rdev) == 8 && (minor(statbuf.st_rdev) % 16) == 0) || /* sd */
+ (major(statbuf.st_rdev) == 13 && (minor(statbuf.st_rdev) % 64) == 0) || /* xd */
+ (major(statbuf.st_rdev) == 22 && (minor(statbuf.st_rdev) % 64) == 0)) /* hdc, hdd */
)
die ("Device partition expected, not making filesystem on entire device '%s' (use -I to override)");

View File

@ -1,9 +1,9 @@
Index: dosfstools-3.0.10/Makefile
Index: dosfstools-3.0.15/Makefile
===================================================================
--- dosfstools-3.0.10.orig/Makefile
+++ dosfstools-3.0.10/Makefile
@@ -19,9 +19,9 @@
# can be found in /usr/share/common-licenses/GPL-3 file.
--- dosfstools-3.0.15.orig/Makefile
+++ dosfstools-3.0.15/Makefile
@@ -20,9 +20,9 @@
DESTDIR =
-PREFIX = /usr/local

View File

@ -1,3 +1,34 @@
-------------------------------------------------------------------
Mon Mar 4 07:16:53 UTC 2013 - pgajdos@suse.com
- update to 3.0.16: label fixes
* dropped upstreamed
- dosfstools-create-rootdir-label.patch
- dosfstools-dosfslabel-forbid-lowercase.patch
- dosfstools-dosfslabel-from-rootdir.patch
- dosfstools-fsck-file-name.patch
- dosfstools-mkdosfs-no-label.patch
- dosfstools-mkdosfs-uppercase-label.patch
-------------------------------------------------------------------
Mon Feb 25 07:01:42 UTC 2013 - pgajdos@suse.com
- update to 3.0.15: bugfixes for device detection, root directory
allocation, and messages about unicode filenames.
* dropped dosfstools-filename-buffer-overflow.patch (upstreamed)
* dropped dosfstools-mdraid-partition.patch (upstreamed)
* refreshed dosfstools-suse-dirs.patch
* refreshed ppc-reserved-sectors-fix.patch
(will be dropped if not upstreamed)
* dosfstools-label.patch splitted to:
- dosfstools-create-rootdir-label.patch
- dosfstools-dosfslabel-forbid-lowercase.patch
- dosfstools-dosfslabel-from-rootdir.patch
- dosfstools-fsck-file-name.patch
- dosfstools-mkdosfs-no-label.patch
- dosfstools-mkdosfs-uppercase-label.patch
(will be upstreamed or dropped)
-------------------------------------------------------------------
Fri Oct 26 15:19:38 UTC 2012 - dvaleev@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package dosfstools
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 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
@ -22,15 +22,14 @@ Provides: mkdosfs
Summary: Utilities for Making and Checking MS-DOS FAT File Systems on Linux
License: GPL-3.0+
Group: System/Filesystems
Version: 3.0.10
Version: 3.0.16
Release: 0
Url: http://freshmeat.net/projects/dosfstools
Source: %{name}_%{version}.orig.tar.bz2
Source: %{name}_%{version}.orig.tar.xz
Patch0: %{name}-suse-dirs.patch
Patch1: %{name}-mdraid-partition.patch
Patch2: %{name}-label.patch
Patch3: %{name}-filename-buffer-overflow.patch
Patch4: ppc-reserved-sectors-fix.patch
# workaround for
# https://bugs.launchpad.net/ubuntu/+source/dosfstools/+bug/746262
Patch100: ppc-reserved-sectors-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Supplements: filesystem(vfat)
@ -42,10 +41,7 @@ drives or on floppies.
%prep
%setup
%patch0 -p1
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch100 -p1
%build
make CC="%__cc" OPTFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $RPM_OPT_FLAGS" %{?_smp_mflags}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8f6155c329c90e6bffdb339d702301316aeb6b365d95dcebd1cdc9968ad9162
size 69718

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:450b422d89a305bcca76b1af076c51944a5cc0f1707727ee8ef64e969dd4e956
size 72424

View File

@ -1,13 +1,13 @@
Index: dosfstools-3.0.10/src/mkdosfs.c
Index: dosfstools-3.0.15/src/mkdosfs.c
===================================================================
--- dosfstools-3.0.10.orig/src/mkdosfs.c
+++ dosfstools-3.0.10/src/mkdosfs.c
@@ -1059,7 +1059,7 @@ setup_tables (void)
}
--- dosfstools-3.0.15.orig/src/mkdosfs.c
+++ dosfstools-3.0.15/src/mkdosfs.c
@@ -1016,7 +1016,7 @@ static void setup_tables(void)
}
/* Adjust the reserved number of sectors for alignment */
- reserved_sectors = align_object(reserved_sectors, bs.cluster_size);
+ /* reserved_sectors = align_object(reserved_sectors, bs.cluster_size); */
bs.reserved = CT_LE_W(reserved_sectors);
/* Adjust the reserved number of sectors for alignment */
- reserved_sectors = align_object(reserved_sectors, bs.cluster_size);
+ /* reserved_sectors = align_object(reserved_sectors, bs.cluster_size); */
bs.reserved = CT_LE_W(reserved_sectors);
/* Adjust the number of root directory entries to help enforce alignment */
/* Adjust the number of root directory entries to help enforce alignment */