commit: 90570e1f6327ec544bea1063b78c0f03a1e24120
parent a634c7fd3c187600231459ad9ea624ceb15336b0
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 30 May 2020 02:02:37 -0700
Remove squashfs-tools in favor of squashfs-tools-ng
Diffstat:
10 files changed, 1 insertion(+), 416 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -257,10 +257,6 @@
[submodule "pkg/sinit/src"]
path = pkg/sinit/src
url = git://git.suckless.org/sinit
-[submodule "pkg/squashfs-tools/src"]
- path = pkg/squashfs-tools/src
- url = https://github.com/plougher/squashfs-tools.git
- ignore = all
[submodule "pkg/squashfs-tools-ng/src"]
path = pkg/squashfs-tools-ng/src
url = https://github.com/AgentD/squashfs-tools-ng.git
diff --git a/pkg/gen.lua b/pkg/gen.lua
@@ -93,7 +93,6 @@ subgen 'sbase'
subgen 'sdhcp'
subgen 'sinit'
subgen 'skeleton'
-subgen 'squashfs-tools'
subgen 'squashfs-tools-ng'
subgen 'sshfs'
subgen 'st'
diff --git a/pkg/squashfs-tools/gen.lua b/pkg/squashfs-tools/gen.lua
@@ -1,47 +0,0 @@
-cflags{
- '-Wall',
- '-D _GNU_SOURCE',
- '-D REPRODUCIBLE_DEFAULT',
- '-D GZIP_SUPPORT',
- '-D ZSTD_SUPPORT',
- [[-D 'COMP_DEFAULT="zstd"']],
-}
-
-cc('squashfs-tools/gzip_wrapper.c', {'pkg/zlib/headers'}, {
- cflags='$cflags -I $builddir/pkg/zlib/include',
-})
-
-cc('squashfs-tools/zstd_wrapper.c', {'$basedir/pkg/zstd/fetch'}, {
- cflags='$cflags -I $basedir/pkg/zstd/src/lib -I $basedir/pkg/zstd/src/lib/common'
-})
-
-objects([[squashfs-tools/(swap.c compressor.c)]])
-
-exe('mksquashfs', [[
- squashfs-tools/(
- mksquashfs.c read_fs.c action.c swap.c.o pseudo.c compressor.c.o
- sort.c progressbar.c read_file.c info.c restore.c process_fragments.c
- caches-queues-lists.c
-
- gzip_wrapper.c.o
- zstd_wrapper.c.o
- )
- $builddir/pkg/zlib/libz.a
- $builddir/pkg/zstd/libzstd.a
-]])
-file('bin/mksquashfs', '755', '$outdir/mksquashfs')
-
-exe('unsquashfs', [[
- squashfs-tools/(
- unsquashfs.c unsquash-1.c unsquash-2.c unsquash-3.c
- unsquash-4.c unsquash-123.c unsquash-34.c swap.c.o compressor.c.o unsquashfs_info.c
-
- gzip_wrapper.c.o
- zstd_wrapper.c.o
- )
- $builddir/pkg/zlib/libz.a
- $builddir/pkg/zstd/libzstd.a
-]])
-file('bin/unsquashfs', '755', '$outdir/unsquashfs')
-
-fetch 'git'
diff --git a/pkg/squashfs-tools/patch/0001-Avoid-pointer-arithmetic-with-void.patch b/pkg/squashfs-tools/patch/0001-Avoid-pointer-arithmetic-with-void.patch
@@ -1,110 +0,0 @@
-From 7668bc8b07dec7eeb8f2682e50ae5c740c25c704 Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Thu, 30 Jan 2020 11:38:23 -0800
-Subject: [PATCH] Avoid pointer arithmetic with `void *`
-Upstream: https://github.com/plougher/squashfs-tools/pull/86
-
-`void *` is a pointer to an incomplete type, so cannot be used in
-pointer arithmetic.
----
- squashfs-tools/action.c | 2 +-
- squashfs-tools/mksquashfs.c | 10 +++++-----
- squashfs-tools/unsquashfs.c | 6 +++---
- 3 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
-index 4b06ccb..b107470 100644
---- a/squashfs-tools/action.c
-+++ b/squashfs-tools/action.c
-@@ -950,7 +950,7 @@ void *get_frag_action(void *fragment)
- if (fragment == &def_fragment)
- action = &fragment_spec[0] - 1;
- else
-- action = fragment - offsetof(struct action, data);
-+ action = (struct action *)((char *)fragment - offsetof(struct action, data));
-
- if (++action == spec_list_end)
- return NULL;
-diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
-index a45b77f..d9e7b01 100644
---- a/squashfs-tools/mksquashfs.c
-+++ b/squashfs-tools/mksquashfs.c
-@@ -516,7 +516,7 @@ int read_bytes(int fd, void *buff, int bytes)
- int res, count;
-
- for(count = 0; count < bytes; count += res) {
-- res = read(fd, buff + count, bytes - count);
-+ res = read(fd, (char *)buff + count, bytes - count);
- if(res < 1) {
- if(res == 0)
- goto bytes_read;
-@@ -563,7 +563,7 @@ int write_bytes(int fd, void *buff, int bytes)
- int res, count;
-
- for(count = 0; count < bytes; count += res) {
-- res = write(fd, buff + count, bytes - count);
-+ res = write(fd, (char *)buff + count, bytes - count);
- if(res == -1) {
- if(errno != EINTR) {
- ERROR("Write failed because %s\n",
-@@ -889,7 +889,7 @@ int create_inode(squashfs_inode *i_no, struct dir_info *dir_info,
- struct stat *buf = &dir_ent->inode->buf;
- union squashfs_inode_header inode_header;
- struct squashfs_base_inode_header *base = &inode_header.base;
-- void *inode;
-+ char *inode;
- char *filename = pathname(dir_ent);
- int nlink = dir_ent->inode->nlink;
- int xattr = read_xattrs(dir_ent);
-@@ -982,7 +982,7 @@ int create_inode(squashfs_inode *i_no, struct dir_info *dir_info,
- }
- else if(type == SQUASHFS_LDIR_TYPE) {
- int i;
-- unsigned char *p;
-+ char *p;
- struct squashfs_ldir_inode_header *dir = &inode_header.ldir;
- struct cached_dir_index *index = dir_in->index;
- unsigned int i_count = dir_in->i_count;
-@@ -1680,7 +1680,7 @@ long long generic_write_table(int length, void *buffer, int length2,
- for(i = 0; i < meta_blocks; i++) {
- int avail_bytes = length > SQUASHFS_METADATA_SIZE ?
- SQUASHFS_METADATA_SIZE : length;
-- c_byte = mangle(cbuffer + BLOCK_OFFSET, buffer + i *
-+ c_byte = mangle(cbuffer + BLOCK_OFFSET, (char *)buffer + i *
- SQUASHFS_METADATA_SIZE , avail_bytes,
- SQUASHFS_METADATA_SIZE, uncompressed, 0);
- SQUASHFS_SWAP_SHORTS(&c_byte, cbuffer, 1);
-diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
-index 727f1d5..5e8b2cb 100644
---- a/squashfs-tools/unsquashfs.c
-+++ b/squashfs-tools/unsquashfs.c
-@@ -640,7 +640,7 @@ int read_fs_bytes(int fd, long long byte, int bytes, void *buff)
- }
-
- for(count = 0; count < bytes; count += res) {
-- res = read(fd, buff + count, bytes - count);
-+ res = read(fd, (char *)buff + count, bytes - count);
- if(res < 1) {
- if(res == 0) {
- ERROR("Read on filesystem failed because "
-@@ -748,7 +748,7 @@ void *read_inode_table(long long start, long long end)
- int res;
- long long size = 0;
- long long bytes = 0;
-- void *inode_table = NULL;
-+ char *inode_table = NULL;
-
- TRACE("read_inode_table: start %lld, end %lld\n", start, end);
-
-@@ -1226,7 +1226,7 @@ void *read_directory_table(long long start, long long end)
- int res;
- long long bytes = 0;
- long long size = 0;
-- void *directory_table = malloc(1);
-+ char *directory_table = malloc(1);
-
- TRACE("read_directory_table: start %lld, end %lld\n", start, end);
-
---
-2.25.0
-
diff --git a/pkg/squashfs-tools/patch/0002-Don-t-omit-second-operand-to-conditional-operator.patch b/pkg/squashfs-tools/patch/0002-Don-t-omit-second-operand-to-conditional-operator.patch
@@ -1,54 +0,0 @@
-From 4f371cd8042d8b574a49d07c5bca1417e08d366c Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Thu, 30 Jan 2020 11:40:49 -0800
-Subject: [PATCH] Don't omit second operand to conditional operator
-Upstream: https://github.com/plougher/squashfs-tools/pull/86
-
-This is a GNU C extension, and not valid in ISO C.
----
- squashfs-tools/action.c | 5 ++++-
- squashfs-tools/mksquashfs.c | 4 ++--
- 2 files changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
-index b107470..38438dc 100644
---- a/squashfs-tools/action.c
-+++ b/squashfs-tools/action.c
-@@ -632,8 +632,11 @@ char *_expr_log(char *string, int cmnd)
- break;
- }
-
-+ size = strlen(string);
-+
- /* if string is empty append '\0' */
-- size = strlen(string) ? : 1;
-+ if (size == 0)
-+ size = 1;
-
- if(alloc_size - cur_size < size) {
- /* buffer too small, expand */
-diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
-index d9e7b01..a5d0e69 100644
---- a/squashfs-tools/mksquashfs.c
-+++ b/squashfs-tools/mksquashfs.c
-@@ -773,7 +773,7 @@ char *_pathname(struct dir_ent *dir_ent, char *pathname, int *size)
- for(;;) {
- int res = snprintf(pathname, *size, "%s/%s",
- dir_ent->our_dir->pathname,
-- dir_ent->source_name ? : dir_ent->name);
-+ dir_ent->source_name ? dir_ent->source_name : dir_ent->name);
-
- if(res < 0)
- BAD_ERROR("snprintf failed in pathname\n");
-@@ -3154,7 +3154,7 @@ static inline struct inode_info *lookup_inode(struct stat *buf)
- static inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
- {
- if (inode->inode_number == 0) {
-- inode->inode_number = use_this ? : inode_no ++;
-+ inode->inode_number = use_this ? use_this : inode_no ++;
- if((inode->buf.st_mode & S_IFMT) == S_IFREG)
- progress_bar_size((inode->buf.st_size + block_size - 1)
- >> block_log);
---
-2.25.0
-
diff --git a/pkg/squashfs-tools/patch/0003-Convert-TOK_TO_STR-to-an-inline-function.patch b/pkg/squashfs-tools/patch/0003-Convert-TOK_TO_STR-to-an-inline-function.patch
@@ -1,150 +0,0 @@
-From 5bab68afaeaab209cde2ddb8767f0aa3f5b30e9f Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Fri, 31 Jan 2020 17:59:06 -0800
-Subject: [PATCH] Convert TOK_TO_STR to an inline function
-Upstream: https://github.com/plougher/squashfs-tools/pull/86
-
-This avoids the use of statement expressions, which are a GNU C
-extension.
----
- squashfs-tools/action.c | 33 ++++++++++++++++++++++++---------
- squashfs-tools/action.h | 16 ----------------
- 2 files changed, 24 insertions(+), 25 deletions(-)
-
-diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
-index 38438dc..18505dc 100644
---- a/squashfs-tools/action.c
-+++ b/squashfs-tools/action.c
-@@ -91,6 +91,21 @@ extern char *subpathname(struct dir_ent *);
-
- extern int read_file(char *filename, char *type, int (parse_line)(char *));
-
-+static inline char *tok_to_str(int op, char *s)
-+{
-+ switch(op) {
-+ case TOK_EOF:
-+ s = "EOF";
-+ break;
-+ case TOK_STRING:
-+ break;
-+ default:
-+ s = token_table[op].string;
-+ break;
-+ }
-+ return s;
-+}
-+
- /*
- * Lexical analyser
- */
-@@ -321,7 +336,7 @@ static struct expr *parse_test(char *name)
- while(1) {
- if (token != TOK_STRING) {
- SYNTAX_ERROR("Unexpected token \"%s\", expected "
-- "argument\n", TOK_TO_STR(token, string));
-+ "argument\n", tok_to_str(token, string));
- goto failed;
- }
-
-@@ -338,7 +353,7 @@ static struct expr *parse_test(char *name)
-
- if (token != TOK_COMMA) {
- SYNTAX_ERROR("Unexpected token \"%s\", expected "
-- "\",\" or \")\"\n", TOK_TO_STR(token, string));
-+ "\",\" or \")\"\n", tok_to_str(token, string));
- goto failed;
- }
- token = get_token(&string);
-@@ -388,7 +403,7 @@ static struct expr *get_atom()
- default:
- SYNTAX_ERROR("Unexpected token \"%s\", expected test "
- "operation, \"!\", or \"(\"\n",
-- TOK_TO_STR(token, string));
-+ tok_to_str(token, string));
- return NULL;
- }
- }
-@@ -425,7 +440,7 @@ static struct expr *parse_expr(int subexp)
- if (op != TOK_AND && op != TOK_OR) {
- free_parse_tree(expr);
- SYNTAX_ERROR("Unexpected token \"%s\", expected "
-- "\"&&\" or \"||\"\n", TOK_TO_STR(op, string));
-+ "\"&&\" or \"||\"\n", tok_to_str(op, string));
- return NULL;
- }
-
-@@ -454,7 +469,7 @@ int parse_action(char *s, int verbose)
-
- if (token != TOK_STRING) {
- SYNTAX_ERROR("Unexpected token \"%s\", expected name\n",
-- TOK_TO_STR(token, string));
-+ tok_to_str(token, string));
- return 0;
- }
-
-@@ -476,7 +491,7 @@ int parse_action(char *s, int verbose)
-
- if (token != TOK_OPEN_BRACKET) {
- SYNTAX_ERROR("Unexpected token \"%s\", expected \"(\"\n",
-- TOK_TO_STR(token, string));
-+ tok_to_str(token, string));
- goto failed;
- }
-
-@@ -492,7 +507,7 @@ int parse_action(char *s, int verbose)
- while (1) {
- if (token != TOK_STRING) {
- SYNTAX_ERROR("Unexpected token \"%s\", expected "
-- "argument\n", TOK_TO_STR(token, string));
-+ "argument\n", tok_to_str(token, string));
- goto failed;
- }
-
-@@ -509,7 +524,7 @@ int parse_action(char *s, int verbose)
-
- if (token != TOK_COMMA) {
- SYNTAX_ERROR("Unexpected token \"%s\", expected "
-- "\",\" or \")\"\n", TOK_TO_STR(token, string));
-+ "\",\" or \")\"\n", tok_to_str(token, string));
- goto failed;
- }
- token = get_token(&string);
-@@ -537,7 +552,7 @@ skip_args:
-
- if (token != TOK_AT) {
- SYNTAX_ERROR("Unexpected token \"%s\", expected \"@\"\n",
-- TOK_TO_STR(token, string));
-+ tok_to_str(token, string));
- goto failed;
- }
-
-diff --git a/squashfs-tools/action.h b/squashfs-tools/action.h
-index 0a8de7c..156162d 100644
---- a/squashfs-tools/action.h
-+++ b/squashfs-tools/action.h
-@@ -38,22 +38,6 @@
- #define TOK_STRING 8
- #define TOK_EOF 9
-
--#define TOK_TO_STR(OP, S) ({ \
-- char *s; \
-- switch(OP) { \
-- case TOK_EOF: \
-- s = "EOF"; \
-- break; \
-- case TOK_STRING: \
-- s = S; \
-- break; \
-- default: \
-- s = token_table[OP].string; \
-- break; \
-- } \
-- s; \
--})
--
-
- struct token_entry {
- char *string;
---
-2.25.0
-
diff --git a/pkg/squashfs-tools/patch/0004-squashfs-tools-fix-build-failure-against-gcc-10.patch b/pkg/squashfs-tools/patch/0004-squashfs-tools-fix-build-failure-against-gcc-10.patch
@@ -1,47 +0,0 @@
-From 3559270ea30d2252b7007778fdefce530ed07a5e Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sun, 26 Jan 2020 18:35:13 +0000
-Subject: [PATCH] squashfs-tools: fix build failure against gcc-10
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Upstream: https://github.com/plougher/squashfs-tools/pull/83
-
-On gcc-10 (and gcc-9 -fno-common) build fails as:
-
-```
-cc ... -o mksquashfs
-ld: read_fs.o:(.bss+0x0):
- multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
-ld: read_fs.o:(.bss+0x8):
- multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
-```
-
-gcc-10 will change the default from -fcommon to fno-common:
-https://gcc.gnu.org/PR85678.
-
-The error also happens if CFLAGS=-fno-common passed explicitly.
-
-Reported-by: Toralf Förster
-Bug: https://bugs.gentoo.org/706456
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
----
- squashfs-tools/mksquashfs.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
-index 1beefef..b650306 100644
---- a/squashfs-tools/mksquashfs.h
-+++ b/squashfs-tools/mksquashfs.h
-@@ -143,7 +143,7 @@ struct append_file {
- #endif
-
- extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
--struct cache *bwriter_buffer, *fwriter_buffer;
-+extern struct cache *bwriter_buffer, *fwriter_buffer;
- extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
- *to_frag, *locked_fragment, *to_process_frag;
- extern struct append_file **file_mapping;
---
-2.25.0
-
diff --git a/pkg/squashfs-tools/src b/pkg/squashfs-tools/src
@@ -1 +0,0 @@
-Subproject commit 52eb4c279cd283ed9802dd1ceb686560b22ffb67
diff --git a/pkg/squashfs-tools/ver b/pkg/squashfs-tools/ver
@@ -1 +0,0 @@
-4.4 r2
diff --git a/sets.lua b/sets.lua
@@ -35,7 +35,7 @@ return {
'less',
'ncurses',
'python',
- 'squashfs-tools',
+ 'squashfs-tools-ng',
'the_silver_searcher',
'unzip',
'vis',