diff options
author | Saul Wold <sgw@linux.intel.com> | 2014-03-11 15:26:21 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-11 20:28:57 -0700 |
commit | 24d17244d42215227fae857215a807df54aded02 (patch) | |
tree | 4368238b1a8b05d800971336bfda8d80396231dc /meta/recipes-devtools | |
parent | 5ab5b77999d06ce7b8e4c789cf4eccf5c3ffc7a1 (diff) | |
download | poky-24d17244d42215227fae857215a807df54aded02.tar.gz |
btrfs: patch to allow for relative paths
This seems to address the btrfs image failure
[YOCTO #5146]
(From OE-Core rev: 9b22b32863f9110522362706a28036cc945201d5)
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/btrfs-tools/btrfs-tools/allow-relative-path.patch | 58 | ||||
-rw-r--r-- | meta/recipes-devtools/btrfs-tools/btrfs-tools_git.bb | 4 |
2 files changed, 61 insertions, 1 deletions
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/allow-relative-path.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/allow-relative-path.patch new file mode 100644 index 0000000000..695973eded --- /dev/null +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools/allow-relative-path.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From: Gui Hecheng <guihc.fnst@cn.fujitsu.com> | ||
2 | |||
3 | The bug accurs when exec: | ||
4 | # mkfs.btrfs -r <a relative path> <device> | ||
5 | (note: the path should be 'valid' correspond to your `pwd`) | ||
6 | error msg: | ||
7 | $ scandir for <a relative path> failed: No such file... | ||
8 | |||
9 | Replace strdup() with realpath() to get the correct scan path. | ||
10 | |||
11 | Upstream-Status: Backport (pending) | ||
12 | |||
13 | Reported-by: Saul Wold <sgw@linux.intel.com> | ||
14 | Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> | ||
15 | --- | ||
16 | mkfs.c | 5 ++--- | ||
17 | 1 file changed, 2 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/mkfs.c b/mkfs.c | ||
20 | index 2dc90c2..1bd3069 100644 | ||
21 | --- a/mkfs.c | ||
22 | +++ b/mkfs.c | ||
23 | @@ -756,6 +756,7 @@ static int traverse_directory(struct btrfs_trans_handle *trans, | ||
24 | ino_t parent_inum, cur_inum; | ||
25 | ino_t highest_inum = 0; | ||
26 | char *parent_dir_name; | ||
27 | + char real_path[PATH_MAX]; | ||
28 | struct btrfs_path path; | ||
29 | struct extent_buffer *leaf; | ||
30 | struct btrfs_key root_dir_key; | ||
31 | @@ -764,7 +765,7 @@ static int traverse_directory(struct btrfs_trans_handle *trans, | ||
32 | /* Add list for source directory */ | ||
33 | dir_entry = malloc(sizeof(struct directory_name_entry)); | ||
34 | dir_entry->dir_name = dir_name; | ||
35 | - dir_entry->path = strdup(dir_name); | ||
36 | + dir_entry->path = realpath(dir_name, real_path); | ||
37 | |||
38 | parent_inum = highest_inum + BTRFS_FIRST_FREE_OBJECTID; | ||
39 | dir_entry->inum = parent_inum; | ||
40 | @@ -876,7 +877,6 @@ static int traverse_directory(struct btrfs_trans_handle *trans, | ||
41 | } | ||
42 | |||
43 | free_namelist(files, count); | ||
44 | - free(parent_dir_entry->path); | ||
45 | free(parent_dir_entry); | ||
46 | |||
47 | index_cnt = 2; | ||
48 | @@ -887,7 +887,6 @@ static int traverse_directory(struct btrfs_trans_handle *trans, | ||
49 | fail: | ||
50 | free_namelist(files, count); | ||
51 | fail_no_files: | ||
52 | - free(parent_dir_entry->path); | ||
53 | free(parent_dir_entry); | ||
54 | return -1; | ||
55 | } | ||
56 | -- | ||
57 | 1.8.1.4 | ||
58 | |||
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_git.bb b/meta/recipes-devtools/btrfs-tools/btrfs-tools_git.bb index 7ecce60763..8129cd5e99 100644 --- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_git.bb +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_git.bb | |||
@@ -14,7 +14,9 @@ DEPENDS = "util-linux attr e2fsprogs lzo acl" | |||
14 | 14 | ||
15 | SRCREV = "8cae1840afb3ea44dcc298f32983e577480dfee4" | 15 | SRCREV = "8cae1840afb3ea44dcc298f32983e577480dfee4" |
16 | SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git \ | 16 | SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git \ |
17 | file://weak-defaults.patch" | 17 | file://weak-defaults.patch \ |
18 | file://allow-relative-path.patch \ | ||
19 | " | ||
18 | 20 | ||
19 | S = "${WORKDIR}/git" | 21 | S = "${WORKDIR}/git" |
20 | 22 | ||