gluon/patches/openwrt/0184-tools-squashfs4-include-sysmacros.h-explicitly.patch
Linus Lüssing 0a150e97d4 openwrt: update tools to LEDE v17.01.6 to fix compile issues
This updates:

* m4
* bison
* e2fsprogs
* make_ext4fs
* mtd-utils
* findutils
* squashfs
* squashfs4
* grub2

to their version used in LEDE v17.01.6. This fixes various compile
errors appearing on Debian Sid.

A list of the patches picked from upstream:

m4:

$ git log --oneline f7e56763e1..HEAD tools/m4
6e78c5502c tools: m4: fix compilation with glibc 2.28
a91d8dd162 tools/m4: update 1.4.18
f19d47f848 tools: patch various gnu tools for macOS 10.13
720b99215d treewide: clean up download hashes

bison:

$ git log --oneline 877f2972d4..HEAD tools/bison
1e09cbf118 tools/bison: Update to 3.0.5
f19d47f848 tools: patch various gnu tools for macOS 10.13
720b99215d treewide: clean up download hashes
5062cff673 tools/bison: update to 3.0.4

e2fsprogs:

$ git log --oneline f7e56763e1..HEAD tools/e2fsprogs/
8f5c55f63e tools/e2fsprogs: update to 1.44.1
d35a7bf4b4 e2fsprogs: bump to 1.44.0
79ac69d9c9 tools/e2fsprogs: Update to 1.43.7
5d9114c9cb tools/e2fsprogs: Update to 1.43.6
7955fab22a tools/e2fsprogs: Update to 1.43.5
866e5b4956 tools/e2fsprogs: Update to 1.43.4
a964738a5c Revert "tools/e2fsprogs: fix building on a glibc 2.27 host"
58a95f0f8f tools/e2fsprogs: fix building on a glibc 2.27 host
720b99215d treewide: clean up download hashes
b8b807b1a9 tools/e2fsprogs: Update to 1.43.3
d635ef50c5 e2fsprogs: fix build problem with very old libmagic
819cf75c40 tools: e2fsprogs: bump to 1.43.1
2baf90a84e tools/e2fsprogs: remove outdated configure args
b7e946f33e tools/e2fsprogs: update to 1.42.13
52ea491bdf tools/e2fsprogs: add a darwin-compat patch

make-ext4fs:

$ git log --oneline 1170a3de76..HEAD tools/make-ext4fs/
c7c1cf5618 treewide: clean up and unify PKG_VERSION for git based downloads
720b99215d treewide: clean up download hashes
9edfe7dd13 source: Switch to xz for packages and tools where possible
95bad62f2a tools: make_ext4fs: switch to LEDE git mirror
98b960c218 tools: make_ext4fs: support creating empty filesystem images
9ec4ca525c tools: make-ext4fs: fix build regression on mac os x
49ad0c565a tools: fix make_ext4fs build with recent glibc
8af9119ff4 tools: make-ext4fs: explicitely request C collation for sorting
01fb448d56 tools/make-ext4fs: prefer static linking

$ git log --oneline 17ae95bb20..HEAD tools/mtd-utils
96dbf59e5a tools/mtd-utils: include sysmacros.h explicitly
018d80007e kernel: remove ubifs xz decompression support
c7c1cf5618 treewide: clean up and unify PKG_VERSION for git based downloads
720b99215d treewide: clean up download hashes
9edfe7dd13 source: Switch to xz for packages and tools where possible
e27c8bb156 update mtd-utils to 1.5.2

$ git log --oneline dd86bc73fb..HEAD tools/findutils
6449ed1553 tools: findutils: fix compilation with glibc 2.28
d2fd6412a6 tools/findutils: include sysmacros.h explicitly
720b99215d treewide: clean up download hashes
70a5c062f1 tools/findutils: Update to 4.6.0

$ git log --oneline f7e56763e1..HEAD tools/squashfs tools/squashfs4
1aedf2f149 tools/squashfs: use host cflags
8a48a53dcb tools/squashfs4: include sysmacros.h explicitly
8406e50df5 tools/squashfs: include sysmacros.h explicitly
720b99215d treewide: clean up download hashes
f97ad870e1 squashfs4: use upstream xz compression header format
d437c72c21 tools/squashfs4: refresh patches
34124de139 tools/squashfs: refresh patches
fd1c1b4918 tools/squashfs: add argument -fixed-time to set all timestamps

