Browse Source

Merge pull request #2249 from commodo/squashfs-tools

squashfs-tools: bring back package
Hannu Nyman 8 years ago
parent
commit
1e7bbd85a6

+ 17
- 0
utils/squashfs-tools/Config.in View File

@@ -0,0 +1,17 @@
1
+config SQUASHFS_TOOLS_LZO_SUPPORT
2
+	depends on PACKAGE_squashfs-tools-mksquashfs || PACKAGE_squashfs-tools-unsquashfs
3
+	bool "Enable LZO support"
4
+	select PACKAGE_liblzo
5
+	default y
6
+
7
+config SQUASHFS_TOOLS_LZ4_SUPPORT
8
+	depends on PACKAGE_squashfs-tools-mksquashfs || PACKAGE_squashfs-tools-unsquashfs
9
+	bool "Enable LZ4 support"
10
+	select PACKAGE_liblz4
11
+	default y
12
+
13
+config SQUASHFS_TOOLS_XZ_SUPPORT
14
+	depends on PACKAGE_squashfs-tools-mksquashfs || PACKAGE_squashfs-tools-unsquashfs
15
+	bool "Enable XZ support"
16
+	select PACKAGE_liblzma
17
+	default y

+ 86
- 0
utils/squashfs-tools/Makefile View File

