diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-01-13 17:37:28 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-18 11:47:03 +0000 |
commit | 8c3276ecea38d4d67c22e6db49060b2d4b457278 (patch) | |
tree | a08abeadef1a30dff799b50755a33a4faf8ab33c /meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch | |
parent | b248e55c0c39a4d45adc0690f2eefb332ab233f5 (diff) | |
download | poky-8c3276ecea38d4d67c22e6db49060b2d4b457278.tar.gz |
e2fsprogs: 1.42.9 -> 1.43 (master)
Upgrade to 1.43 (master) to make "mke2fs -d" support xattr, so that the
layer which requires xattr such as meta-selinux can populate images
easily.
* Remove the following patches since they are alredy in the source.
0001-e2fsprogs-fix-cross-compilation-problem.patch
0001-libext2fs-fix-potential-buffer-overflow-in-closefs.patch
0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch
0002-misc-create_inode.c-copy-files-recursively.patch
0003-misc-create_inode.c-create-special-file.patch
0004-misc-create_inode.c-create-symlink.patch
0005-misc-create_inode.c-copy-regular-file.patch
0006-misc-create_inode.c-create-directory.patch
0007-misc-create_inode.c-set-owner-mode-time-for-the-inod.patch
0008-mke2fs.c-add-an-option-d-root-directory.patch
0009-misc-create_inode.c-handle-hardlinks.patch
0010-debugfs-use-the-functions-in-misc-create_inode.c.patch
0011-mke2fs.8.in-update-the-manual-for-the-d-option.patch
0012-Fix-musl-build-failures.patch
CVE-2015-0247.patch
copy-in-create-hardlinks-with-the-correct-directory-.patch
fix-icache.patch
misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch
* Remove cache_inode.patch since it is not needed any more
* Updated mkdir.patch and ptest.patch
* Add --enable-libblkid to EXTRA_OECONF since libblkid is not created by
default.
* Time of core-image-sato-sdk do_rootfs:
- Before upgrade
real 3m18.508s
user 7m42.088s
sys 1m1.984s
- After upgrade
real 3m21.552s
user 7m38.496s
sys 1m0.644s
The are nearly the same
* The "fsck -f" shows the image is OK, and also can boot.
[YOCTO #8622]
(From OE-Core rev: a1f235ad736d322bb50eb4a4293b6b2f4e5200aa)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch')
-rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch deleted file mode 100644 index 9bff644ea6..0000000000 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | From 08dfbaf4e3f704232ff46d78c0758a6cfe3961c8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Mon, 23 Dec 2013 02:59:10 -0500 | ||
4 | Subject: [PATCH 02/11] misc/create_inode.c: copy files recursively | ||
5 | |||
6 | Use opendir() and readdir() to read the native directory, then use | ||
7 | lstat() to identify the file type and call the corresponding function to | ||
8 | add the file to the filesystem, call the populate_fs() recursively if it | ||
9 | is a directory. | ||
10 | |||
11 | NOTE: the libext2fs can't create the socket file. | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | |||
15 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
16 | Reviewed-by: Darren Hart <dvhart@linux.intel.com> | ||
17 | --- | ||
18 | misc/create_inode.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
19 | 1 file changed, 97 insertions(+) | ||
20 | |||
21 | diff --git a/misc/create_inode.c b/misc/create_inode.c | ||
22 | index 46aaa60..b68b910 100644 | ||
23 | --- a/misc/create_inode.c | ||
24 | +++ b/misc/create_inode.c | ||
25 | @@ -1,5 +1,13 @@ | ||
26 | #include "create_inode.h" | ||
27 | |||
28 | +#if __STDC_VERSION__ < 199901L | ||
29 | +# if __GNUC__ >= 2 | ||
30 | +# define __func__ __FUNCTION__ | ||
31 | +# else | ||
32 | +# define __func__ "<unknown>" | ||
33 | +# endif | ||
34 | +#endif | ||
35 | + | ||
36 | /* Make a special file which is block, character and fifo */ | ||
37 | errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st) | ||
38 | { | ||
39 | @@ -23,4 +31,93 @@ errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest) | ||
40 | /* Copy files from source_dir to fs */ | ||
41 | errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir) | ||
42 | { | ||
43 | + const char *name; | ||
44 | + DIR *dh; | ||
45 | + struct dirent *dent; | ||
46 | + struct stat st; | ||
47 | + char ln_target[PATH_MAX]; | ||
48 | + ext2_ino_t ino; | ||
49 | + errcode_t retval; | ||
50 | + int read_cnt; | ||
51 | + | ||
52 | + root = EXT2_ROOT_INO; | ||
53 | + | ||
54 | + if (chdir(source_dir) < 0) { | ||
55 | + com_err(__func__, errno, | ||
56 | + _("while changing working directory to \"%s\""), source_dir); | ||
57 | + return errno; | ||
58 | + } | ||
59 | + | ||
60 | + if (!(dh = opendir("."))) { | ||
61 | + com_err(__func__, errno, | ||
62 | + _("while openning directory \"%s\""), source_dir); | ||
63 | + return errno; | ||
64 | + } | ||
65 | + | ||
66 | + while((dent = readdir(dh))) { | ||
67 | + if((!strcmp(dent->d_name, ".")) || (!strcmp(dent->d_name, ".."))) | ||
68 | + continue; | ||
69 | + lstat(dent->d_name, &st); | ||
70 | + name = dent->d_name; | ||
71 | + | ||
72 | + switch(st.st_mode & S_IFMT) { | ||
73 | + case S_IFCHR: | ||
74 | + case S_IFBLK: | ||
75 | + case S_IFIFO: | ||
76 | + if ((retval = do_mknod_internal(parent_ino, name, &st))) { | ||
77 | + com_err(__func__, retval, | ||
78 | + _("while creating special file \"%s\""), name); | ||
79 | + return retval; | ||
80 | + } | ||
81 | + break; | ||
82 | + case S_IFSOCK: | ||
83 | + /* FIXME: there is no make socket function atm. */ | ||
84 | + com_err(__func__, 0, | ||
85 | + _("ignoring socket file \"%s\""), name); | ||
86 | + continue; | ||
87 | + case S_IFLNK: | ||
88 | + if((read_cnt = readlink(name, ln_target, sizeof(ln_target))) == -1) { | ||
89 | + com_err(__func__, errno, | ||
90 | + _("while trying to readlink \"%s\""), name); | ||
91 | + return errno; | ||
92 | + } | ||
93 | + ln_target[read_cnt] = '\0'; | ||
94 | + if ((retval = do_symlink_internal(parent_ino, name, ln_target))) { | ||
95 | + com_err(__func__, retval, | ||
96 | + _("while writing symlink\"%s\""), name); | ||
97 | + return retval; | ||
98 | + } | ||
99 | + break; | ||
100 | + case S_IFREG: | ||
101 | + if ((retval = do_write_internal(parent_ino, name, name))) { | ||
102 | + com_err(__func__, retval, | ||
103 | + _("while writing file \"%s\""), name); | ||
104 | + return retval; | ||
105 | + } | ||
106 | + break; | ||
107 | + case S_IFDIR: | ||
108 | + if ((retval = do_mkdir_internal(parent_ino, name, &st))) { | ||
109 | + com_err(__func__, retval, | ||
110 | + _("while making dir \"%s\""), name); | ||
111 | + return retval; | ||
112 | + } | ||
113 | + if ((retval = ext2fs_namei(current_fs, root, parent_ino, name, &ino))) { | ||
114 | + com_err(name, retval, 0); | ||
115 | + return retval; | ||
116 | + } | ||
117 | + /* Populate the dir recursively*/ | ||
118 | + retval = populate_fs(ino, name); | ||
119 | + if (retval) { | ||
120 | + com_err(__func__, retval, _("while adding dir \"%s\""), name); | ||
121 | + return retval; | ||
122 | + } | ||
123 | + chdir(".."); | ||
124 | + break; | ||
125 | + default: | ||
126 | + com_err(__func__, 0, | ||
127 | + _("ignoring entry \"%s\""), name); | ||
128 | + } | ||
129 | + } | ||
130 | + closedir(dh); | ||
131 | + return retval; | ||
132 | } | ||
133 | -- | ||
134 | 1.7.10.4 | ||
135 | |||