$ git log --oneline fcc6f801ca..HEAD package/boot/grub2/
2252731af4 grub2: rebase patches
6aae528cc3 grub2: Fix CVE-2015-8370
6e1e2e7b96 package/grub2: update to 2.02
10182cb2c6 grub2: update to 2.02~rc2
f0e8470aa9 grub2: update to 2.02~rc1
806d3cc2c3 packages: mark packages depending on a target as nonshared
65c8f2890c grub2: upgrade to 2.02-beta3 (3 years newer than previous)
77812cdfec grub2: disable 'check-macro-version' build rule in 'po' build
2b54fa4dff grub2: do not generate mkfonts at build time
b33845b2da grub2: add PKG_FIXUP:=autoreconf
720b99215d treewide: clean up download hashes
3c52cbfa53 Revert "grub2: add PKG_FIXUP:=autoreconf"
a0ea22ac43 grub2: add PKG_FIXUP:=autoreconf
f2752f4735 grub2: add missing SECTION variable and remove non breaking space
d140648622 grub2: move to Boot Loaders category
59e3a4714a grub2: switch back to installing to STAGING_DIR_HOST
9b01282515 grub2: disable stack-protector
25eddec9cb grub2: fix build against musl

$ git log --oneline 81a2f9d6f86
81a2f9d6f8 target/linux/x86/image: add explicit prefix to grub-mkimage command

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
2019-04-20 06:04:16 +02:00

200 lines
7.1 KiB
Diff

