summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0013-Add-volume-id-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0013-Add-volume-id-support.patch')
-rw-r--r--meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0013-Add-volume-id-support.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0013-Add-volume-id-support.patch b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0013-Add-volume-id-support.patch
new file mode 100644
index 0000000000..1777dd6b0f
--- /dev/null
+++ b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0013-Add-volume-id-support.patch
@@ -0,0 +1,86 @@
1Upstream-Status: inappropriate
2
3From 3b9edc3e7c809f64dc164d73b64ab4a606ccfea1 Mon Sep 17 00:00:00 2001
4From: Corey Minyard <cminyard@mvista.com>
5Date: Fri, 3 Jun 2011 21:24:49 -0500
6Subject: [PATCH 13/19] Add volume id support.
7
8Add support for setting the volume id of the filesystem. This is
9functionally the same as the patch from OpenEmbedded, but is built
10on previous changes in this patch set.
11---
12 genext2fs.8 | 3 +++
13 genext2fs.c | 12 ++++++++++--
14 2 files changed, 13 insertions(+), 2 deletions(-)
15
16diff --git a/genext2fs.8 b/genext2fs.8
17index 0f77e7c..8b8db25 100644
18--- a/genext2fs.8
19+++ b/genext2fs.8
20@@ -61,6 +61,9 @@ Size of the image in blocks.
21 .BI "\-N, \-\-number\-of\-inodes inodes"
22 Maximum number of inodes.
23 .TP
24+.BI "\-L, \-\-volume\-id name"
25+Set the volume id (volume name) for the filesystem.
26+.TP
27 .BI "\-i, \-\-bytes\-per\-inode ratio"
28 Used to calculate the maximum number of inodes from the available blocks.
29 .TP
30diff --git a/genext2fs.c b/genext2fs.c
31index e420bba..4d01bc4 100644
32--- a/genext2fs.c
33+++ b/genext2fs.c
34@@ -3058,6 +3058,7 @@ main(int argc, char **argv)
35 int squash_perms = 0;
36 uint16 endian = 1;
37 int bigendian = !*(char*)&endian;
38+ char *volumelabel = NULL;
39 filesystem *fs;
40 int i;
41 int c;
42@@ -3071,6 +3072,7 @@ main(int argc, char **argv)
43 { "size-in-blocks", required_argument, NULL, 'b' },
44 { "bytes-per-inode", required_argument, NULL, 'i' },
45 { "number-of-inodes", required_argument, NULL, 'N' },
46+ { "volume-label", required_argument, NULL, 'L' },
47 { "reserved-percentage", required_argument, NULL, 'm' },
48 { "block-map", required_argument, NULL, 'g' },
49 { "fill-value", required_argument, NULL, 'e' },
50@@ -3087,11 +3089,11 @@ main(int argc, char **argv)
51
52 app_name = argv[0];
53
54- while((c = getopt_long(argc, argv, "x:d:D:b:i:N:m:g:e:zfqUPhVv", longopts, NULL)) != EOF) {
55+ while((c = getopt_long(argc, argv, "x:d:D:b:i:N:L:m:g:e:zfqUPhVv", longopts, NULL)) != EOF) {
56 #else
57 app_name = argv[0];
58
59- while((c = getopt(argc, argv, "x:d:D:b:i:N:m:g:e:zfqUPhVv")) != EOF) {
60+ while((c = getopt(argc, argv, "x:d:D:b:i:N:L:m:g:e:zfqUPhVv")) != EOF) {
61 #endif /* HAVE_GETOPT_LONG */
62 switch(c)
63 {
64@@ -3111,6 +3113,9 @@ main(int argc, char **argv)
65 case 'N':
66 nbinodes = SI_atof(optarg);
67 break;
68+ case 'L':
69+ volumelabel = optarg;
70+ break;
71 case 'm':
72 reserved_frac = SI_atof(optarg) / 100;
73 break;
74@@ -3199,6 +3204,9 @@ main(int argc, char **argv)
75 fs = init_fs(nbblocks, nbinodes, nbresrvd, holes, fs_timestamp,
76 bigendian, fsout);
77 }
78+ if (volumelabel != NULL)
79+ strncpy((char *)fs->sb->s_volume_name, volumelabel,
80+ sizeof(fs->sb->s_volume_name));
81
82 populate_fs(fs, dopt, didx, squash_uids, squash_perms, fs_timestamp, NULL);
83
84--
851.7.4.1
86