diff options
Diffstat (limited to 'meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch')
-rw-r--r-- | meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch new file mode 100644 index 0000000000..5504a11e8a --- /dev/null +++ b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | --- | ||
2 | mkfs.jffs2.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- | ||
3 | 1 file changed, 42 insertions(+), 3 deletions(-) | ||
4 | |||
5 | Index: git/mkfs.jffs2.c | ||
6 | =================================================================== | ||
7 | --- git.orig/mkfs.jffs2.c 2007-01-23 15:42:34.000000000 +0000 | ||
8 | +++ git/mkfs.jffs2.c 2007-01-23 15:46:08.000000000 +0000 | ||
9 | @@ -97,7 +97,12 @@ struct filesystem_entry { | ||
10 | struct filesystem_entry *files; /* Only relevant to directories */ | ||
11 | }; | ||
12 | |||
13 | - | ||
14 | +struct ignorepath_entry { | ||
15 | + struct ignorepath_entry* next; /* Points to the next ignorepath element */ | ||
16 | + char name[PATH_MAX]; /* Name of the entry */ | ||
17 | +}; | ||
18 | + | ||
19 | +static struct ignorepath_entry* ignorepath = 0; | ||
20 | static int out_fd = -1; | ||
21 | static int in_fd = -1; | ||
22 | static char default_rootdir[] = "."; | ||
23 | @@ -372,7 +377,7 @@ static struct filesystem_entry *recursiv | ||
24 | char *hpath, *tpath; | ||
25 | struct dirent *dp, **namelist; | ||
26 | struct filesystem_entry *entry; | ||
27 | - | ||
28 | + struct ignorepath_entry* element = ignorepath; | ||
29 | |||
30 | if (lstat(hostpath, &sb)) { | ||
31 | perror_msg_and_die("%s", hostpath); | ||
32 | @@ -381,6 +386,15 @@ static struct filesystem_entry *recursiv | ||
33 | entry = add_host_filesystem_entry(targetpath, hostpath, | ||
34 | sb.st_uid, sb.st_gid, sb.st_mode, 0, parent); | ||
35 | |||
36 | + while ( element ) { | ||
37 | + if ( strcmp( element->name, targetpath ) == 0 ) { | ||
38 | + printf( "Note: ignoring directories below '%s'\n", targetpath ); | ||
39 | + return entry; | ||
40 | + break; | ||
41 | + } | ||
42 | + element = element->next; | ||
43 | + } | ||
44 | + | ||
45 | n = scandir(hostpath, &namelist, 0, alphasort); | ||
46 | if (n < 0) { | ||
47 | perror_msg_and_die("opening directory %s", hostpath); | ||
48 | @@ -1405,6 +1419,7 @@ static struct option long_options[] = { | ||
49 | {"root", 1, NULL, 'r'}, | ||
50 | {"pagesize", 1, NULL, 's'}, | ||
51 | {"eraseblock", 1, NULL, 'e'}, | ||
52 | + {"ignore", 1, NULL, 'I'}, | ||
53 | {"output", 1, NULL, 'o'}, | ||
54 | {"help", 0, NULL, 'h'}, | ||
55 | {"verbose", 0, NULL, 'v'}, | ||
56 | @@ -1452,6 +1467,7 @@ static char *helptext = | ||
57 | " -L, --list-compressors Show the list of the avaiable compressors\n" | ||
58 | " -t, --test-compression Call decompress and compare with the original (for test)\n" | ||
59 | " -n, --no-cleanmarkers Don't add a cleanmarker to every eraseblock\n" | ||
60 | +" -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n" | ||
61 | " -o, --output=FILE Output to FILE (default: stdout)\n" | ||
62 | " -l, --little-endian Create a little-endian filesystem\n" | ||
63 | " -b, --big-endian Create a big-endian filesystem\n" | ||
64 | @@ -1617,11 +1633,12 @@ int main(int argc, char **argv) | ||
65 | struct filesystem_entry *root; | ||
66 | char *compr_name = NULL; | ||
67 | int compr_prior = -1; | ||
68 | + struct ignorepath_entry* element = ignorepath; | ||
69 | |||
70 | jffs2_compressors_init(); | ||
71 | |||
72 | while ((opt = getopt_long(argc, argv, | ||
73 | - "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
74 | + "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
75 | { | ||
76 | switch (opt) { | ||
77 | case 'D': | ||
78 | @@ -1644,6 +1661,28 @@ int main(int argc, char **argv) | ||
79 | page_size = strtol(optarg, NULL, 0); | ||
80 | break; | ||
81 | |||
82 | + case 'I': | ||
83 | + printf( "Note: Adding '%s' to ignore Path\n", optarg ); | ||
84 | + element = ignorepath; | ||
85 | + if ( !ignorepath ) { | ||
86 | + ignorepath = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
87 | + ignorepath->next = 0; | ||
88 | + strcpy( &ignorepath->name[0], optarg ); | ||
89 | + } else { | ||
90 | + while ( element->next ) element = element->next; | ||
91 | + element->next = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
92 | + element->next->next = 0; | ||
93 | + strcpy( &element->next->name[0], optarg ); | ||
94 | + } | ||
95 | + printf( "--------- Dumping ignore path list ----------------\n" ); | ||
96 | + element = ignorepath; | ||
97 | + while ( element ) { | ||
98 | + printf( " * '%s'\n", &element->name[0] ); | ||
99 | + element = element->next; | ||
100 | + } | ||
101 | + printf( "---------------------------------------------------\n" ); | ||
102 | + break; | ||
103 | + | ||
104 | case 'o': | ||
105 | if (out_fd != -1) { | ||
106 | error_msg_and_die("output filename specified more than once"); | ||