From: Alex Maclean <monkeh@monkeh.net>
Date: Mon, 23 Oct 2017 13:48:19 +0100
Subject: tools/squashfs4: include sysmacros.h explicitly
glibc is moving to remove the include of sys/sysmacros.h from
sys/types.h, and some distros have done this early. Other libcs may
already lack this include. Include sysmacros.h explicitly.
Fixes: FS#1017
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
[refresh patches]
Signed-off-by: Mathias Kresin <dev@kresin.me>
diff --git a/tools/squashfs4/patches/130-include_sysmacros.patch b/tools/squashfs4/patches/130-include_sysmacros.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e8845130ef71d00c6cf17eb550078f9bec894c1a
--- /dev/null
+++ b/tools/squashfs4/patches/130-include_sysmacros.patch
@@ -0,0 +1,20 @@
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -33,6 +33,7 @@
+ #include <stddef.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -30,6 +30,7 @@
+ #include "xattr.h"
+
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_deflate, *to_writer, *from_writer;
diff --git a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
index ad69b190ea9f1d2335d7b83e8b0a26700dd5c05c..bc7d6c7a4a06b7ed62233a263dce68d935317621 100644
--- a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
+++ b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
@@ -16,7 +16,7 @@
#define SQUASHFS_METADATA_LOG 13
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
-@@ -1463,10 +1463,12 @@ int read_super(char *source)
+@@ -1464,10 +1464,12 @@ int read_super(char *source)
*/
read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block),
&sBlk_4);
@@ -31,7 +31,7 @@
sBlk_4.s_minor == 0) {
s_ops.squashfs_opendir = squashfs_opendir_4;
s_ops.read_fragment = read_fragment_4;
-@@ -1479,7 +1481,11 @@ int read_super(char *source)
+@@ -1480,7 +1482,11 @@ int read_super(char *source)
/*
* Check the compression type
*/
@@ -44,7 +44,7 @@
return TRUE;
}
-@@ -1494,8 +1500,10 @@ int read_super(char *source)
+@@ -1495,8 +1501,10 @@ int read_super(char *source)
* Check it is a SQUASHFS superblock
*/
swap = 0;
@@ -57,7 +57,7 @@
squashfs_super_block_3 sblk;
ERROR("Reading a different endian SQUASHFS filesystem "
"on %s\n", source);
-@@ -1573,7 +1581,11 @@ int read_super(char *source)
+@@ -1574,7 +1582,11 @@ int read_super(char *source)
/*
* 1.x, 2.x and 3.x filesystems use gzip compression.
*/
diff --git a/tools/squashfs4/patches/180-openbsd_compat.patch b/tools/squashfs4/patches/180-openbsd_compat.patch
index b9c1b5925d8526454a6bed5139bf6301a5896c02..4f7afd89cc914af1e2a05a469256a651beb4892d 100644
--- a/tools/squashfs4/patches/180-openbsd_compat.patch
+++ b/tools/squashfs4/patches/180-openbsd_compat.patch
@@ -8,8 +8,8 @@
+#include <sys/param.h>
+#endif
#include <sys/types.h>
+ #include <sys/sysmacros.h>
#include <sys/stat.h>
- #include <fcntl.h>
--- a/squashfs-tools/unsquashfs.h
+++ b/squashfs-tools/unsquashfs.h
@@ -25,6 +25,9 @@
diff --git a/tools/squashfs4/patches/190-no_nonstatic_inline.patch b/tools/squashfs4/patches/190-no_nonstatic_inline.patch
index 27ebc6a2639be8d3b303e34ab73e224f394d9b2d..8cab12083259492095016c8032a25b13b3fe8784 100644
--- a/tools/squashfs4/patches/190-no_nonstatic_inline.patch
+++ b/tools/squashfs4/patches/190-no_nonstatic_inline.patch
@@ -1,6 +1,6 @@
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
-@@ -735,13 +735,13 @@ void cache_block_put(struct file_buffer
+@@ -736,13 +736,13 @@ void cache_block_put(struct file_buffer
+ (((char *)A) - data_cache)))
@@ -16,7 +16,7 @@
{
pthread_mutex_lock(&progress_mutex);
pthread_cond_signal(&progress_wait);
-@@ -749,7 +749,7 @@ inline void update_progress_bar()
+@@ -750,7 +750,7 @@ inline void update_progress_bar()
}
@@ -25,7 +25,7 @@
{
TRACE("Waiting for thread %d\n", i);
while(thread[i] != 0)
-@@ -3358,7 +3358,7 @@ struct inode_info *lookup_inode(struct s
+@@ -3359,7 +3359,7 @@ struct inode_info *lookup_inode(struct s
}
diff --git a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
index 5cec51f7b7ea716b76fdb63db307728728f21f44..7411b97844978d5c7a4ec0030bd204a3fadb5c64 100644
--- a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
+++ b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
@@ -1,6 +1,6 @@
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
-@@ -175,6 +175,9 @@ unsigned int cache_bytes = 0, cache_size
+@@ -176,6 +176,9 @@ unsigned int cache_bytes = 0, cache_size
/* inode lookup table */
squashfs_inode *inode_lookup_table = NULL;
@@ -10,7 +10,7 @@
/* in memory directory data */
#define I_COUNT_SIZE 128
#define DIR_ENTRIES 32
-@@ -2452,6 +2455,8 @@ again:
+@@ -2453,6 +2456,8 @@ again:
restat:
fstat(file, &buf2);
close(file);
@@ -19,7 +19,7 @@
if(read_size != buf2.st_size) {
memcpy(buf, &buf2, sizeof(struct stat));
file_buffer->error = 2;
-@@ -3612,7 +3617,7 @@ void dir_scan(squashfs_inode *inode, cha
+@@ -3613,7 +3618,7 @@ void dir_scan(squashfs_inode *inode, cha
buf.st_mode = S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR;
buf.st_uid = getuid();
buf.st_gid = getgid();
@@ -28,7 +28,7 @@
buf.st_dev = 0;
buf.st_ino = 0;
dir_ent->inode = lookup_inode(&buf);
-@@ -3623,6 +3628,8 @@ void dir_scan(squashfs_inode *inode, cha
+@@ -3624,6 +3629,8 @@ void dir_scan(squashfs_inode *inode, cha
pathname, strerror(errno));
return;
}
@@ -37,7 +37,7 @@
dir_ent->inode = lookup_inode(&buf);
}
-@@ -3677,6 +3684,8 @@ struct dir_info *dir_scan1(char *pathnam
+@@ -3678,6 +3685,8 @@ struct dir_info *dir_scan1(char *pathnam
filename, strerror(errno));
continue;
}
@@ -46,7 +46,7 @@
if((buf.st_mode & S_IFMT) != S_IFREG &&
(buf.st_mode & S_IFMT) != S_IFDIR &&
-@@ -3795,7 +3804,7 @@ struct dir_info *dir_scan2(struct dir_in
+@@ -3796,7 +3805,7 @@ struct dir_info *dir_scan2(struct dir_in
buf.st_gid = pseudo_ent->dev->gid;
buf.st_rdev = makedev(pseudo_ent->dev->major,
pseudo_ent->dev->minor);
@@ -55,7 +55,7 @@
buf.st_ino = pseudo_ino ++;
if(pseudo_ent->dev->type == 'f') {
-@@ -4674,6 +4683,15 @@ int main(int argc, char *argv[])
+@@ -4675,6 +4684,15 @@ int main(int argc, char *argv[])
progress = FALSE;
else if(strcmp(argv[i], "-no-exports") == 0)
exportable = FALSE;
@@ -71,7 +71,7 @@
else if(strcmp(argv[i], "-processors") == 0) {
if((++i == argc) || (processors =
strtol(argv[i], &b, 10), *b != '\0')) {
-@@ -5314,7 +5332,7 @@ printOptions:
+@@ -5315,7 +5333,7 @@ printOptions:
sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, no_fragments,
always_use_fragments, duplicate_checking, exportable,
no_xattrs, comp_opts);