summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch')
-rw-r--r--meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch62
1 files changed, 30 insertions, 32 deletions
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
index 7feee0f10d..3ba4711d12 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
@@ -1,13 +1,14 @@
1Add -s <directory> support to populate the image. 1Add -d <directory> support to populate the image.
2 2
3Upstream-Status: Inappropriate [licensing] 3Upstream-Status: Inappropriate [licensing]
4We're tracking an old release of dosfstools due to licensing issues. 4We're tracking an old release of dosfstools due to licensing issues.
5 5
6Signed-off-by: Scott Garman <scott.a.garman@intel.com> 6Signed-off-by: Scott Garman <scott.a.garman@intel.com>
7 7
8diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs.c 8Index: dosfstools-2.11/mkdosfs/mkdosfs.c
9--- dosfstools-2.10.orig/mkdosfs/mkdosfs.c 2004-08-02 20:48:45.000000000 -0700 9===================================================================
10+++ dosfstools-2.10/mkdosfs/mkdosfs.c 2004-08-02 20:49:44.296953792 -0700 10--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c 2011-12-06 12:27:55.000000000 +0000
11+++ dosfstools-2.11/mkdosfs/mkdosfs.c 2011-12-06 12:37:13.445950703 +0000
11@@ -18,6 +18,10 @@ 12@@ -18,6 +18,10 @@
12 as a rule), and not the block. For example the boot block does not 13 as a rule), and not the block. For example the boot block does not
13 occupy a full cluster. 14 occupy a full cluster.
@@ -26,18 +27,18 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
26+#include <libgen.h> 27+#include <libgen.h>
27+#include <dirent.h> 28+#include <dirent.h>
28 29
29 #if __BYTE_ORDER == __BIG_ENDIAN 30 #include <linux/version.h>
30 31 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
31@@ -124,6 +130,8 @@ 32@@ -110,6 +116,8 @@
32 } 33 * sufficient (or even better :) for 64 bit offsets in the meantime */
33 #endif 34 #define llseek lseek
34 35
35+#define ROUND_UP(value, divisor) (value + (divisor - (value % divisor))) / divisor 36+#define ROUND_UP(value, divisor) (value + (divisor - (value % divisor))) / divisor
36+ 37+
37 /* Constant definitions */ 38 /* Constant definitions */
38 39
39 #define TRUE 1 /* Boolean constants */ 40 #define TRUE 1 /* Boolean constants */
40@@ -163,7 +171,6 @@ 41@@ -149,7 +157,6 @@
41 #define ATTR_VOLUME 8 /* volume label */ 42 #define ATTR_VOLUME 8 /* volume label */
42 #define ATTR_DIR 16 /* directory */ 43 #define ATTR_DIR 16 /* directory */
43 #define ATTR_ARCH 32 /* archived */ 44 #define ATTR_ARCH 32 /* archived */
@@ -45,7 +46,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
45 #define ATTR_NONE 0 /* no attribute bits */ 46 #define ATTR_NONE 0 /* no attribute bits */
46 #define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN) 47 #define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
47 /* attribute bits that are copied "as is" */ 48 /* attribute bits that are copied "as is" */
48@@ -258,6 +265,19 @@ 49@@ -245,6 +252,19 @@
49 __u32 reserved2[4]; 50 __u32 reserved2[4];
50 }; 51 };
51 52
@@ -65,7 +66,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
65 struct msdos_dir_entry 66 struct msdos_dir_entry
66 { 67 {
67 char name[8], ext[3]; /* name and extension */ 68 char name[8], ext[3]; /* name and extension */
68@@ -306,6 +326,15 @@ 69@@ -293,6 +313,15 @@
69 70
70 #define MESSAGE_OFFSET 29 /* Offset of message in above code */ 71 #define MESSAGE_OFFSET 29 /* Offset of message in above code */
71 72
@@ -81,7 +82,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
81 /* Global variables - the root of all evil :-) - see these and weep! */ 82 /* Global variables - the root of all evil :-) - see these and weep! */
82 83
83 static char *template_boot_code; /* Variable to store a full template boot sector in */ 84 static char *template_boot_code; /* Variable to store a full template boot sector in */
84@@ -339,6 +368,9 @@ 85@@ -326,6 +355,9 @@
85 static int size_root_dir; /* Size of the root directory in bytes */ 86 static int size_root_dir; /* Size of the root directory in bytes */
86 static int sectors_per_cluster = 0; /* Number of sectors per disk cluster */ 87 static int sectors_per_cluster = 0; /* Number of sectors per disk cluster */
87 static int root_dir_entries = 0; /* Number of root directory entries */ 88 static int root_dir_entries = 0; /* Number of root directory entries */
@@ -89,9 +90,9 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
89+static int last_cluster_written = 0; 90+static int last_cluster_written = 0;
90+ 91+
91 static char *blank_sector; /* Blank sector - all zeros */ 92 static char *blank_sector; /* Blank sector - all zeros */
93 static int hidden_sectors = 0; /* Number of hidden sectors */
92 94
93 95@@ -399,7 +431,6 @@
94@@ -411,7 +443,6 @@
95 } 96 }
96 } 97 }
97 98
@@ -99,7 +100,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
99 /* Mark a specified sector as having a particular value in it's FAT entry */ 100 /* Mark a specified sector as having a particular value in it's FAT entry */
100 101
101 static void 102 static void
102@@ -1262,6 +1293,9 @@ 103@@ -1266,6 +1297,9 @@
103 die ("unable to allocate space for root directory in memory"); 104 die ("unable to allocate space for root directory in memory");
104 } 105 }
105 106
@@ -109,7 +110,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
109 memset(root_dir, 0, size_root_dir); 110 memset(root_dir, 0, size_root_dir);
110 if ( memcmp(volume_name, " ", 11) ) 111 if ( memcmp(volume_name, " ", 11) )
111 { 112 {
112@@ -1310,11 +1344,11 @@ 113@@ -1314,11 +1348,11 @@
113 } 114 }
114 115
115 if (!(blank_sector = malloc( sector_size ))) 116 if (!(blank_sector = malloc( sector_size )))
@@ -124,7 +125,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
124 /* Write the new filesystem's data tables to wherever they're going to end up! */ 125 /* Write the new filesystem's data tables to wherever they're going to end up! */
125 126
126 #define error(str) \ 127 #define error(str) \
127@@ -1336,7 +1370,7 @@ 128@@ -1340,7 +1374,7 @@
128 do { \ 129 do { \
129 int __size = (size); \ 130 int __size = (size); \
130 if (write (dev, buf, __size) != __size) \ 131 if (write (dev, buf, __size) != __size) \
@@ -133,7 +134,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
133 } while(0) 134 } while(0)
134 135
135 136
136@@ -1407,6 +1441,452 @@ 137@@ -1412,6 +1446,452 @@
137 free (fat); /* Free up the fat table space reserved during setup_tables */ 138 free (fat); /* Free up the fat table space reserved during setup_tables */
138 } 139 }
139 140
@@ -586,19 +587,16 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
586 587
587 /* Report the command usage and return a failure error code */ 588 /* Report the command usage and return a failure error code */
588 589
589@@ -1418,9 +1898,9 @@ 590@@ -1423,7 +1903,7 @@
590 [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\ 591 [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
591 [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\ 592 [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
592 [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\ 593 [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
593- /dev/name [blocks]\n"); 594- /dev/name [blocks]\n");
594+ [-d directory] /dev/name [blocks]\n"); 595+ [-d directory] /dev/name [blocks]\n");
595 } 596 }
596- 597
597+
598 /* 598 /*
599 * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant 599@@ -1463,6 +1943,8 @@
600 * of MS-DOS filesystem by default.
601@@ -1458,6 +1938,8 @@
602 int c; 600 int c;
603 char *tmp; 601 char *tmp;
604 char *listfile = NULL; 602 char *listfile = NULL;
@@ -607,27 +605,27 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
607 FILE *msgfile; 605 FILE *msgfile;
608 struct stat statbuf; 606 struct stat statbuf;
609 int i = 0, pos, ch; 607 int i = 0, pos, ch;
610@@ -1477,7 +1959,7 @@ 608@@ -1483,7 +1965,7 @@
611 printf ("%s " VERSION " (" VERSION_DATE ")\n", 609 printf ("%s " VERSION " (" VERSION_DATE ")\n",
612 program_name); 610 program_name);
613 611
614- while ((c = getopt (argc, argv, "AcCf:F:Ii:l:m:n:r:R:s:S:v:B:b")) != EOF) 612- while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
615+ while ((c = getopt (argc, argv, "AcCd:f:F:Ii:l:m:n:r:R:s:S:v:B:b")) != EOF) 613+ while ((c = getopt (argc, argv, "AbcCd:f:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
616 /* Scan the command line for options */ 614 /* Scan the command line for options */
617 switch (c) 615 switch (c)
618 { 616 {
619@@ -1502,6 +1984,10 @@ 617@@ -1508,6 +1990,10 @@
620 create = TRUE; 618 create = TRUE;
621 break; 619 break;
622 620
623+ case 'd': 621+ case 'd':
624+ dirname = optarg; 622+ dirname = optarg;
625+ break; 623+ break;
626+ 624+
627 case 'f': /* f : Choose number of FATs */ 625 case 'f': /* f : Choose number of FATs */
628 nr_fats = (int) strtol (optarg, &tmp, 0); 626 nr_fats = (int) strtol (optarg, &tmp, 0);
629 if (*tmp || nr_fats < 1 || nr_fats > 4) 627 if (*tmp || nr_fats < 1 || nr_fats > 4)
630@@ -1796,8 +2282,10 @@ 628@@ -1811,8 +2297,10 @@
631 else if (listfile) 629 else if (listfile)
632 get_list_blocks (listfile); 630 get_list_blocks (listfile);
633 631