@@ -0,0 +1,86 @@
1
+# 
2
+# Copyright (C) 2016 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=squashfs-tools
11
+PKG_VERSION:=4.3
12
+PKG_RELEASE:=1
13
+PKG_LICENSE:=GPL-2.0
14
+PKG_LICENSE_FILES:=COPYING
15
+
16
+PKG_SOURCE_PROTO:=git
17
+PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
18
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19
+PKG_SOURCE_VERSION:=9c1db6d13a51a2e009f0027ef336ce03624eac0d
20
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
21
+
22
+PKG_BUILD_PARALLEL:=1
23
+include $(INCLUDE_DIR)/package.mk
24
+
25
+define Package/squashfs-tools/Default
26
+  SECTION:=utils
27
+  CATEGORY:=Utilities
28
+  TITLE:=squashfs-tools
29
+  URL:=https://github.com/plougher/squashfs-tools
30
+  DEPENDS += +libpthread +zlib \
31
+	+SQUASHFS_TOOLS_LZO_SUPPORT:liblzo \
32
+	+SQUASHFS_TOOLS_LZ4_SUPPORT:liblz4 \
33
+	+SQUASHFS_TOOLS_XZ_SUPPORT:liblzma
34
+  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
35
+endef
36
+
37
+define Package/squashfs-tools-mksquashfs
38
+  $(call Package/squashfs-tools/Default)
39
+  TITLE+= mksquashfs
40
+endef
41
+
42
+define Package/squashfs-tools-unsquashfs
43
+  $(call Package/squashfs-tools/Default)
44
+  TITLE+= unsquashfs
45
+endef
46
+
47
+define Package/squashfs-tools-unsquashfs/config
48
+	source "$(SOURCE)/Config.in"
49
+endef
50
+
51
+Build/Configure:=
52
+
53
+MAKE_FLAGS += \
54
+	XATTR_SUPPORT=
55
+
56
+ifneq ($(CONFIG_SQUASHFS_TOOLS_XZ_SUPPORT),)
57
+MAKE_FLAGS += XZ_SUPPORT=1
58
+endif
59
+
60
+ifneq ($(CONFIG_SQUASHFS_TOOLS_LZO_SUPPORT),)
61
+MAKE_FLAGS += LZO_SUPPORT=1
62
+endif
63
+
64
+ifneq ($(CONFIG_SQUASHFS_TOOLS_LZ4_SUPPORT),)
65
+MAKE_FLAGS += LZ4_SUPPORT=1
66
+endif
67
+
68
+define Build/Compile
69
+	$(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \
70
+		CC="$(TARGET_CC)" \
71
+		$(MAKE_FLAGS) \
72
+		mksquashfs unsquashfs
73
+endef
74
+
75
+define Package/squashfs-tools-mksquashfs/install
76
+	$(INSTALL_DIR) $(1)/usr/sbin
77
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/mksquashfs $(1)/usr/sbin/mksquashfs
78
+endef
79
+
80
+define Package/squashfs-tools-unsquashfs/install
81
+	$(INSTALL_DIR) $(1)/usr/sbin
82
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/unsquashfs $(1)/usr/sbin/unsquashfs
83
+endef
84
+
85
+$(eval $(call BuildPackage,squashfs-tools-mksquashfs))
86
+$(eval $(call BuildPackage,squashfs-tools-unsquashfs))

+ 120
- 0
utils/squashfs-tools/patches/0001-squashfs-tools-fix-fnmatch.h-compatibility-with-musl.patch View File

@@ -0,0 +1,120 @@
1
+From a0c129760ca9bdc7e564ae2a508fac3799f9d39b Mon Sep 17 00:00:00 2001
2
+From: Alexandru Ardelean <aa@ocedo.com>
3
+Date: Wed, 6 Jan 2016 15:33:43 +0200
4
+Subject: [PATCH 1/2] squashfs-tools: with fnmatch.h compatibility with musl
5
+
6
+Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
7
+---
8
+ squashfs-tools/action.c         |  2 +-
9
+ squashfs-tools/fnmatch_compat.h | 32 ++++++++++++++++++++++++++++++++
10
+ squashfs-tools/mksquashfs.c     |  2 +-
11
+ squashfs-tools/unsquashfs.c     |  1 +
12
+ squashfs-tools/unsquashfs.h     |  1 -
13
+ 5 files changed, 35 insertions(+), 3 deletions(-)
14
+ create mode 100644 squashfs-tools/fnmatch_compat.h
15
+
16
+diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
17
+index 35889a4..4b06ccb 100644
18
+--- a/squashfs-tools/action.c
19
++++ b/squashfs-tools/action.c
20
+@@ -31,7 +31,6 @@
21
+ #include <sys/stat.h>
22
+ #include <sys/types.h>
23
+ #include <unistd.h>
24
+-#include <fnmatch.h>
25
+ #include <pwd.h>
26
+ #include <grp.h>
27
+ #include <sys/wait.h>
28
+@@ -43,6 +42,7 @@
29
+ #include "mksquashfs.h"
30
+ #include "action.h"
31
+ #include "error.h"
32
++#include "fnmatch_compat.h"
33
+ 
34
+ /*
35
+  * code to parse actions
36
+diff --git a/squashfs-tools/fnmatch_compat.h b/squashfs-tools/fnmatch_compat.h
37
+new file mode 100644
38
+index 0000000..7b4afd8
39
+--- /dev/null
40
++++ b/squashfs-tools/fnmatch_compat.h
41
+@@ -0,0 +1,32 @@
42
++#ifndef FNMATCH_COMPAT
43
++#define FNMATCH_COMPAT
44
++/*
45
++ * Squashfs
46
++ *
47
++ * Copyright (c) 2015
48
++ * Phillip Lougher <phillip@squashfs.org.uk>
49
++ *
50
++ * This program is free software; you can redistribute it and/or
51
++ * modify it under the terms of the GNU General Public License
52
++ * as published by the Free Software Foundation; either version 2,
53
++ * or (at your option) any later version.
54
++ *
55
++ * This program is distributed in the hope that it will be useful,
56
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
57
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
58
++ * GNU General Public License for more details.
59
++ *
60
++ * You should have received a copy of the GNU General Public License
61
++ * along with this program; if not, write to the Free Software
62
++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
63
++ *
64
++ * fnmatch_compat.h
65
++ */
66
++
67
++#include <fnmatch.h>
68
++
69
++#ifndef FNM_EXTMATCH
70
++#define FNM_EXTMATCH	0
71
++#endif
72
++
73
++#endif
74
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
75
+index d221c35..4e7cbdd 100644
76
+--- a/squashfs-tools/mksquashfs.c
77
++++ b/squashfs-tools/mksquashfs.c
78
+@@ -46,7 +46,6 @@
79
+ #include <sys/mman.h>
80
+ #include <pthread.h>
81
+ #include <regex.h>
82
+-#include <fnmatch.h>
83
+ #include <sys/wait.h>
84
+ #include <limits.h>
85
+ #include <ctype.h>
86
+@@ -76,6 +75,7 @@
87
+ #include "read_fs.h"
88
+ #include "restore.h"
89
+ #include "process_fragments.h"
90
++#include "fnmatch_compat.h"
91
+ 
92
+ int delete = FALSE;
93
+ int fd;
94
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
95
+index 1323dd6..2428baa 100644
96
+--- a/squashfs-tools/unsquashfs.c
97
++++ b/squashfs-tools/unsquashfs.c
98
+@@ -30,6 +30,7 @@
99
+ #include "xattr.h"
100
+ #include "unsquashfs_info.h"
101
+ #include "stdarg.h"
102
++#include "fnmatch_compat.h"
103
+ 
104
+ #include <sys/sysinfo.h>
105
+ #include <sys/types.h>
106
+diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
107
+index ecd0bb4..0edbd25 100644
108
+--- a/squashfs-tools/unsquashfs.h
109
++++ b/squashfs-tools/unsquashfs.h
110
+@@ -40,7 +40,6 @@
111
+ #include <grp.h>
112
+ #include <time.h>
113
+ #include <regex.h>
114
+-#include <fnmatch.h>
115
+ #include <signal.h>
116
+ #include <pthread.h>
117
+ #include <math.h>
118
+-- 
119
+2.1.4
120
+

+ 25
- 0
utils/squashfs-tools/patches/0002-pseudo.c-add-explicit-stat.h-include.patch View File

@@ -0,0 +1,25 @@
1
+From 0ea07a1b5ddb2f2fa1358b2c1b42bcf34bbf5ee2 Mon Sep 17 00:00:00 2001
2
+From: Alexandru Ardelean <aa@ocedo.com>
3
+Date: Wed, 6 Jan 2016 15:36:48 +0200
4
+Subject: [PATCH 2/2] pseudo.c: add explicit <stat.h> include
5
+
6
+Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
7
+---
8
+ squashfs-tools/pseudo.c | 1 +
9
+ 1 file changed, 1 insertion(+)
10
+
11
+diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
12
+index f85fe60..7a26bca 100644
13
+--- a/squashfs-tools/pseudo.c
14
++++ b/squashfs-tools/pseudo.c
15
+@@ -32,6 +32,7 @@
16
+ #include <stdlib.h>
17
+ #include <sys/types.h>
18
+ #include <sys/wait.h>
19
++#include <sys/stat.h>
20
+ #include <ctype.h>
21
+ 
22
+ #include "pseudo.h"
23
+-- 
24
+2.1.4
25
+