summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/squashfs-tools
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2019-07-18 13:50:39 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-19 08:41:40 +0100
commitb4db437f11d47593177b3fdf9d59061c0cafe957 (patch)
tree8e5e3896b3827ca95c3f15ba76422788ff7a4583 /meta/recipes-devtools/squashfs-tools
parentf06689bff20b1aff723aaa1c9a011d584fba3780 (diff)
downloadpoky-b4db437f11d47593177b3fdf9d59061c0cafe957.tar.gz
squashfs-tools: upgrade to commit f95864afe883
The master branch's current tip commit as of this writing is [1], see the squashfs-tool's repo at [0]. Because of commits [2]-[4] which are included in the master branch three corresponding patches are dropped as they are not needed anymore. The single remaining patch was rebased on top of [1] to apply cleanly. Commits [5] & [6] introduced interesting features, namely zstd support and reproducibility of created SquashFS images. They are reflected in two new PACKAGECONFIG options now, but only the latter ("reproducible") is appended to the default options as OE-core does not contain a recipe to build zstd at the moment (a working zstd recipe can be found e.g. in meta-rauc, see [7]). [0] https://github.com/plougher/squashfs-tools.git [1] f95864afe883 ("unsquashfs-4: Add more sanity checks + fix CVE-2015-4645/6") [2] 46bdc1726e5a ("mksquashfs: Make a load of functions static") [3] b0ca8a5c98ff ("pseudo.c: add explicit <sys/stat.h> include") [4] f95864afe883 ("unsquashfs-4: Add more sanity checks + fix CVE-2015-4645/6") [5] 6113361316d5 ("squashfs-tools: Add zstd support") [6] e0d74d07bb35 ("Add configuration and Mksquashfs build options for reproducible builds") [7] https://layers.openembedded.org/layerindex/recipe/79049/ (From OE-Core rev: 92f34fbe321040db3dc0431dd464747324058e2e) Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/squashfs-tools')
-rw-r--r--meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch154
-rw-r--r--meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch47
-rw-r--r--meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch17
-rw-r--r--meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch2
-rw-r--r--meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb9
5 files changed, 5 insertions, 224 deletions
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch
deleted file mode 100644
index a5bab05448..0000000000
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch
+++ /dev/null
@@ -1,154 +0,0 @@
1From ac6268e843c43286eebff2a1052182c2393cdb2e Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Mon, 14 Sep 2015 12:31:42 +0800
4Subject: [PATCH] mksquashfs.c: get inline functions work with both gnu11 and gnu89
5
6Upstream-Status: Pending
7
8After gcc upgraded to gcc5, and if the codes is compiled without optimization(-O0),
9and the below error will happen:
10
11| mksquashfs.o: In function `create_inode':
12| git/squashfs-tools/mksquashfs.c:897: undefined reference to `get_inode_no'
13| git/squashfs-tools/mksquashfs.c:960: undefined reference to `get_parent_no'
14| git/squashfs-tools/mksquashfs.c:983: undefined reference to `get_parent_no'
15| mksquashfs.o: In function `reader_read_process':
16| git/squashfs-tools/mksquashfs.c:2132: undefined reference to `is_fragment'
17| mksquashfs.o: In function `reader_read_file':
18| git/squashfs-tools/mksquashfs.c:2228: undefined reference to `is_fragment'
19| mksquashfs.o: In function `dir_scan':
20| git/squashfs-tools/mksquashfs.c:3101: undefined reference to `create_dir_entry'
21
22gcc5 defaults to -std=gnu11 instead of -std=gnu89, and it requires that exactly one C
23source file has the callable copy of the inline function. Consider the following
24program:
25
26 inline int
27 foo (void)
28 {
29 return 42;
30 }
31
32 int
33 main (void)
34 {
35 return foo ();
36 }
37
38The program above will not link with the C99 inline semantics, because no out-of-line
39function foo is generated. To fix this, either mark the function foo as static, or
40add the following declaration:
41 static inline int foo (void);
42
43more information refer to: https://gcc.gnu.org/gcc-5/porting_to.html;
44
45but the use of "extern inline" will lead to the compilation issue if gcc is not
46gcc5, as the commit in oe-core d0af30c92fde [alsa-lib: Change function type to
47"static __inline__"]
48 "extern __inline__ function()" is the inlined version that
49 can be used in this compilation unit, but there will be another
50 definition of this function somewhere, so compiler will not emit
51 any code for the function body. This causes problem in -O0,
52 where functions are never inlined, the function call is preserved,
53 but linker can't find the symbol, thus the error happens.
54
55so replace "inline" with "static inline" to make it work with both gnu11 and gnu89
56
57Signed-off-by: Roy Li <rongqing.li@windriver.com>
58---
59 squashfs-tools/mksquashfs.c | 20 ++++++++++----------
60 1 file changed, 10 insertions(+), 10 deletions(-)
61
62diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
63index d221c35..6bba1d2 100644
64--- a/squashfs-tools/mksquashfs.c
65+++ b/squashfs-tools/mksquashfs.c
66@@ -828,13 +828,13 @@ char *subpathname(struct dir_ent *dir_ent)
67 }
68
69
70-inline unsigned int get_inode_no(struct inode_info *inode)
71+static inline unsigned int get_inode_no(struct inode_info *inode)
72 {
73 return inode->inode_number;
74 }
75
76
77-inline unsigned int get_parent_no(struct dir_info *dir)
78+static inline unsigned int get_parent_no(struct dir_info *dir)
79 {
80 return dir->depth ? get_inode_no(dir->dir_ent->inode) : inode_no;
81 }
82@@ -2027,7 +2027,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
83 }
84
85
86-inline int is_fragment(struct inode_info *inode)
87+static inline int is_fragment(struct inode_info *inode)
88 {
89 off_t file_size = inode->buf.st_size;
90
91@@ -2996,13 +2996,13 @@ struct inode_info *lookup_inode2(struct stat *buf, int pseudo, int id)
92 }
93
94
95-inline struct inode_info *lookup_inode(struct stat *buf)
96+static inline struct inode_info *lookup_inode(struct stat *buf)
97 {
98 return lookup_inode2(buf, 0, 0);
99 }
100
101
102-inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
103+static inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
104 {
105 if (inode->inode_number == 0) {
106 inode->inode_number = use_this ? : inode_no ++;
107@@ -3013,7 +3013,7 @@ inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
108 }
109
110
111-inline struct dir_ent *create_dir_entry(char *name, char *source_name,
112+static inline struct dir_ent *create_dir_entry(char *name, char *source_name,
113 char *nonstandard_pathname, struct dir_info *dir)
114 {
115 struct dir_ent *dir_ent = malloc(sizeof(struct dir_ent));
116@@ -3031,7 +3031,7 @@ inline struct dir_ent *create_dir_entry(char *name, char *source_name,
117 }
118
119
120-inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
121+static inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
122 struct inode_info *inode_info)
123 {
124 struct dir_info *dir = dir_ent->our_dir;
125@@ -3047,7 +3047,7 @@ inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
126 }
127
128
129-inline void add_dir_entry2(char *name, char *source_name,
130+static inline void add_dir_entry2(char *name, char *source_name,
131 char *nonstandard_pathname, struct dir_info *sub_dir,
132 struct inode_info *inode_info, struct dir_info *dir)
133 {
134@@ -3059,7 +3059,7 @@ inline void add_dir_entry2(char *name, char *source_name,
135 }
136
137
138-inline void free_dir_entry(struct dir_ent *dir_ent)
139+static inline void free_dir_entry(struct dir_ent *dir_ent)
140 {
141 if(dir_ent->name)
142 free(dir_ent->name);
143@@ -3080,7 +3080,7 @@ inline void free_dir_entry(struct dir_ent *dir_ent)
144 }
145
146
147-inline void add_excluded(struct dir_info *dir)
148+static inline void add_excluded(struct dir_info *dir)
149 {
150 dir->excluded ++;
151 }
152--
1531.9.1
154
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch
deleted file mode 100644
index 2261ea94b7..0000000000
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 3c0d67184d6edb63f3b7d6d5eb81531daa6388f3 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Tue, 28 Aug 2018 16:25:36 +0800
4Subject: [PATCH] squashfs-tools: patch for CVE-2015-4645(6)
5
6Upstream-Status: Backport[https://github.com/devttys0/sasquatch/pull/
7 5/commits/6777e08cc38bc780d27c69c1d8c272867b74524f]
8
9CVE: CVE-2015-4645 CVE-2015-4646
10
11Signed-off-by: Changqing Li <changqing.li@windriver.com>
12---
13 squashfs-tools/unsquash-4.c | 11 ++++++++---
14 1 file changed, 8 insertions(+), 3 deletions(-)
15
16diff --git a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c
17index ecdaac7..692ae25 100644
18--- a/squashfs-tools/unsquash-4.c
19+++ b/squashfs-tools/unsquash-4.c
20@@ -31,9 +31,9 @@ static unsigned int *id_table;
21 int read_fragment_table_4(long long *directory_table_end)
22 {
23 int res, i;
24- int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
25- int indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
26- long long fragment_table_index[indexes];
27+ size_t bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
28+ size_t indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
29+ long long *fragment_table_index;
30
31 TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
32 "from 0x%llx\n", sBlk.s.fragments, indexes,
33@@ -43,6 +43,11 @@ int read_fragment_table_4(long long *directory_table_end)
34 *directory_table_end = sBlk.s.fragment_table_start;
35 return TRUE;
36 }
37+
38+ fragment_table_index = malloc(indexes*sizeof(long long));
39+ if(fragment_table_index == NULL)
40+ EXIT_UNSQUASH("read_fragment_table: failed to allocate "
41+ "fragment table index\n");
42
43 fragment_table = malloc(bytes);
44 if(fragment_table == NULL)
45--
462.7.4
47
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
deleted file mode 100644
index 87c1e8cac0..0000000000
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1include missing sys/stat.h for stat* function declarations
2
3Upstream-Status: Pending
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Index: squashfs-tools/pseudo.c
7===================================================================
8--- squashfs-tools.orig/pseudo.c
9+++ squashfs-tools/pseudo.c
10@@ -32,6 +32,7 @@
11 #include <stdlib.h>
12 #include <sys/types.h>
13 #include <sys/wait.h>
14+#include <sys/stat.h>
15 #include <ctype.h>
16
17 #include "pseudo.h"
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch
index 39521a7d8b..f2e88f416a 100644
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch
@@ -19,7 +19,7 @@ sys/types.h might not always include sys/sysmacros.h for major/minor/makedev
19 #include "squashfs_fs.h" 19 #include "squashfs_fs.h"
20--- a/squashfs-tools/unsquashfs.c 20--- a/squashfs-tools/unsquashfs.c
21+++ b/squashfs-tools/unsquashfs.c 21+++ b/squashfs-tools/unsquashfs.c
22@@ -38,6 +38,10 @@ 22@@ -40,6 +40,10 @@
23 #include <limits.h> 23 #include <limits.h>
24 #include <ctype.h> 24 #include <ctype.h>
25 25
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
index dc1568a77c..ab2ff01b62 100644
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -6,12 +6,9 @@ LICENSE = "GPL-2"
6LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 6LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7 7
8PV = "4.3+gitr${SRCPV}" 8PV = "4.3+gitr${SRCPV}"
9SRCREV = "9c1db6d13a51a2e009f0027ef336ce03624eac0d" 9SRCREV = "f95864afe8833fe3ad782d714b41378e860977b1"
10SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \ 10SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \
11 file://0001-mksquashfs.c-get-inline-functions-work-with-C99.patch;striplevel=2 \
12 file://squashfs-tools-4.3-sysmacros.patch;striplevel=2 \ 11 file://squashfs-tools-4.3-sysmacros.patch;striplevel=2 \
13 file://fix-compat.patch \
14 file://0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch;striplevel=2 \
15" 12"
16UPSTREAM_CHECK_COMMITS = "1" 13UPSTREAM_CHECK_COMMITS = "1"
17SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759" 14SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759"
@@ -24,13 +21,15 @@ COMPATIBLE_HOST_libc-musl = 'null'
24 21
25EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}" 22EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}"
26 23
27PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr" 24PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr reproducible"
28PACKAGECONFIG[gzip] = "GZIP_SUPPORT=1,GZIP_SUPPORT=0,zlib" 25PACKAGECONFIG[gzip] = "GZIP_SUPPORT=1,GZIP_SUPPORT=0,zlib"
29PACKAGECONFIG[xz] = "XZ_SUPPORT=1,XZ_SUPPORT=0,xz" 26PACKAGECONFIG[xz] = "XZ_SUPPORT=1,XZ_SUPPORT=0,xz"
30PACKAGECONFIG[lzo] = "LZO_SUPPORT=1,LZO_SUPPORT=0,lzo" 27PACKAGECONFIG[lzo] = "LZO_SUPPORT=1,LZO_SUPPORT=0,lzo"
31PACKAGECONFIG[lz4] = "LZ4_SUPPORT=1,LZ4_SUPPORT=0,lz4" 28PACKAGECONFIG[lz4] = "LZ4_SUPPORT=1,LZ4_SUPPORT=0,lz4"
32PACKAGECONFIG[lzma] = "LZMA_XZ_SUPPORT=1,LZMA_XZ_SUPPORT=0,xz" 29PACKAGECONFIG[lzma] = "LZMA_XZ_SUPPORT=1,LZMA_XZ_SUPPORT=0,xz"
33PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" 30PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr"
31PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd"
32PACKAGECONFIG[reproducible] = "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0,"
34 33
35do_compile() { 34do_compile() {
36 oe_runmake mksquashfs unsquashfs 35 oe_runmake mksquashfs unsquashfs