summaryrefslogtreecommitdiff
path: root/sys-fs/squashfs-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/squashfs-tools
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/squashfs-tools')
-rw-r--r--sys-fs/squashfs-tools/Manifest19
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch30
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch15
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch121
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch19
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch35
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch24
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch25
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch34
-rw-r--r--sys-fs/squashfs-tools/metadata.xml15
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild39
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild39
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild75
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-9999.ebuild67
14 files changed, 557 insertions, 0 deletions
diff --git a/sys-fs/squashfs-tools/Manifest b/sys-fs/squashfs-tools/Manifest
new file mode 100644
index 000000000000..206875ada134
--- /dev/null
+++ b/sys-fs/squashfs-tools/Manifest
@@ -0,0 +1,19 @@
+AUX squashfs-tools-4.3-2gb.patch 961 SHA256 cdb9c85c2f733c0db879275d0ee2480f528aa3191f236bbf1ff681c75b14a024 SHA512 c45cad7822964ad4c74ea36fdd833fbfaf9e8e047726fa7a9517392bfa0b04a4de348bf3a511b071ac36d045c40cab0d8efeff054ebcd90b94f8508516b7dd71 WHIRLPOOL d3581d6014ecac4d4fa7a21e62829cb78c6ffa9fe148680d1fa43434bb1adb26c1dfb2f25fe58cfa22d16dbc2a922f7201a1d6bff94fd786456d28f445744e8f
+AUX squashfs-tools-4.3-aligned-data.patch 375 SHA256 3030ddfa5ba9d0baea7f5e4761b33dea67fbc4d49c86e475830fc1bfbfddb145 SHA512 566e2ada5e86afc799cb0c52396179bedfbcc49349bc6eb43c048b96215b1638c3765f7c75c6fa35593d5a95a1111df7c29a143ee4a55eaf33a6663e9bfe1b25 WHIRLPOOL 798dda9e91f3c68148e3f974caf62536745c1e22267d8e551903d49c3808a8e5a27ea1ac3787ef556823035d82d68a97974620f1f0871e7c14841c781899d077
+AUX squashfs-tools-4.3-extmatch.patch 3487 SHA256 2ec937250adfd97a72373e91225cead3070d987b4249ee487fd2d6caac74b235 SHA512 e034320ace6b992968d3f6776aeb0b94237619585e7fac195e917622b941bbfbddc62b625409f79fe7a1853ab58f76d6679c28320646b6883eb58183a3adfdea WHIRLPOOL 1f1057e8866666a06d06db99928a283e875720b09bb11e4cd3ce883716f64fcf4742889508cf4a720e37ae31cc5c4b942ef6e99c5bca97ddfd29e1d11a342472
+AUX squashfs-tools-4.3-local-cve-fix.patch 620 SHA256 7edceedead4f5a57dc009afecd0f414d60a3878dc43f8de5224bff391ed32c76 SHA512 8e308217136f8b50bc89b49017ae706978d5c8a42a74deeef268e9aaaf6ae5785926da99711462374dfc98f2f193840b0e016b1845be1f9bad168047e4574367 WHIRLPOOL 6eda9f29a2f5786cc7538bfe26b6ff632b0be6f361f963c7ad39c83608bc62c7e972074be264587d8e65d254812b1b715a57c0dd2ef5eedc9d424c9f53fc54e7
+AUX squashfs-tools-4.3-mem-overflow.patch 981 SHA256 a94f9df3439bef373da31a734e6dad42f5fc5a6d91f2b9d15d30b02f1aac73b3 SHA512 00db6700ab7fbf7f71aa97b45ac9c629dc5e7b1731c3e3eb5c93a0891c1b0f79884df7b6a8672facd9104e9442448ba9657dd10b64d47d89abd1b9ae1969dc2e WHIRLPOOL af0c8a6c4f3218abbc800516cfb58626563ab1967da8b86702ca523f1db22e006b71f93e23bb04b4bef48ae9c463ea1fdaecb4af371353f09b65375050c9fd59
+AUX squashfs-tools-4.3-musl.patch 688 SHA256 f18ebfe8de97702068825be2f92a7363939ccd0b4b0506662021f15b9b5d1c15 SHA512 61fb8eaedc4e649eb8fb362150cf5faef2289cb42514300f63448d164a12c9b21539ae49f6dc0d78fa1e4a3be01b26cb9084cec7f0159fe026fc1caa19df18dd WHIRLPOOL 44c451e0d2dabc9e90379b761f4623cd218740c69c20a9e5460d680243fea80b19d72d1f7645bb7b48b3a8a70bf8bb2277732f39129ca9f7a7b3cd74ba7c67ac
+AUX squashfs-tools-4.3-sysmacros.patch 611 SHA256 b44afb79ba6108a657fe6c51cecdf0e9623cbc91234b297478a6c3308cf0eddf SHA512 c21466b2f0aa6d6ae65b3693148274250bc42d8e7ea5142d6d4048d663ff4343dc539822320cf732d88c5bac048766a9771e1d2b739b1176cb9fafa96c4d306a WHIRLPOOL b0e0db62a80dc4c706dfd70ada83042ed5e66ecf881cf2b2055d09b838814571ac174a1f4c7a2a8bfc2ad242d10c717caa2ef03716b484f165d94d0e30f6e1d9
+AUX squashfs-tools-4.3-xattrs.patch 1076 SHA256 f98fb6bee2f46ba57b9ab68dbc1ad15ed5ac8c7592cbdfead36d6642096acada SHA512 3899bb72cabeb296eb12fdd1c2e77e82a4354e58c91c69be918950c7fc88f56fbc0265c915b7363704579b710a69a35312fa9ab3d43236900774ae97efd473a8 WHIRLPOOL b39d57dc7caa7468ea54396416485986c8867af1b2905f3b08266afb66b23484dda41b399fff1d0f80031c5b729c24af4a91908ed1239885fa3ce3368fdbf288
+DIST squashfs-tools_4.3-3.debian.tar.xz 15252 SHA256 1c296cc147e322e7124bf23a3c242ac83f6a986e6d6f64829ad2424b33914fc4 SHA512 ab1a707e04e92697549f7e7c667c5da835d39d5e2cb791e47bf549b232e7173e6981c33a87cd373c4a7a4815e4af1b7294fe13e54422a5ccdcff90904bfc51ae WHIRLPOOL 4f5a12a3371f2adced8f3a50b1d25db4420c2ff63856bbe74489e945c4698eb0e327ce677e442678849118f45351d01b14aef075ed78e6c09acb83ce56c99c3d
+DIST squashfs3.2-r2.tar.gz 314764 SHA256 8482465d58d78099c608b32fc034921f7c8c3cf7934b5edc68c463cd450b40a7 SHA512 983f1fa966c15fb4929eaaf2d88401aac72f6d04e8c5523bd46397bc28928ff13b638e0e96bc09650627449c37f6a654ffa727445f1e9ca13cdc9de4fc43012f WHIRLPOOL 14b22cfc16e5c9bc91a5e02b9d4b64589339162d59613b12c2344acbed34690616a7a0254d9a63f839e96ff4b850f30fd7e1e855aecb76423356f4b1d8582129
+DIST squashfs3.4.tar.gz 352660 SHA256 9ea1a9b3bd4f387ca11b5e96f00f8ae996fb81c4c7ad41f7c7f359917628a339 SHA512 5e126ea468271f54c62d473a04a355169514f2668b4dc0de4138a8ef2a6e633d373454e7b85c1c684b875d9dfc8afb17c05548dd5062d05f847ffef8e624d9fe WHIRLPOOL 7c113f3a66d0d28310302017e5f317d14bb5576e680a8f94e687193a376db92c54920be7d1121637f860cafa802d665ba419115e976b07029ca1f0c51953972d
+DIST squashfs4.3.tar.gz 182550 SHA256 0d605512437b1eb800b4736791559295ee5f60177e102e4d4ccd0ee241a5f3f6 SHA512 854ed7acc99920f24ecf11e0da807e5a2a162eeda55db971aba63a03f0da2c13b20ec0564a906c4b0e415bd8258b273a10208c7abc0704f2ceea773aa6148a79 WHIRLPOOL c819f416b34cc46a232b8bc385017774603f81b4a865e6b97208004c183ebad5de7d0f726be444f8cb4e1d450abed9340dab730aec0762407f034e99b39bdc06
+EBUILD squashfs-tools-3.2_p2.ebuild 953 SHA256 378ed13f72b193ae57f6e7dfa73e0497dd2dd576e2f02d6bb1d4065a32d75487 SHA512 989198cdeb688add1cd826743ab55b7ff33f0de87bf8338e4d6d14882dc79452ebf54fc393a41365e10efa22da1e0e0643f2ea50f4c4fabc8ab969517845f129 WHIRLPOOL e08b0d35c663be1e1bce2e583422549e53c13a731b25c2b41e0293d60a4e69434abd96f6189331da27947853aedb58006d959f76323ae47a5dccd1aa2fb05576
+EBUILD squashfs-tools-3.4.ebuild 937 SHA256 cc5393a6ac2d6563388f851b5d8960f4406df92193f3c22a1ed869a19e417937 SHA512 ea53dbc7607757087c89d6ce7e1396b0ffaa462534bfaadc13e4400172d242c5089c85d722f4b52e26c35cfeb328c9d2495f9d826e2fdcd24135934de55f924b WHIRLPOOL d18c907a2bf4bb378635dc1b8f8d028fc4e90bb9068c3a9ecc018ae9bf71cddb19fae343092c668594d3b8e5fc1383983d15c926e2717976f4849723762f11fd
+EBUILD squashfs-tools-4.3-r2.ebuild 2129 SHA256 79a5da851793eba5b94a5b9bc5dc87f2b430e25659ff3cbabf3115079c23be7d SHA512 f6623c42b03d85ec1d60b5c591d9467ce22ba202c3b8d73c303550825f5b9c0cd9bd62feafae4c615bea9301a1d8cb20aee9194bc8d26d20372ca974a5715fec WHIRLPOOL 40caa4996831fd8c3711e16b8adc7a548dd5b7ab4c1c4d71042034949bed640aad1976be9f5ee0943d9768a65385c04183c68318237463861885814dd0956e96
+EBUILD squashfs-tools-9999.ebuild 1649 SHA256 39a6b5ef9618b67ffccf0ec3ce56b0c497ada8269fd70b891da03abf6d1fefaf SHA512 0535d76acba1893795b029dd8f0315fa5d1a96ff5048bffa9cac18a221b3204abcc2173e5ab26e8fad427824bee1aebfedef2d40f1cd8cf3a26c0b9a30972628 WHIRLPOOL 246c8c30868c05566649c9eb818891f6a067161e87ecbc462f4833f5498e81f1cc50800f03f7cc82d67ec89c206d32b7cf0cc29cb7cc3a51a52a4066214ddd55
+MISC ChangeLog 4948 SHA256 048b1ddb2aef544d992020d83546b567bd89ccdbc92b902e6b993a80e60d115f SHA512 6baf9d18b382033117f4a7ca46dfd9196af0c3b6b60d7b3b4073d6aecadacddd2816631fbab7f3ee308abf768fc2e6d5e82ffa4f9517e8c69344c106aff36bee WHIRLPOOL b8ec6c9c0a646c4c5ce8b30080d38168f50c0a7da1fb0c7567efb2eb8e869be6547574d3f24da2d87d5f805bcaaad2ebb75940fe3099f4c19b4f5040692f9be6
+MISC ChangeLog-2015 18760 SHA256 a731f71798d4dcbb59b9001f81a73064961bc450ba3f4e6de3fb790112eaf571 SHA512 58d3ee1c7ed0327c87d8bec39fcb309095adc8c500aa919c74cb461d13e9e745e632fc07207109dbab677ab4ac1862cbe1ec08af74f98cafc92d2a26e9d931be WHIRLPOOL 8188d57e0e1c6b6dcfd5be583571e38ea9db21ded8bb60355e60a2ed8eb34debc72cfaa79fa122e787085ded69a64567269e9ded619d63fdc36852f6b61ff110
+MISC metadata.xml 559 SHA256 5813dae0eff3bfed9a7a40ac785726804d493f175479c1cc10ee3ea566b6eb2d SHA512 2318c516e5e76a6c802563d1e1bf60273dbfd6a6cf0944a41e5287f0c85f1b73761ba050599dfb3b2c86a53da01fc752bb4c74397c404c4ff68eb73dfedf2572 WHIRLPOOL 763a763428e1ca87f7fc653cc7984a88bac9ffb256464e7fe2258f901ab4283819998c560197aa1e558e17a3b3c4bdb480a2b9df696efadd81c4cd00a47cfade
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch
new file mode 100644
index 000000000000..467448f62639
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch
@@ -0,0 +1,30 @@
+From 9c1db6d13a51a2e009f0027ef336ce03624eac0d Mon Sep 17 00:00:00 2001
+From: "Guan, Xin" <guanx.bac@gmail.com>
+Date: Sat, 13 Sep 2014 13:15:26 +0200
+Subject: [PATCH] Fix 2GB-limit of the is_fragment(...) function.
+
+Applies to squashfs-tools 4.3.
+
+Reported-by: Bruno Wolff III <bruno@wolff.to>
+Signed-off-by: Guan, Xin <guanx.bac@gmail.com>
+Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+---
+ squashfs-tools/mksquashfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index f1fcff1cc284..d221c35865a0 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -2029,7 +2029,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
+
+ inline int is_fragment(struct inode_info *inode)
+ {
+- int file_size = inode->buf.st_size;
++ off_t file_size = inode->buf.st_size;
+
+ /*
+ * If this block is to be compressed differently to the
+--
+2.8.2
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch
new file mode 100644
index 000000000000..024129ffa958
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch
@@ -0,0 +1,15 @@
+the mksquashfs code has an all_zeros func that does:
+ long *p = (long *) file_buffer->data;
+
+make sure we force the data field to be aligned so that still works.
+
+--- a/squashfs-tools/caches-queues-lists.h
++++ b/squashfs-tools/caches-queues-lists.h
+@@ -123,6 +123,7 @@ struct file_buffer {
+ char locked;
+ char wait_on_unlock;
+ char noD;
++ long _pad;
+ char data[0];
+ };
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch
new file mode 100644
index 000000000000..7ffc062006c0
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch
@@ -0,0 +1,121 @@
+From https://github.com/plougher/squashfs-tools/pull/9
+
+From 4280e74de14070869787a9166242f9ce2dafd82e Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Wed, 6 Jan 2016 15:33:43 +0200
+Subject: [PATCH] squashfs-tools: with fnmatch.h compatibility with musl
+
+musl does not define FNM_EXTMATCH
+
+Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
+---
+ squashfs-tools/action.c | 2 +-
+ squashfs-tools/fnmatch_compat.h | 32 ++++++++++++++++++++++++++++++++
+ squashfs-tools/mksquashfs.c | 2 +-
+ squashfs-tools/unsquashfs.c | 1 +
+ squashfs-tools/unsquashfs.h | 1 -
+ 5 files changed, 35 insertions(+), 3 deletions(-)
+ create mode 100644 squashfs-tools/fnmatch_compat.h
+
+diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
+index 35889a4..4b06ccb 100644
+--- a/squashfs-tools/action.c
++++ b/squashfs-tools/action.c
+@@ -31,7 +31,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+-#include <fnmatch.h>
+ #include <pwd.h>
+ #include <grp.h>
+ #include <sys/wait.h>
+@@ -43,6 +42,7 @@
+ #include "mksquashfs.h"
+ #include "action.h"
+ #include "error.h"
++#include "fnmatch_compat.h"
+
+ /*
+ * code to parse actions
+diff --git a/squashfs-tools/fnmatch_compat.h b/squashfs-tools/fnmatch_compat.h
+new file mode 100644
+index 0000000..7b4afd8
+--- /dev/null
++++ b/squashfs-tools/fnmatch_compat.h
+@@ -0,0 +1,32 @@
++#ifndef FNMATCH_COMPAT
++#define FNMATCH_COMPAT
++/*
++ * Squashfs
++ *
++ * Copyright (c) 2015
++ * Phillip Lougher <phillip@squashfs.org.uk>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * fnmatch_compat.h
++ */
++
++#include <fnmatch.h>
++
++#ifndef FNM_EXTMATCH
++#define FNM_EXTMATCH 0
++#endif
++
++#endif
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index d221c35..4e7cbdd 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -46,7 +46,6 @@
+ #include <sys/mman.h>
+ #include <pthread.h>
+ #include <regex.h>
+-#include <fnmatch.h>
+ #include <sys/wait.h>
+ #include <limits.h>
+ #include <ctype.h>
+@@ -76,6 +75,7 @@
+ #include "read_fs.h"
+ #include "restore.h"
+ #include "process_fragments.h"
++#include "fnmatch_compat.h"
+
+ int delete = FALSE;
+ int fd;
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+index 1323dd6..2428baa 100644
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -30,6 +30,7 @@
+ #include "xattr.h"
+ #include "unsquashfs_info.h"
+ #include "stdarg.h"
++#include "fnmatch_compat.h"
+
+ #include <sys/sysinfo.h>
+ #include <sys/types.h>
+diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
+index ecd0bb4..0edbd25 100644
+--- a/squashfs-tools/unsquashfs.h
++++ b/squashfs-tools/unsquashfs.h
+@@ -40,7 +40,6 @@
+ #include <grp.h>
+ #include <time.h>
+ #include <regex.h>
+-#include <fnmatch.h>
+ #include <signal.h>
+ #include <pthread.h>
+ #include <math.h>
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch
new file mode 100644
index 000000000000..7637f67cd591
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch
@@ -0,0 +1,19 @@
+taken from Fedora
+
+commit af393379e34c5677f95bbec11645b6c3028195b4
+Author: Bruno Wolff III <bruno@wolff.to>
+Date: Wed Jun 24 14:27:31 2015 -0500
+
+Update printf formats to match datatypes after CVE patch
+
+--- squashfs-tools/unsquash-4.c
++++ squashfs-tools/unsquash-4.c
+@@ -35,7 +35,7 @@
+ size_t indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
+ long long *fragment_table_index;
+
+- TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
++ TRACE("read_fragment_table: %u fragments, reading %zu fragment indexes "
+ "from 0x%llx\n", sBlk.s.fragments, indexes,
+ sBlk.s.fragment_table_start);
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch
new file mode 100644
index 000000000000..a9b000149e4e
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch
@@ -0,0 +1,35 @@
+taken from Fedora
+
+From 604b607d8ac91eb8afc0b6e3d917d5c073096103 Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip@squashfs.org.uk>
+Date: Wed, 11 Jun 2014 04:51:37 +0100
+Subject: mksquashfs: ensure value does not overflow a signed int in -mem
+ option
+
+Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index 5370ecf..9676dc8 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -5193,7 +5193,16 @@ print_compressor_options:
+ argv[0]);
+ exit(1);
+ }
+- /* convert from bytes to Mbytes */
++
++ /*
++ * convert from bytes to Mbytes, ensuring the value
++ * does not overflow a signed int
++ */
++ if(number >= (1LL << 51)) {
++ ERROR("%s: -mem invalid mem size\n", argv[0]);
++ exit(1);
++ }
++
+ total_mem = number / 1048576;
+ if(total_mem < (SQUASHFS_LOWMEM / SQUASHFS_TAKE)) {
+ ERROR("%s: -mem should be %d Mbytes or "
+--
+cgit v0.10.1
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch
new file mode 100644
index 000000000000..52b7f48c8eab
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch
@@ -0,0 +1,24 @@
+From https://github.com/plougher/squashfs-tools/pull/9
+
+From b0ca8a5c98ff73e70b2ab1bc24aa824aa2458287 Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Wed, 6 Jan 2016 15:36:48 +0200
+Subject: [PATCH] pseudo.c: add explicit <sys/stat.h> include
+
+Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
+---
+ squashfs-tools/pseudo.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
+index f85fe60..83bfc97 100644
+--- a/squashfs-tools/pseudo.c
++++ b/squashfs-tools/pseudo.c
+@@ -32,6 +32,7 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/stat.h>
+ #include <ctype.h>
+
+ #include "pseudo.h"
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch
new file mode 100644
index 000000000000..1430b1a2ee0d
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch
@@ -0,0 +1,25 @@
+sys/types.h might not always include sys/sysmacros.h for major/minor/makedev
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -59,6 +59,7 @@
+ #else
+ #include <endian.h>
+ #include <sys/sysinfo.h>
++#include <sys/sysmacros.h>
+ #endif
+
+ #include "squashfs_fs.h"
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -38,6 +38,10 @@
+ #include <limits.h>
+ #include <ctype.h>
+
++#ifdef linux
++#include <sys/sysmacros.h>
++#endif
++
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
+ pthread_t *thread, *inflator_thread;
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch
new file mode 100644
index 000000000000..47b0ea5c9859
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch
@@ -0,0 +1,34 @@
+From ffe9e55c4993422ce36213fa86d4fc29c22646ea Mon Sep 17 00:00:00 2001
+From: Wessel Dankers <wsl-debian-804194@fruit.je>
+Date: Fri, 17 Jun 2016 09:46:42 +0800
+Subject: [PATCH] unsquashfs: Correctly set file capabilities
+
+As posted on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804194.
+---
+ squashfs-tools/unsquashfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+index 1323dd6..a5f0117 100644
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -821,8 +821,6 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time,
+ {
+ struct utimbuf times = { time, time };
+
+- write_xattr(pathname, xattr);
+-
+ if(utime(pathname, &times) == -1) {
+ ERROR("set_attributes: failed to set time on %s, because %s\n",
+ pathname, strerror(errno));
+@@ -845,6 +843,8 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time,
+ return FALSE;
+ }
+
++ write_xattr(pathname, xattr);
++
+ return TRUE;
+ }
+
+--
+2.8.0.rc3.226.g39d4020
diff --git a/sys-fs/squashfs-tools/metadata.xml b/sys-fs/squashfs-tools/metadata.xml
new file mode 100644
index 000000000000..9edcb3d56b8b
--- /dev/null
+++ b/sys-fs/squashfs-tools/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>livecd@gentoo.org</email>
+ <name>Gentoo LiveCD Project</name>
+ </maintainer>
+ <use>
+ <flag name="xz">Enable support for XZ ("LZMA2") compression using <pkg>app-arch/xz-utils</pkg></flag>
+ <flag name="lz4">Enable support for LZ4 compression using <pkg>app-arch/lz4</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">squashfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild b/sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild
new file mode 100644
index 000000000000..33c9be8386ec
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit toolchain-funcs
+
+MY_PV=${PV/_p/-r}
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="3.0" # squashfs filesystem version
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+
+RDEPEND="sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/squashfs${MY_PV}/squashfs-tools
+
+src_prepare() {
+ sed -i \
+ -e 's:-O2:$(CFLAGS):' \
+ -e '/-lz/s:$: $(LDFLAGS):' \
+ Makefile || die
+
+ echo "struct dir_info; `grep '^int dir_scan2' mksquashfs.c`;" >> global.h
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ newbin mksquashfs mksquashfs-${SLOT}
+ newbin unsquashfs unsquashfs-${SLOT}
+ cd ..
+ dodoc README ACKNOWLEDGEMENTS CHANGES PERFORMANCE.README README-3.2
+}
diff --git a/sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild b/sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild
new file mode 100644
index 000000000000..ef2cd80bfd22
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit toolchain-funcs
+
+MY_PV=${PV/_p/-r}
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="3.1" # squashfs filesystem version
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+
+RDEPEND="sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/squashfs${MY_PV}/squashfs-tools
+
+src_prepare() {
+ sed -i \
+ -e 's:-O2:$(CFLAGS):' \
+ -e '/-lz/s:$: $(LDFLAGS):' \
+ Makefile || die
+
+ sed -i -e 's:get_nprocs():sysconf(_SC_NPROCESSORS_ONLN):' *.c
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ newbin mksquashfs mksquashfs-${SLOT}
+ newbin unsquashfs unsquashfs-${SLOT}
+ cd ..
+ dodoc README ACKNOWLEDGEMENTS CHANGES PERFORMANCE.README README
+}
diff --git a/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild b/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild
new file mode 100644
index 000000000000..8273f5535b06
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DEB_VER="3"
+
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${PV}.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}-${DEB_VER}.debian.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="debug lz4 lzma lzo static xattr +xz"
+
+LIB_DEPEND="sys-libs/zlib[static-libs(+)]
+ !xz? ( !lzo? ( sys-libs/zlib[static-libs(+)] ) )
+ lz4? ( app-arch/lz4[static-libs(+)] )
+ lzma? ( app-arch/xz-utils[static-libs(+)] )
+ lzo? ( dev-libs/lzo[static-libs(+)] )
+ xattr? ( sys-apps/attr[static-libs(+)] )
+ xz? ( app-arch/xz-utils[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )"
+
+S="${WORKDIR}/squashfs${PV}/${PN}"
+
+src_prepare() {
+ epatch "${WORKDIR}"/debian/patches/*.patch
+ epatch "${FILESDIR}"/${P}-sysmacros.patch
+ epatch "${FILESDIR}"/${P}-aligned-data.patch
+ epatch "${FILESDIR}"/${P}-2gb.patch
+ epatch "${FILESDIR}"/${P}-local-cve-fix.patch
+ epatch "${FILESDIR}"/${P}-mem-overflow.patch
+ epatch "${FILESDIR}"/${P}-xattrs.patch
+ epatch "${FILESDIR}"/${P}-extmatch.patch
+ epatch "${FILESDIR}"/${P}-musl.patch
+}
+
+use10() { usex $1 1 0 ; }
+
+src_configure() {
+ # restore GNU89 inline semantics to
+ # emit function symbols, bug 595290
+ append-cflags -std=gnu89
+
+ # set up make command line variables in EMAKE_SQUASHFS_CONF
+ EMAKE_SQUASHFS_CONF=(
+ LZMA_XZ_SUPPORT=$(use10 lzma)
+ LZO_SUPPORT=$(use10 lzo)
+ LZ4_SUPPORT=$(use10 lz4)
+ XATTR_SUPPORT=$(use10 xattr)
+ XZ_SUPPORT=$(use10 xz)
+ )
+
+ tc-export CC
+ use debug && append-cppflags -DSQUASHFS_TRACE
+ use static && append-ldflags -static
+}
+
+src_compile() {
+ emake "${EMAKE_SQUASHFS_CONF[@]}"
+}
+
+src_install() {
+ dobin mksquashfs unsquashfs
+ cd ..
+ dodoc CHANGES PERFORMANCE.README pseudo-file.example README* OLD-READMEs/*
+ doman "${WORKDIR}"/debian/manpages/*.[0-9]
+}
diff --git a/sys-fs/squashfs-tools/squashfs-tools-9999.ebuild b/sys-fs/squashfs-tools/squashfs-tools-9999.ebuild
new file mode 100644
index 000000000000..b2c2c5a39252
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-9999.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils git-r3 toolchain-funcs flag-o-matic
+
+DEB_VER="3"
+
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net"
+EGIT_REPO_URI="
+ https://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug lz4 lzma lzo static xattr +xz"
+
+LIB_DEPEND="sys-libs/zlib[static-libs(+)]
+ !xz? ( !lzo? ( sys-libs/zlib[static-libs(+)] ) )
+ lz4? ( app-arch/lz4[static-libs(+)] )
+ lzma? ( app-arch/xz-utils[static-libs(+)] )
+ lzo? ( dev-libs/lzo[static-libs(+)] )
+ xattr? ( sys-apps/attr[static-libs(+)] )
+ xz? ( app-arch/xz-utils[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.3-sysmacros.patch
+ "${FILESDIR}"/${PN}-4.3-aligned-data.patch
+ "${FILESDIR}"/${PN}-4.3-xattrs.patch
+)
+
+use10() { usex $1 1 0 ; }
+
+src_configure() {
+ cd "${WORKDIR}"/${P}/${PN} || die
+
+ # set up make command line variables in EMAKE_SQUASHFS_CONF
+ EMAKE_SQUASHFS_CONF=(
+ LZMA_XZ_SUPPORT=$(use10 lzma)
+ LZO_SUPPORT=$(use10 lzo)
+ LZ4_SUPPORT=$(use10 lz4)
+ XATTR_SUPPORT=$(use10 xattr)
+ XZ_SUPPORT=$(use10 xz)
+ )
+
+ tc-export CC
+ use debug && append-cppflags -DSQUASHFS_TRACE
+ use static && append-ldflags -static
+}
+
+src_compile() {
+ cd "${WORKDIR}"/${P}/${PN} || die
+ emake "${EMAKE_SQUASHFS_CONF[@]}"
+}
+
+src_install() {
+ cd "${WORKDIR}"/${P}/${PN} || die
+ dobin mksquashfs unsquashfs
+ cd .. || die
+ dodoc CHANGES README RELEASE-README RELEASE-READMEs/*
+}