summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/e2fsprogs
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-03-07 01:59:22 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-07 14:45:22 +0000
commit6779ab69fc8eea32a5abfbc0d0cc0efc6d4b86ff (patch)
tree6b0520d78d444b677aa904a0ad2d510d1cc015ba /meta/recipes-devtools/e2fsprogs
parentc859853f3206c77332ca5bf972dcd70e7d625cf6 (diff)
downloadpoky-6779ab69fc8eea32a5abfbc0d0cc0efc6d4b86ff.tar.gz
e2fsprogs: mke2fs: add the ability to copy files from a given directory
We will add a -d option which will be used for adding the files from a given directory to the filesystem, it is similiar to genext2fs, but genext2fs doesn't fully support ext4. * We already have the basic operations in debugfs: - Copy regular file - Create directory - Create symlink - Create special file We will move these operations into create_inode.h and create_inode.c, then let both mke2fs and debugfs use them. * What we need to do are: - Copy the given directory recursively, this will be done by the populate_fs() - Set the owner, mode and other informations - Handle the hard links TODO: - The libext2fs can't create the socket file (S_IFSOCK), do we have a plan to support it ? [YOCTO #4083] (From OE-Core rev: f050c510b070d919d50e491476e83f2b0ae2b7b2) 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/e2fsprogs')
-rw-r--r--meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch
new file mode 100644
index 0000000000..9ea413ef57
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch
@@ -0,0 +1,98 @@
1From c98fec004f077e566b9dfa20b25e3b86cb462a2e Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 24 Dec 2013 01:41:08 -0500
4Subject: [PATCH 01/11] mke2fs: add the ability to copy files from a given
5 directory
6
7We will add a -d option which will be used for adding the files from a
8given directory to the filesystem, it is similiar to genext2fs, but
9genext2fs doesn't fully support ext4.
10
11* We already have the basic operations in debugfs:
12 - Copy regular file
13 - Create directory
14 - Create symlink
15 - Create special file
16
17 We will move these operations into create_inode.h and create_inode.c,
18 then let both mke2fs and debugfs use them.
19
20* What we need to do are:
21 - Copy the given directory recursively, this will be done by the
22 populate_fs()
23 - Set the owner, mode and other informations
24 - Handle the hard links
25
26TODO:
27 - The libext2fs can't create the socket file (S_IFSOCK), do we have a
28 plan to support it ?
29
30Upstream-Status: Backport
31
32Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
33Reviewed-by: Darren Hart <dvhart@linux.intel.com>
34---
35 misc/create_inode.c | 26 ++++++++++++++++++++++++++
36 misc/create_inode.h | 17 +++++++++++++++++
37 2 files changed, 43 insertions(+)
38 create mode 100644 misc/create_inode.c
39 create mode 100644 misc/create_inode.h
40
41diff --git a/misc/create_inode.c b/misc/create_inode.c
42new file mode 100644
43index 0000000..46aaa60
44--- /dev/null
45+++ b/misc/create_inode.c
46@@ -0,0 +1,26 @@
47+#include "create_inode.h"
48+
49+/* Make a special file which is block, character and fifo */
50+errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st)
51+{
52+}
53+
54+/* Make a symlink name -> target */
55+errcode_t do_symlink_internal(ext2_ino_t cwd, const char *name, char *target)
56+{
57+}
58+
59+/* Make a directory in the fs */
60+errcode_t do_mkdir_internal(ext2_ino_t cwd, const char *name, struct stat *st)
61+{
62+}
63+
64+/* Copy the native file to the fs */
65+errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest)
66+{
67+}
68+
69+/* Copy files from source_dir to fs */
70+errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir)
71+{
72+}
73diff --git a/misc/create_inode.h b/misc/create_inode.h
74new file mode 100644
75index 0000000..9fc97fa
76--- /dev/null
77+++ b/misc/create_inode.h
78@@ -0,0 +1,17 @@
79+#include <sys/types.h>
80+#include <sys/stat.h>
81+#include <fcntl.h>
82+#include "et/com_err.h"
83+#include "e2p/e2p.h"
84+#include "ext2fs/ext2fs.h"
85+#include "nls-enable.h"
86+
87+ext2_filsys current_fs;
88+ext2_ino_t root;
89+
90+/* For populating the filesystem */
91+extern errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir);
92+extern errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st);
93+extern errcode_t do_symlink_internal(ext2_ino_t cwd, const char *name, char *target);
94+extern errcode_t do_mkdir_internal(ext2_ino_t cwd, const char *name, struct stat *st);
95+extern errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest);
96--
971.7.10.4
98