summaryrefslogtreecommitdiff
path: root/recipes/genext2fs/files
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/genext2fs/files
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/genext2fs/files')
-rw-r--r--recipes/genext2fs/files/volume.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/recipes/genext2fs/files/volume.patch b/recipes/genext2fs/files/volume.patch
new file mode 100644
index 0000000000..32ef8dc52b
--- /dev/null
+++ b/recipes/genext2fs/files/volume.patch
@@ -0,0 +1,107 @@
+Index: genext2fs-1.4rc1/genext2fs.c
+===================================================================
+--- genext2fs-1.4rc1.orig/genext2fs.c
++++ genext2fs-1.4rc1/genext2fs.c
+@@ -409,7 +409,9 @@ swab32(uint32 val)
+ typedef struct
+ {
+ superblock_decl
+- uint32 s_reserved[235]; // Reserved
++ uint32 s_reserved1[9];
++ char s_volume[16];
++ uint32 s_reserved2[222]; // Reserved
+ } superblock;
+
+ typedef struct
+@@ -1122,7 +1124,7 @@ extend_blk(filesystem *fs, uint32 nod, b
+ while(create)
+ {
+ int i, copyb = 0;
+- if(!(fs->sb.s_reserved[200] & OP_HOLES))
++ if(!(fs->sb.s_reserved2[187] & OP_HOLES))
+ copyb = 1;
+ else
+ for(i = 0; i < BLOCKSIZE / 4; i++)
+@@ -1784,7 +1786,8 @@ swap_badfs(filesystem *fs)
+
+ // initialize an empty filesystem
+ static filesystem *
+-init_fs(int nbblocks, int nbinodes, int nbresrvd, int holes, uint32 fs_timestamp)
++init_fs(int nbblocks, int nbinodes, int nbresrvd, int holes,
++ uint32 fs_timestamp, char *volumeid)
+ {
+ int i;
+ filesystem *fs;
+@@ -1847,6 +1850,9 @@ init_fs(int nbblocks, int nbinodes, int
+ fs->sb.s_magic = EXT2_MAGIC_NUMBER;
+ fs->sb.s_lastcheck = fs_timestamp;
+
++ if (volumeid != NULL)
++ strncpy(fs->sb.s_volume, volumeid, sizeof(fs->sb.s_volume));
++
+ // set up groupdescriptors
+ for(i = 0,bbmpos=2+gd,ibmpos=3+gd,itblpos =4+gd;
+ i<nbgroups;
+@@ -1945,7 +1951,7 @@ init_fs(int nbblocks, int nbinodes, int
+
+ // options for me
+ if(holes)
+- fs->sb.s_reserved[200] |= OP_HOLES;
++ fs->sb.s_reserved2[187] |= OP_HOLES;
+
+ return fs;
+ }
+@@ -2276,7 +2282,7 @@ static void
+ dump_fs(filesystem *fs, FILE * fh, int swapit)
+ {
+ int nbblocks = fs->sb.s_blocks_count;
+- fs->sb.s_reserved[200] = 0;
++ fs->sb.s_reserved2[187] = 0;
+ if(swapit)
+ swap_goodfs(fs);
+ if(fwrite(fs, BLOCKSIZE, nbblocks, fh) < nbblocks)
+@@ -2341,6 +2347,7 @@ main(int argc, char **argv)
+ uint16 endian = 1;
+ int bigendian = !*(char*)&endian;
+ filesystem *fs;
++ char *volumeid = NULL;
+ int i;
+ int c;
+ struct stats stats;
+@@ -2359,6 +2366,7 @@ main(int argc, char **argv)
+ { "size-in-blocks", required_argument, NULL, 'b' },
+ { "bytes-per-inode", required_argument, NULL, 'i' },
+ { "number-of-inodes", required_argument, NULL, 'I' },
++ { "volume-id", required_argument, NULL, 'L' },
+ { "reserved-blocks", required_argument, NULL, 'r' },
+ { "block-map", required_argument, NULL, 'g' },
+ { "fill-value", required_argument, NULL, 'e' },
+@@ -2372,7 +2380,7 @@ main(int argc, char **argv)
+ { 0, 0, 0, 0}
+ } ;
+
+- while((c = getopt_long(argc, argv, "x:d:D:b:I:i:r:g:e:zfqUPhv", longopts, NULL)) != EOF) {
++ while((c = getopt_long(argc, argv, "x:d:D:b:I:i:L:r:g:e:zfqUPhv", longopts, NULL)) != EOF) {
+ switch(c)
+ {
+ case 'x':
+@@ -2391,6 +2399,9 @@ main(int argc, char **argv)
+ case 'I':
+ nbinodes = SI_atof(optarg);
+ break;
++ case 'L':
++ volumeid = optarg;
++ break;
+ case 'r':
+ nbresrvd = SI_atof(optarg);
+ break;
+@@ -2517,7 +2528,8 @@ main(int argc, char **argv)
+ nbresrvd = nbblocks * RESERVED_BLOCKS;
+ if(fs_timestamp == -1)
+ fs_timestamp = time(NULL);
+- fs = init_fs(nbblocks, nbinodes, nbresrvd, holes, fs_timestamp);
++ fs = init_fs(nbblocks, nbinodes, nbresrvd, holes,
++ fs_timestamp, volumeid);
+ }
+ for(i = 0; i < didx; i++)
+ {