summaryrefslogtreecommitdiff
path: root/target/tools/squashfs
diff options
context:
space:
mode:
Diffstat (limited to 'target/tools/squashfs')
-rw-r--r--target/tools/squashfs/Makefile10
-rw-r--r--target/tools/squashfs/patches/cppflags.patch12
-rw-r--r--target/tools/squashfs/patches/honour-cflags.patch11
-rw-r--r--target/tools/squashfs/patches/squashfs-bsd.patch245
-rw-r--r--target/tools/squashfs/patches/uClibc-compat.patch24
5 files changed, 18 insertions, 284 deletions
diff --git a/target/tools/squashfs/Makefile b/target/tools/squashfs/Makefile
index bcc966274..94b3a0115 100644
--- a/target/tools/squashfs/Makefile
+++ b/target/tools/squashfs/Makefile
@@ -4,9 +4,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:= squashfs
-PKG_VERSION:= 4.0
-PKG_RELEASE:= 2
-PKG_MD5SUM:= a3c23391da4ebab0ac4a75021ddabf96
+PKG_VERSION:= 4.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1b7a781fb4cf8938842279bd3e8ee852
PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=squashfs/}
DISTFILES:= ${PKG_NAME}${PKG_VERSION}.tar.gz
@@ -17,7 +17,9 @@ include ../rules.mk
all: ${STAGING_HOST_DIR}/bin/mksquashfs
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
- ${MAKE} -C ${WRKBUILD}/squashfs-tools CC='${CC_FOR_BUILD}'
+ ${MAKE} -C ${WRKBUILD}/squashfs-tools CC='${CC_FOR_BUILD}' \
+ XZ_SUPPORT=1 CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD) \
+ EXTRA_LDFLAGS=$(LDFLAGS_FOR_BUILD)
touch $@
${STAGING_HOST_DIR}/bin/mksquashfs: $(WRKBUILD)/.compiled
diff --git a/target/tools/squashfs/patches/cppflags.patch b/target/tools/squashfs/patches/cppflags.patch
new file mode 100644
index 000000000..1432ea3cf
--- /dev/null
+++ b/target/tools/squashfs/patches/cppflags.patch
@@ -0,0 +1,12 @@
+diff -Nur squashfs4.2.orig/squashfs-tools/Makefile squashfs4.2/squashfs-tools/Makefile
+--- squashfs4.2.orig/squashfs-tools/Makefile 2011-02-28 21:04:15.000000000 +0100
++++ squashfs4.2/squashfs-tools/Makefile 2013-12-27 13:49:22.000000000 +0100
+@@ -93,7 +93,7 @@
+ # End of BUILD options section #
+ ###############################################
+
+-INCLUDEDIR = -I.
++INCLUDEDIR = -I. $(CPPFLAGS_FOR_BUILD)
+ INSTALL_DIR = /usr/local/bin
+
+ MKSQUASHFS_OBJS = mksquashfs.o read_fs.o sort.o swap.o pseudo.o compressor.o
diff --git a/target/tools/squashfs/patches/honour-cflags.patch b/target/tools/squashfs/patches/honour-cflags.patch
deleted file mode 100644
index a50d94263..000000000
--- a/target/tools/squashfs/patches/honour-cflags.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- squashfs4.0/squashfs-tools/Makefile~ Sun Apr 5 02:03:12 2009
-+++ squashfs4.0/squashfs-tools/Makefile Fri Jan 7 16:16:46 2011
-@@ -2,7 +2,7 @@ INSTALL_DIR = /usr/local/bin
-
- INCLUDEDIR = .
-
--CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2
-+CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2 ${CFLAGS_FOR_BUILD}
-
- all: mksquashfs unsquashfs
-
diff --git a/target/tools/squashfs/patches/squashfs-bsd.patch b/target/tools/squashfs/patches/squashfs-bsd.patch
deleted file mode 100644
index 578b9017f..000000000
--- a/target/tools/squashfs/patches/squashfs-bsd.patch
+++ /dev/null
@@ -1,245 +0,0 @@
---- squashfs4.0~/squashfs-tools/mksquashfs.c Sun Apr 5 21:22:24 2009
-+++ squashfs4.0/squashfs-tools/mksquashfs.c Fri Jan 7 20:36:08 2011
-@@ -24,6 +24,7 @@
- #define FALSE 0
- #define TRUE 1
-
-+#include <sys/param.h>
- #include <pwd.h>
- #include <grp.h>
- #include <time.h>
-@@ -3688,23 +3689,9 @@ void initialise_threads()
- signal(SIGUSR1, sigusr1_handler);
-
- if(processors == -1) {
--#ifndef linux
-- int mib[2];
-- size_t len = sizeof(processors);
--
-- mib[0] = CTL_HW;
--#ifdef HW_AVAILCPU
-- mib[1] = HW_AVAILCPU;
-+#if defined(BSD)
-+ processors = 1;
- #else
-- mib[1] = HW_NCPU;
--#endif
--
-- if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) {
-- ERROR("Failed to get number of available processors. "
-- "Defaulting to 1\n");
-- processors = 1;
-- }
--#else
- processors = get_nprocs();
- #endif
- }
-@@ -3974,9 +3961,15 @@ int excluded(struct pathnames *paths, ch
- int match = use_regex ?
- regexec(path->name[i].preg, name, (size_t) 0,
- NULL, 0) == 0 :
-+#if defined(BSD)
- fnmatch(path->name[i].name, name,
-+ FNM_PATHNAME|FNM_PERIOD) ==
-+ 0;
-+#else
-+ fnmatch(path->name[i].name, name,
- FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) ==
- 0;
-+#endif
-
- if(match && path->name[i].paths == NULL) {
- /* match on a leaf component, any subdirectories
---- squashfs4.0~/squashfs-tools/mksquashfs.h Thu Feb 19 18:30:44 2009
-+++ squashfs4.0/squashfs-tools/mksquashfs.h Fri Jan 7 20:40:01 2011
-@@ -24,7 +24,9 @@
- *
- */
-
--#if __BYTE_ORDER == __BIG_ENDIAN
-+#ifndef __BYTE_ORDER
-+#error Which endianness? __BYTE_ORDER is not defined.
-+#elif __BYTE_ORDER == __BIG_ENDIAN
- #define SQUASHFS_SWAP_SHORTS(s, d, n) swap_le16_num(s, d, n)
- #define SQUASHFS_SWAP_INTS(s, d, n) swap_le32_num(s, d, n)
- #define SQUASHFS_SWAP_LONG_LONGS(s, d, n) swap_le64_num(s, d, n)
-@@ -34,11 +36,13 @@
- #define SWAP_LE64(s, d, field) swap_le64(&((s)->field), &((d)->field))
- #define SWAP_LES16(s, d, field) swap_le16((unsigned short *) &((s)->field), \
- (unsigned short *) &((d)->field))
--#else
-+#elif __BYTE_ORDER == __LITTLE_ENDIAN
- #define SQUASHFS_MEMCPY(s, d, n) memcpy(d, s, n)
- #define SQUASHFS_SWAP_SHORTS(s, d, n) memcpy(d, s, n * sizeof(short))
- #define SQUASHFS_SWAP_INTS(s, d, n) memcpy(d, s, n * sizeof(int))
- #define SQUASHFS_SWAP_LONG_LONGS(s, d, n) \
- memcpy(d, s, n * sizeof(long long))
-+#else
-+#error Which endianness (PDP endian? Worse?)
- #endif
- #endif
---- squashfs4.0~/squashfs-tools/pseudo.c Sun Apr 5 02:01:34 2009
-+++ squashfs4.0/squashfs-tools/pseudo.c Fri Jan 7 20:35:31 2011
-@@ -30,6 +30,11 @@
- #include <string.h>
- #include <stdlib.h>
- #include <sys/types.h>
-+#include <sys/param.h>
-+
-+#if defined(BSD)
-+#include <sys/stat.h>
-+#endif
-
- #include "pseudo.h"
-
---- squashfs4.0~/squashfs-tools/read_fs.h Thu Feb 19 18:28:56 2009
-+++ squashfs4.0/squashfs-tools/read_fs.h Fri Jan 7 20:40:00 2011
-@@ -24,7 +24,9 @@
- *
- */
-
--#if __BYTE_ORDER == __BIG_ENDIAN
-+#ifndef __BYTE_ORDER
-+#error Which endianness? __BYTE_ORDER is not defined.
-+#elif __BYTE_ORDER == __BIG_ENDIAN
- #define SQUASHFS_SWAP_SHORTS(d, s, n) swap_le16_num(s, d, n)
- #define SQUASHFS_SWAP_INTS(d, s, n) swap_le32_num(s, d, n)
- #define SQUASHFS_SWAP_LONG_LONGS(d, s, n) swap_le64_num(s, d, n)
-@@ -34,11 +36,13 @@
- #define SWAP_LE64(d, s, field) swap_le64(&((s)->field), &((d)->field))
- #define SWAP_LES16(d, s, field) swap_le16((unsigned short *) &((s)->field), \
- (unsigned short *) &((d)->field))
--#else
-+#elif __BYTE_ORDER == __LITTLE_ENDIAN
- #define SQUASHFS_MEMCPY(d, s, n) memcpy(d, s, n)
- #define SQUASHFS_SWAP_SHORTS(d, s, n) memcpy(d, s, n * sizeof(short))
- #define SQUASHFS_SWAP_INTS(d, s, n) memcpy(d, s, n * sizeof(int))
- #define SQUASHFS_SWAP_LONG_LONGS(d, s, n) \
- memcpy(d, s, n * sizeof(long long))
-+#else
-+#error Which endianness (PDP endian? Worse?)
- #endif
- #endif
---- squashfs4.0~/squashfs-tools/squashfs_compat.h Mon Mar 16 04:27:03 2009
-+++ squashfs4.0/squashfs-tools/squashfs_compat.h Fri Jan 7 20:39:59 2011
-@@ -768,12 +768,16 @@ typedef union squashfs_inode_header_2 sq
- * macros used to swap each structure entry, taking into account
- * bitfields and different bitfield placing conventions on differing architectures
- */
--#if __BYTE_ORDER == __BIG_ENDIAN
-+#ifndef __BYTE_ORDER
-+#error Which endianness? __BYTE_ORDER is not defined.
-+#elif __BYTE_ORDER == __BIG_ENDIAN
- /* convert from big endian to little endian */
- #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, b_pos)
--#else
-+#elif __BYTE_ORDER == __LITTLE_ENDIAN
- /* convert from little endian to big endian */
- #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, 64 - tbits - b_pos)
-+#else
-+#error Which endianness (PDP endian? Worse?)
- #endif
-
- #define _SQUASHFS_SWAP(value, p, pos, tbits, SHIFT) {\
---- squashfs4.0~/squashfs-tools/squashfs_swap.h Fri Feb 20 19:41:56 2009
-+++ squashfs4.0/squashfs-tools/squashfs_swap.h Fri Jan 7 20:39:59 2011
-@@ -27,7 +27,9 @@
- * macros to convert each stucture from big endian to little endian
- */
-
--#if __BYTE_ORDER == __BIG_ENDIAN
-+#ifndef __BYTE_ORDER
-+#error Which endianness? __BYTE_ORDER is not defined.
-+#elif __BYTE_ORDER == __BIG_ENDIAN
- extern void swap_le16(unsigned short *, unsigned short *);
- extern void swap_le32(unsigned int *, unsigned int *);
- extern void swap_le64(long long *, long long *);
-@@ -256,7 +258,7 @@ extern void inswap_le64_num(long long *,
- #define SQUASHFS_INSWAP_SHORTS(s, n) inswap_le16_num(s, n)
- #define SQUASHFS_INSWAP_INTS(s, n) inswap_le32_num(s, n)
- #define SQUASHFS_INSWAP_LONG_LONGS(s, n) inswap_le64_num(s, n)
--#else
-+#elif __BYTE_ORDER == __LITTLE_ENDIAN
- #define SQUASHFS_SWAP_SUPER_BLOCK(s, d) \
- SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
- #define SQUASHFS_SWAP_DIR_INDEX(s, d) \
-@@ -308,5 +310,7 @@ extern void inswap_le64_num(long long *,
- #define SQUASHFS_INSWAP_SHORTS(s, n)
- #define SQUASHFS_INSWAP_INTS(s, n)
- #define SQUASHFS_INSWAP_LONG_LONGS(s, n)
-+#else
-+#error Which endianness (PDP endian? Worse?)
- #endif
- #endif
---- squashfs4.0~/squashfs-tools/swap.c Thu Mar 26 04:39:52 2009
-+++ squashfs4.0/squashfs-tools/swap.c Fri Jan 7 20:40:00 2011
-@@ -27,7 +27,9 @@
- #include <endian.h>
- #endif
-
--#if __BYTE_ORDER == __BIG_ENDIAN
-+#ifndef __BYTE_ORDER
-+#error Which endianness? __BYTE_ORDER is not defined.
-+#elif __BYTE_ORDER == __BIG_ENDIAN
- void swap_le16(unsigned short *src, unsigned short *dest)
- {
- unsigned char *s = (unsigned char *) src;
-@@ -120,4 +122,6 @@ void inswap_le##BITS##_num(TYPE *s, int
- INSWAP_LE_NUM(16, unsigned short)
- INSWAP_LE_NUM(32, unsigned int)
- INSWAP_LE_NUM(64, long long)
-+#elif __BYTE_ORDER != __LITTLE_ENDIAN
-+#error Which endianness (PDP endian? Worse?)
- #endif
---- squashfs4.0~/squashfs-tools/unsquashfs.c Sun Apr 5 21:22:42 2009
-+++ squashfs4.0/squashfs-tools/unsquashfs.c Fri Jan 7 20:35:31 2011
-@@ -21,6 +21,8 @@
- * unsquashfs.c
- */
-
-+#include <sys/param.h>
-+
- #include "unsquashfs.h"
- #include "squashfs_swap.h"
- #include "squashfs_compat.h"
-@@ -1193,10 +1195,17 @@ int matches(struct pathnames *paths, cha
- struct pathname *path = paths->path[n];
- for(i = 0; i < path->names; i++) {
- int match = use_regex ?
-+#if defined(BSD)
- regexec(path->name[i].preg, name, (size_t) 0,
- NULL, 0) == 0 : fnmatch(path->name[i].name,
-+ name, FNM_PATHNAME|FNM_PERIOD) ==
-+ 0;
-+#else
-+ regexec(path->name[i].preg, name, (size_t) 0,
-+ NULL, 0) == 0 : fnmatch(path->name[i].name,
- name, FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) ==
- 0;
-+#endif
- if(match && path->name[i].paths == NULL)
- /*
- * match on a leaf component, any subdirectories
-@@ -1795,21 +1804,7 @@ void initialise_threads(int fragment_buf
-
- if(processors == -1) {
- #ifndef linux
-- int mib[2];
-- size_t len = sizeof(processors);
--
-- mib[0] = CTL_HW;
--#ifdef HW_AVAILCPU
-- mib[1] = HW_AVAILCPU;
--#else
-- mib[1] = HW_NCPU;
--#endif
--
-- if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) {
-- ERROR("Failed to get number of available processors. "
-- "Defaulting to 1\n");
-- processors = 1;
-- }
-+ processors = 1;
- #else
- processors = get_nprocs();
- #endif
diff --git a/target/tools/squashfs/patches/uClibc-compat.patch b/target/tools/squashfs/patches/uClibc-compat.patch
deleted file mode 100644
index 00f2b22c0..000000000
--- a/target/tools/squashfs/patches/uClibc-compat.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Nur squashfs4.0.orig/squashfs-tools/mksquashfs.c squashfs4.0/squashfs-tools/mksquashfs.c
---- squashfs4.0.orig/squashfs-tools/mksquashfs.c 2009-04-05 23:22:48.000000000 +0200
-+++ squashfs4.0/squashfs-tools/mksquashfs.c 2011-03-18 22:04:00.000000000 +0100
-@@ -3705,7 +3705,7 @@
- processors = 1;
- }
- #else
-- processors = get_nprocs();
-+ processors = sysconf(_SC_NPROCESSORS_CONF);
- #endif
- }
-
-diff -Nur squashfs4.0.orig/squashfs-tools/unsquashfs.c squashfs4.0/squashfs-tools/unsquashfs.c
---- squashfs4.0.orig/squashfs-tools/unsquashfs.c 2009-04-05 23:23:06.000000000 +0200
-+++ squashfs4.0/squashfs-tools/unsquashfs.c 2011-03-18 22:03:31.000000000 +0100
-@@ -1811,7 +1811,7 @@
- processors = 1;
- }
- #else
-- processors = get_nprocs();
-+ processors = sysconf(_SC_NPROCESSORS_CONF);
- #endif
- }
-