summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-03-07 01:59:29 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-07 14:45:23 +0000
commit90749060f02c930764dc4c7ebc4c1421334663bf (patch)
tree932cc165a563d85f3ac8ad70f7fe30332e798c8b /meta/recipes-devtools
parent8b1553e9e90535a2c38d27a38296e2d566cea65a (diff)
downloadpoky-90749060f02c930764dc4c7ebc4c1421334663bf.tar.gz
e2fsprogs: mke2fs: add an option: -d root-directory
This option is used for adding the files from a given directory (the root-directory) to the filesystem, it is similiar to genext2fs, but genext2fs doesn't fully support ext4. [YOCTO #4083] (From OE-Core rev: 83357ef1f6797e48de4870ccd552951b0efb3b53) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/e2fsprogs/e2fsprogs/0008-mke2fs.c-add-an-option-d-root-directory.patch168
1 files changed, 168 insertions, 0 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0008-mke2fs.c-add-an-option-d-root-directory.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0008-mke2fs.c-add-an-option-d-root-directory.patch
new file mode 100644
index 0000000000..1f98673f35
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0008-mke2fs.c-add-an-option-d-root-directory.patch
@@ -0,0 +1,168 @@
1From df856929e42bd4f3bdc8d4f59ee82ae8b28532e6 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 24 Dec 2013 01:50:45 -0500
4Subject: [PATCH 08/11] mke2fs.c: add an option: -d root-directory
5
6This option is used for adding the files from a given directory (the
7root-directory) to the filesystem, it is similiar to genext2fs, but
8genext2fs doesn't fully support ext4.
9
10Upstream-Status: Backport
11
12Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
13Reviewed-by: Darren Hart <dvhart@linux.intel.com>
14---
15 misc/Makefile.in | 14 ++++++++++----
16 misc/mke2fs.c | 32 +++++++++++++++++++++++---------
17 2 files changed, 33 insertions(+), 13 deletions(-)
18
19diff --git a/misc/Makefile.in b/misc/Makefile.in
20index 553c361..8253723 100644
21--- a/misc/Makefile.in
22+++ b/misc/Makefile.in
23@@ -42,7 +42,8 @@ LPROGS= @E2INITRD_PROG@
24
25 TUNE2FS_OBJS= tune2fs.o util.o
26 MKLPF_OBJS= mklost+found.o
27-MKE2FS_OBJS= mke2fs.o util.o profile.o prof_err.o default_profile.o
28+MKE2FS_OBJS= mke2fs.o util.o profile.o prof_err.o default_profile.o \
29+ create_inode.o
30 CHATTR_OBJS= chattr.o
31 LSATTR_OBJS= lsattr.o
32 UUIDGEN_OBJS= uuidgen.o
33@@ -60,7 +61,8 @@ E2FREEFRAG_OBJS= e2freefrag.o
34 PROFILED_TUNE2FS_OBJS= profiled/tune2fs.o profiled/util.o
35 PROFILED_MKLPF_OBJS= profiled/mklost+found.o
36 PROFILED_MKE2FS_OBJS= profiled/mke2fs.o profiled/util.o profiled/profile.o \
37- profiled/prof_err.o profiled/default_profile.o
38+ profiled/prof_err.o profiled/default_profile.o \
39+ profiled/create_inode.o
40 PROFILED_CHATTR_OBJS= profiled/chattr.o
41 PROFILED_LSATTR_OBJS= profiled/lsattr.o
42 PROFILED_UUIDGEN_OBJS= profiled/uuidgen.o
43@@ -82,7 +84,7 @@ SRCS= $(srcdir)/tune2fs.c $(srcdir)/mklost+found.c $(srcdir)/mke2fs.c \
44 $(srcdir)/uuidgen.c $(srcdir)/blkid.c $(srcdir)/logsave.c \
45 $(srcdir)/filefrag.c $(srcdir)/base_device.c \
46 $(srcdir)/ismounted.c $(srcdir)/../e2fsck/profile.c \
47- $(srcdir)/e2undo.c $(srcdir)/e2freefrag.c
48+ $(srcdir)/e2undo.c $(srcdir)/e2freefrag.c $(srcdir)/create_inode.c
49
50 LIBS= $(LIBEXT2FS) $(LIBCOM_ERR)
51 DEPLIBS= $(LIBEXT2FS) $(DEPLIBCOM_ERR)
52@@ -630,7 +632,7 @@ mke2fs.o: $(srcdir)/mke2fs.c $(top_builddir)/lib/config.h \
53 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
54 $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
55 $(srcdir)/util.h profile.h prof_err.h $(top_srcdir)/version.h \
56- $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/mkquota.h \
57+ $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/mkquota.h $(srcdir)/create_inode.h\
58 $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
59 $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
60 chattr.o: $(srcdir)/chattr.c $(top_builddir)/lib/config.h \
61@@ -710,3 +712,7 @@ e2freefrag.o: $(srcdir)/e2freefrag.c $(top_builddir)/lib/config.h \
62 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
63 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
64 $(srcdir)/e2freefrag.h
65+create_inode.o: $(srcdir)/create_inode.h $(srcdir)/create_inode.c \
66+ $(top_builddir)/lib/config.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
67+ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/e2p/e2p.h \
68+ $(srcdir)/nls-enable.h
69diff --git a/misc/mke2fs.c b/misc/mke2fs.c
70index 2e8ba60..578b62d 100644
71--- a/misc/mke2fs.c
72+++ b/misc/mke2fs.c
73@@ -22,7 +22,6 @@
74 #include <stdio.h>
75 #include <string.h>
76 #include <strings.h>
77-#include <fcntl.h>
78 #include <ctype.h>
79 #include <time.h>
80 #ifdef __linux__
81@@ -44,24 +43,19 @@ extern int optind;
82 #include <errno.h>
83 #endif
84 #include <sys/ioctl.h>
85-#include <sys/types.h>
86-#include <sys/stat.h>
87 #include <libgen.h>
88 #include <limits.h>
89 #include <blkid/blkid.h>
90
91 #include "ext2fs/ext2_fs.h"
92 #include "ext2fs/ext2fsP.h"
93-#include "et/com_err.h"
94 #include "uuid/uuid.h"
95-#include "e2p/e2p.h"
96-#include "ext2fs/ext2fs.h"
97 #include "util.h"
98 #include "profile.h"
99 #include "prof_err.h"
100 #include "../version.h"
101-#include "nls-enable.h"
102 #include "quota/mkquota.h"
103+#include "create_inode.h"
104
105 #define STRIDE_LENGTH 8
106
107@@ -105,6 +99,7 @@ static char *mount_dir;
108 char *journal_device;
109 static int sync_kludge; /* Set using the MKE2FS_SYNC env. option */
110 static char **fs_types;
111+const char *root_dir; /* Copy files from the specified directory */
112
113 static profile_t profile;
114
115@@ -116,7 +111,8 @@ static void usage(void)
116 fprintf(stderr, _("Usage: %s [-c|-l filename] [-b block-size] "
117 "[-C cluster-size]\n\t[-i bytes-per-inode] [-I inode-size] "
118 "[-J journal-options]\n"
119- "\t[-G flex-group-size] [-N number-of-inodes]\n"
120+ "\t[-G flex-group-size] [-N number-of-inodes] "
121+ "[-d root-directory]\n"
122 "\t[-m reserved-blocks-percentage] [-o creator-os]\n"
123 "\t[-g blocks-per-group] [-L volume-label] "
124 "[-M last-mounted-directory]\n\t[-O feature[,...]] "
125@@ -1394,7 +1390,7 @@ profile_error:
126 }
127
128 while ((c = getopt (argc, argv,
129- "b:cg:i:jl:m:no:qr:s:t:vC:DE:FG:I:J:KL:M:N:O:R:ST:U:V")) != EOF) {
130+ "b:cg:i:jl:m:no:qr:s:t:d:vC:DE:FG:I:J:KL:M:N:O:R:ST:U:V")) != EOF) {
131 switch (c) {
132 case 'b':
133 blocksize = parse_num_blocks2(optarg, -1);
134@@ -1582,6 +1578,9 @@ profile_error:
135 case 'U':
136 fs_uuid = optarg;
137 break;
138+ case 'd':
139+ root_dir = optarg;
140+ break;
141 case 'v':
142 verbose = 1;
143 break;
144@@ -2726,6 +2725,21 @@ no_journal:
145 EXT4_FEATURE_RO_COMPAT_QUOTA))
146 create_quota_inodes(fs);
147
148+ /* Copy files from the specified directory */
149+ if (root_dir) {
150+ if (!quiet)
151+ printf("%s", _("Copying files into the device: "));
152+
153+ current_fs = fs;
154+ root = EXT2_ROOT_INO;
155+ retval = populate_fs(root, root_dir);
156+ if (retval)
157+ fprintf(stderr, "%s",
158+ _("\nError while populating file system"));
159+ else if (!quiet)
160+ printf("%s", _("done\n"));
161+ }
162+
163 if (!quiet)
164 printf("%s", _("Writing superblocks and "
165 "filesystem accounting information: "));
166--
1671.7.10.4
168