summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-06-08 16:19:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-06-08 16:19:04 +0000
commit758bb527e1b5594fe9d1f667783289197862fc5b (patch)
treeaccd1f542511a4acf7b32075402042a60df0a3f5
parentAdding upstream version 1:4.3. (diff)
downloadsquashfs-tools-758bb527e1b5594fe9d1f667783289197862fc5b.zip
squashfs-tools-758bb527e1b5594fe9d1f667783289197862fc5b.tar.xz
Adding debian version 1:4.3-4.debian/1%4.3-4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/changelog735
-rw-r--r--debian/compat1
-rw-r--r--debian/control35
-rw-r--r--debian/copyright31
-rw-r--r--debian/manpages/mksquashfs.1124
-rw-r--r--debian/manpages/unsquashfs.162
-rw-r--r--debian/patches/0001-kfreebsd.patch123
-rw-r--r--debian/patches/0002-fix_phys_mem_calculation.patch159
-rw-r--r--debian/patches/0003-CVE-2015-4645_and_CVE-2015-4646.patch76
-rw-r--r--debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch102
-rw-r--r--debian/patches/0006-uptream-fix-race.patch54
-rw-r--r--debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch27
-rw-r--r--debian/patches/series6
-rwxr-xr-xdebian/rules27
-rw-r--r--debian/source/format1
-rw-r--r--debian/source/options1
-rw-r--r--debian/squashfs-tools.manpages1
17 files changed, 1565 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..267a080
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,735 @@
+squashfs-tools (1:4.3-4) unstable; urgency=medium
+
+ * Backport patch to fix rare race in fragment waiting in filesystem
+ finalisation.
+ * Backport fix for 2GB-limit of the is_fragment(...) function
+ (closes: #788185).
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Wed, 07 Jun 2017 17:47:58 +0000
+
+squashfs-tools (1:4.3-3) unstable; urgency=low
+
+ * Use patch from upstream BTS to support LZMA magics (closes: #802446).
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Tue, 20 Oct 2015 10:56:08 +0000
+
+squashfs-tools (1:4.3-2) unstable; urgency=high
+
+ * Fix security issues:
+ - CVE-2015-4645 - stack overflow in read_fragment_table_4
+ (closes: #793467),
+ - CVE-2015-4646 - stack overflow in read_fragment_table_4 due to fix for
+ CVE-2015-4645 (closes: #793468).
+ * Fix phys mem calculation for 32-bit processes on PAE/64-bit kernels
+ (closes: #798268).
+ * Build with XZ Utils liblzma (closes: #754234, #749878).
+ * Update 0001-kfreebsd.patch to fix kFreeBSD FTBFS.
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Mon, 07 Sep 2015 18:03:49 +0200
+
+squashfs-tools (1:4.3-1) unstable; urgency=low
+
+ * New upstream release.
+ * Build with LZ4 support.
+ * Put myself as the primary maintainer.
+ * Update Standards-Version to 3.9.6 .
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Sun, 06 Sep 2015 19:08:42 +0200
+
+squashfs-tools (1:4.2+20130409-2.1) unstable; urgency=medium
+
+ * NMU.
+ * Apply changes from -2ubuntu1:
+
+ [ Matthias Klose ]
+ * Build using dpkg-buildflags.
+ * Remove the ARM workaround.
+ * Build with -fgnu89-inline.
+
+ Closes: #780206
+
+ -- gregor herrmann <gregoa@debian.org> Mon, 03 Aug 2015 17:30:11 +0200
+
+squashfs-tools (1:4.2+20130409-2) unstable; urgency=low
+
+ * New maintainer (closes: #723600).
+ * Minor packaging changes.
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Wed, 18 Sep 2013 07:50:12 +0000
+
+squashfs-tools (1:4.2+20130409-1) unstable; urgency=low
+
+ * Merging upstream version 4.2+20130409.
+
+ -- Luk Claes <luk@debian.org> Thu, 09 May 2013 22:20:42 +0200
+
+squashfs-tools (1:4.2+20130306-2) experimental; urgency=low
+
+ * Taking over with maintainer's consent.
+
+ -- Luk Claes <luk@debian.org> Sat, 20 Apr 2013 18:28:26 +0200
+
+squashfs-tools (1:4.2+20130306-1) experimental; urgency=low
+
+ * Updating upstream mail address in copyright file.
+ * Merging upstream version 4.2+20130306.
+ * Updating year in copyright file.
+ * Updating email addresses in local manpages.
+ * Dropping dpkg-source compression levels.
+ * Prefixing patches with four digits.
+ * Trimming diff headers in patches.
+ * Refreshing kfreebsd.patch.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Wed, 13 Mar 2013 18:38:01 +0100
+
+squashfs-tools (1:4.2+20121212-3) unstable; urgency=low
+
+ * Removing all references to my old email address.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 10 Mar 2013 21:46:02 +0100
+
+squashfs-tools (1:4.2+20121212-2) unstable; urgency=low
+
+ * Removing Otavio from uploaders with his consent.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 10 Mar 2013 21:45:06 +0100
+
+squashfs-tools (1:4.2+20121212-1) unstable; urgency=low
+
+ * Merging upstream version 4.2+20121212.
+ * Updating year in copyright file.
+ * Rediffing kfreebsd.patch.
+ * Removing pseudo.patch, included upstream.
+ * Removing debhelper docs and example files, not applicable anymore.
+ * Updating to standards version 3.9.4.
+ * Adding dpkg-source local options.
+ * Updating rules for new upstream sources.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 16 Dec 2012 10:21:14 +0100
+
+squashfs-tools (1:4.2-5) unstable; urgency=low
+
+ * Marking binary architecture-dependend packages as linux and kfreebsd
+ only.
+ * Using compression level 9 also for binary packages.
+ * Switching to xz compression.
+ * Updating to debhelper version 9.
+ * Updating to standards version 3.9.3.
+ * Updating copyright file to format version 1.0.
+ * Adding patch from Matthieu Castet <matthieu.castet@parrot.com> to
+ make using the Pseudo operations to change the mode/uid/gid of
+ existing files with subdirectories work (Closes: #662616).
+ * Updating mksquashfs manpage (Closes: #661815).
+ * Updating unsquashfs manpage.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 30 Jun 2012 13:48:39 +0200
+
+squashfs-tools (1:4.2-4) unstable; urgency=low
+
+ * Compacting copyright file.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 10 Jul 2011 17:14:11 +0200
+
+squashfs-tools (1:4.2-3) unstable; urgency=low
+
+ * Updating standards version to 3.9.2.
+ * Correcting two typos in the manpages, thanks to Yury V. Zaytsev
+ <yury@shurup.com> (Closes: #627401).
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Tue, 24 May 2011 19:00:31 +0200
+
+squashfs-tools (1:4.2-2) unstable; urgency=low
+
+ * Updating kfreebsd.patch, thanks to Jérémy Bobbio <lunar@debian.org>
+ (Closes: #623967).
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 28 Apr 2011 15:32:19 +0200
+
+squashfs-tools (1:4.2-1) unstable; urgency=low
+
+ * Merging upstream version 4.2.
+ * Updating debhelper docs file for new upstream.
+ * Updating year in copyright file.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 17 Mar 2011 15:04:48 +0100
+
+squashfs-tools (1:4.1-3) unstable; urgency=low
+
+ * Making reference to licenses in copyright distribution neutral.
+ * Improving previous changelog entries.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 22 Jan 2011 21:40:48 +0100
+
+squashfs-tools (1:4.1-2) unstable; urgency=low
+
+ * Updating maintainer and uploaders fields.
+ * Removing vcs fields.
+ * Removing references to my old email address.
+ * Makeing packaging distribution neutral.
+ * Switching to source format 3.0 (quilt).
+ * Updating to debhelper version 8.
+ * Rediffing kfreebsd.patch.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 16 Jan 2011 19:28:31 +0100
+
+squashfs-tools (1:4.1-1) experimental; urgency=low
+
+ * Updating standards version to 3.9.0.
+ * Merging upstream version 4.1.
+ * Updating standards version to 3.9.1.
+ * Removing return.patch, merged upstream.
+ * Removing div-by-zero.patch, merged upstream.
+ * Rediffing cflags.patch.
+ * Adding build-depends to libattr1-dev.
+ * Updating debhelper docs file for new upstream.
+ * Including pseudo-file.example.
+ * Building with xz support (Closes: #594595).
+ * Building with lzo support.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 25 Sep 2010 18:29:29 +0200
+
+squashfs-tools (1:4.0-8) unstable; urgency=low
+
+ * Replacing manpages with simple ones that are actually maintainable.
+ * Sorting dh call in rules to more common order.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 14 Mar 2010 15:56:28 +0100
+
+squashfs-tools (1:4.0-7) unstable; urgency=low
+
+ * Adding explicit source version 1.0 until switch to 3.0.
+ * Updating year in copyright file.
+ * Updating to standards 3.8.4.
+ * Applying patch from Emmet Hikory <persia@ubuntu.com> to build with -
+ marm on arm to avoid using Thumb2 instructions that older kernels
+ don't support.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 21 Feb 2010 18:09:41 +0100
+
+squashfs-tools (1:4.0-6) unstable; urgency=low
+
+ * Adding README.source.
+ * Adding patches from Nicolas Dufresne <nicolas.dufresne@gmail.com> to
+ fix some bugs in unsquashfs (Closes: #557542).
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 04 Dec 2009 08:24:09 +0100
+
+squashfs-tools (1:4.0-5) unstable; urgency=low
+
+ * Correcting wrong vcs-browser field.
+ * Adding patch from Cyril Brulebois <kibi@debian.org> to fix FTBFS on
+ kfreebsd (Closes: #557174).
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 21 Nov 2009 13:08:37 +0100
+
+squashfs-tools (1:4.0-4) unstable; urgency=low
+
+ * Renaming source package to squashfs-tools for consistency.
+ * Adding debug package.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 02 Oct 2009 19:35:57 +0200
+
+squashfs (1:4.0-3) unstable; urgency=low
+
+ * Updating maintainer field.
+ * Updating vcs fields.
+ * Sorting depends.
+ * Adding maintainer homepage in copyright.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 02 Oct 2009 19:17:18 +0200
+
+squashfs (1:4.0-2) unstable; urgency=low
+
+ * Updating section.
+ * Using correct rfc-2822 date formats in changelog.
+ * Removing hppa specific gcc build-depends as requested, no idea about
+ the consequences (Closes: #533788).
+ * Minimizing rules file.
+ * Updating package to standards version 3.8.3.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 19 Sep 2009 15:20:31 +0200
+
+squashfs (1:4.0-1) unstable; urgency=low
+
+ * Merging upstream version 4.0.
+ * Installing new upstream documentation into the package.
+ * Updating make calls in rules file to cope with new upstream source layout.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Mon, 06 Apr 2009 12:42:00 +0200
+
+squashfs (1:4.0~20090405-1) unstable; urgency=low
+
+ * New upstream snapshot of squashfs-tools only, squashfs-modules are
+ mainlined as of 2.6.29.
+ * Redoing packaging from scratch (Closes: #485154).
+ * Removing Roland from uploaders in agreement with him.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 05 Apr 2009 15:01:00 +0200
+
+squashfs (1:3.3-7) unstable; urgency=low
+
+ * Enabling patch for 2.6.25 now.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Tue, 06 May 2008 11:44:00 +0200
+
+squashfs (1:3.3-6) unstable; urgency=medium
+
+ [ Otavio Salvador ]
+ * Applied patch required due 2.6.25 API changes. Thanks to Phillip
+ Lougher <phillip@lougher.demon.co.uk> for the patch.
+ * Update po and pot files
+
+ [ Daniel Baumann ]
+ * Taking over squashfs maintenance from Arnaud Fontaine, with thanks
+ for his past contributions.
+ * Disabling 2.6.25 patch temporarily, as this is another upload
+ targeted for 2.6.24.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Thu, 10 Apr 2008 21:11:00 +0200
+
+squashfs (1:3.3-5) unstable; urgency=high
+
+ * Readding patch from squashfs cvs to fix mksquashfs error on >1.5GB image
+ creation. This patch was accidentally dropped by me as it was hidden
+ within the squashfs-lzma patches and not broken out (Closes: #455589).
+ * Applying two other patches from squashfs cvs:
+ - Fixing progessbar for hardlinked files.
+ - Fixing dangling symbolic links.
+ Thanks to Stefan Lippers-Hollmann <s.L-H@gmx.de>.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sat, 29 Mar 2008 09:48:00 +0100
+
+squashfs (1:3.3-4) unstable; urgency=medium
+
+ * Removing squashfs-lzma support in agreement with Otavio: too broken and un-
+ maintained (Closes: #465183, #465874, #466242, #456489, #468457).
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 21 Mar 2008 20:37:00 +0100
+
+squashfs (1:3.3-3) unstable; urgency=medium
+
+ [ Daniel Baumann ]
+ * Applied patch from Tollef Fog Heen <tfheen@ubuntu.com>:
+ - Add -lzma switch to enable lzma support.
+ - Don't use lzma by default.
+ Both patches are very important. We cannot use lzma by default on for two
+ reasons: first, it is broken and produces corrupted images at the moment,
+ and second, we would not have an upgrade path from etch to lenny with it.
+ * Build-depending on gcc-4.2-hppa64 now (Closes: #463293).
+ * Removed useless whitespaces at EOF and EOL.
+ * Applied patch from upstream to fix hang of mksquashfs, thanks to
+ Stefan Lippers-Hollmann <s.L-H@gmx.de> (Closes: #455589).
+ * Bumped package to debhelper 5, no other changes required.
+ * Updated Vcs fields in control, they are official now.
+ * Adding override link for module-assistant.
+ * Prefixing docs with the package name they belong to for consistency reasons.
+ * Since it is unavoidable to have the EXTRA_FLAGS in the linux-2.6/Makefile,
+ it is not required to duplicate them in rules.modules.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Mon, 04 Feb 2008 22:57:00 +0100
+
+squashfs (1:3.3-2) unstable; urgency=medium
+
+ [ Daniel Baumann ]
+ * Reverting 'Remove EXTRA_CFLAGS patches against module Makefile in favor of
+ rules' commit and adding EXTRA_FLAGS back to the Makefile. This has
+ broken linux-modules-extra-2.6 integration (Closes: #463628).
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Mon, 04 Feb 2008 22:26:00 +0100
+
+squashfs (1:3.3-1) unstable; urgency=low
+
+ * New upstream release.
+ * New email address.
+ * Use quilt patch system instead of dpatch and reorganized patches.
+ * debian/docs:
+ + Remove README-3.2 in favor of README-3.3.
+ * debian/patches:
+ + Remove deprecated 03-remove-slab.
+ + 01-kernel-compat now allows to build for both 2.6.22 and 2.6.23.
+ * debian/copyright:
+ + Update GPL path.
+ * debian/rules:
+ + Update CFLAGS from squashfs-tools/Makefile.
+ * debian/control*:
+ + Add Build-Depends against zlib1g-dev.
+ + Add Depends against zlib1g-dev for squashfs-source.
+ + Update Standards-Version to 3.7.3. No changes needed.
+
+ -- Arnaud Fontaine <arnau@debian.org> Sat, 08 Dec 2007 16:45:08 +0000
+
+squashfs (1:3.2r2-9exp1) experimental; urgency=low
+
+ * debian/NEWS:
+ + Add informations about LZMA support.
+ * debian/copyright:
+ + Update GPL path.
+ * debian/control:
+ + Remove useless depends of squashfs-source on dpatch.
+ * Add lzma support. Closes: #414563.
+ + Add lzma-source to squashfs-tools Suggests field in debian/control.
+ + Add squashfs lzma headers.
+ + Add lzma support to kernel module.
+ + Add lzma support for squashfs tools.
+ + Add ``-nolzma'' options to mksquashfs help and also in its manpage.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Thu, 18 Oct 2007 13:11:35 +0100
+
+squashfs (1:3.2r2-9) unstable; urgency=low
+
+ * Add 04-kcompat-2.6.23.dpatch for building the kernel module on kernel
+ 2.6.23. Thanks to Stefan Lippers-Hollmann <s.L-H@gmx.de>. Closes: #445417.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Thu, 18 Oct 2007 13:03:25 +0100
+
+squashfs (1:3.2r2-8) unstable; urgency=low
+
+ [ Arnaud Fontaine ]
+ * Fix FTBFS with linux-modules-extra by removing linux-2.6/ directory in
+ squashfs-source package. Closes: #442906.
+ * Add debian/patches/01-module-makefile which allows to build the
+ kernel module by hand.
+ * Move Homepage field from binaries to source package in debian/control*.
+ * debian/changelog:
+ + Fix doubly-encoded utf8 garbage.
+ * debian/control:
+ + Policy doesn't permit Uploaders field on several lines.
+ * debian/control.modules.in:
+ + Update Standards-Version to 3.7.2.
+ + Add XS-VCS-* fields.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Wed, 26 Sep 2007 00:33:16 +0100
+
+squashfs (1:3.2r2-7) unstable; urgency=low
+
+ [ Arnaud Fontaine ]
+ * debian/patches/01-includes.dpatch:
+ + Add missing include against ``sched.h'' kernel header.
+ Closes: #442906.
+ * debian/doc/mksquashfs.dbk:
+ + Remove ``-2.0'' option as it doesn't exist anymore. Closes: #443128.
+
+ [ Otavio Salvador ]
+ * debian/rules:
+ + Remove $(DOC_DIR)/*.1 files on clean.
+ * debian/control:
+ + Fix typo in extended description of squashfs-source package.
+ Closes: #439110.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Wed, 19 Sep 2007 11:39:20 +0100
+
+squashfs (1:3.2r2-6) unstable; urgency=low
+
+ * debian/patches/03-remove-slab.patch:
+ + Fix target of the patch. Closes: #433805.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Thu, 09 Aug 2007 21:39:18 +0200
+
+squashfs (1:3.2r2-5) unstable; urgency=low
+
+ [ Arnaud Fontaine ]
+ * Fix manpage section from 8 to 1. Closes: #433858.
+ * debian/doc/en/mksquashfs.dbk:
+ + Add ``-no-progress'' and ``-no-exports'' options.
+ Closes: #420159.
+ * debian/patches/03-remove-slab.dpatch:
+ + Improve the patch which makes it compatible with kernel version
+ < 2.6.22.
+
+ [ Otavio Salvador ]
+ * debian/control:
+ + Add myself as uploader.
+ + Add XS-VCS-{Git,Browser} control's fields.
+ + Wrap build-depends.
+ * debian/control.in: removed.
+ * debian/watch:
+ + Use git-import-orig instead of uupdate so it integrates better with
+ our git repository.
+ + Fix upstream version handling to remove the dash from it.
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Wed, 08 Aug 2007 15:02:05 -0300
+
+squashfs (1:3.2r2-4) unstable; urgency=low
+
+ * Fix FTBFS with 2.6.22 due SLAB removal. Thanks to Mario Izquierdo
+ <mariodebian@gmail.com> for the patch. Closes: #433805.
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Tue, 07 Aug 2007 21:44:02 -0300
+
+squashfs (1:3.2r2-3) unstable; urgency=low
+
+ * Move squashfs-tools binaries to /usr/bin since they can be used by
+ normal users and are useful to embedded systems. Closes: #422041.
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Wed, 11 Jul 2007 10:33:15 -0300
+
+squashfs (1:3.2r2-2) unstable; urgency=low
+
+ * Upload to unstable.
+ + squashfs module 3.2 now build on kernel >= 2.6.20. Closes:
+ #418762.
+ * Acknowledge NMU. Closes: #416773.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sun, 15 Apr 2007 11:44:35 +0200
+
+squashfs (1:3.2r2-1) experimental; urgency=low
+
+ * New upstream release.
+ + Remove 03-progress-mksquashfs patch included upstream.
+ + Update 01-includes patch.
+ * debian/rules:
+ + Update the kernel patch path for squashfs-module and use 2.6.20
+ kernel patch.
+ * debian/control.modules.in:
+ + Add depends against linux-modules or linux-image.
+ Closes: #408863.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sat, 20 Jan 2007 15:52:31 +0100
+
+squashfs (1:3.1r2-6.1) unstable; urgency=high
+
+ * Non-maintainer upload.
+ * Added patch from upstream to linux-2.6.18/squashfs3.1-patch to fix kernel
+ crash on special crafted squashfs file systems CVE-2006-5701
+ (Closes: #415530).
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Fri, 30 Mar 2007 08:52:00 +0200
+
+squashfs (1:3.1r2-6) unstable; urgency=low
+
+ * Add manpage for unsquashfs command.
+ * Re-add the progress patch. Thanks to Tollef Fog Heen
+ <tfheen@ubuntu.com>. Closes: #389487.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sat, 02 Dec 2006 12:11:02 +0100
+
+squashfs (1:3.1r2-5) unstable; urgency=low
+
+ * debian/changelog:
+ + Convert changelog to UTF-8.
+ * debian/control.in:
+ + Remove zlibg1-dev because it is automatically handled by cdbs
+ for debian/control.
+ * debian/rules:
+ + Remove bashisms. Closes: #400753.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Tue, 28 Nov 2006 18:33:53 +0100
+
+squashfs (1:3.1r2-4) unstable; urgency=low
+
+ * debian/rules:
+ + Fix manpages by adding 'man.charmap.use.subset' to xsltproc
+ parameter. Closes: #395412.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sun, 29 Oct 2006 09:10:21 +0100
+
+squashfs (1:3.1r2-3) unstable; urgency=low
+
+ * Replace gcc-4.0-hppa by gcc-4.1-hppa in Depends. Closes: #391274.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Fri, 06 Oct 2006 01:41:06 +0200
+
+squashfs (1:3.1r2-2) unstable; urgency=low
+
+ * Update the squashfs-source package for kernel 2.6.18.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Thu, 21 Sep 2006 16:53:29 +0200
+
+squashfs (1:3.1r2-1) unstable; urgency=low
+
+ * New upstream relase.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Tue, 05 Sep 2006 15:49:53 +0200
+
+squashfs (1:3.1-1) unstable; urgency=low
+
+ * New upstream release. Closes: #384414.
+ * Remove the squashfs-modules-* packages which is now handled by
+ linux-modules-extra-2.6. Closes: #384440.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Mon, 28 Aug 2006 16:23:44 +0200
+
+squashfs (1:3.0-8) unstable; urgency=low
+
+ * Bumped kernel-abi to 2.6.17-2. Closes: #383137.
+ * Fix progress information patch when generating a FS > 4GB. Thanks
+ to Mike Kasick <mkasick@club.cc.cmu.edu>. Closes: #382714.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Tue, 15 Aug 2006 10:51:16 +0200
+
+squashfs (1:3.0-7) unstable; urgency=low
+
+ * Patch for appending files to an existing filesystem larger than
+ 2GB. Thanks to Pierre Renié <archlinuxien@gmail.com> and Ming
+ Zhang. Closes: #378615.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sun, 06 Aug 2006 18:20:04 +0200
+
+squashfs (1:3.0-6) unstable; urgency=low
+
+ * Acknowledge NMU. Closes: #377831.
+ * debian/control.in:
+ + Add a minimum version on po4a (0.21) in Build-Depends. Closes: #377797.
+ + Remove s390-tape flavour which has no kernel headers.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sun, 16 Jul 2006 14:44:56 +0200
+
+squashfs (1:3.0-5.1) unstable; urgency=low
+
+ * NMU in agreement with Arnaud.
+ * Bumped kernel-abi.
+ * Updated flavours as of 2.6.17-2.
+
+ -- Daniel Baumann <mail@daniel-baumann.ch> Sun, 09 Jul 2006 16:22:00 +0200
+
+squashfs (1:3.0-5) unstable; urgency=low
+
+ * debian/control* and debian/rules:
+ + Bumped linux kernel version number to 2.6.16-2.
+ Closes: #369522.
+
+ * debian/patches/03-mksquashfs.dpatch:
+ + Fix rounding error which causes generation of invalid
+ filesystems. Thanks to Scott James Remnant
+ <scott@ubuntu.com>. Closes: #368969.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Wed, 31 May 2006 18:16:18 +0200
+
+squashfs (1:3.0-4) unstable; urgency=low
+
+ * debian/rules:
+ + Fix FTBFS on powerpc64. Thanks to Julien Louis
+ <ptitlouis@sysif.net>.
+
+ * debian/control*:
+ + Update Standards-Version to 3.7.2.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sun, 07 May 2006 09:59:10 +0200
+
+squashfs (1:3.0-3) unstable; urgency=low
+
+ * debian/control*:
+ + Fix incorrect package name for module
+ squashfs-modules-2.6*-powerpc64.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sat, 29 Apr 2006 12:27:06 +0200
+
+squashfs (1:3.0-2) unstable; urgency=low
+
+ * debian/patches/03-mksquashfs.dpatch:
+ + Add patch showing the progress of mksquashfs. Thanks to Tollef
+ Fog Heen <tfheen@ubuntu.com>. Closes: #364089.
+
+ * debian/control*:
+ + Add complete description for every squashfs-* packages. Thanks
+ to Tomas Pospisek <tpo_deb@sourcepole.ch>. Closes: #364743.
+ + Add Homepage to the descriptions.
+ + Suggests on squashfs-source instead of kernel-patch-squashfs for
+ squashfs-tools.
+ + Conflicts and Replaces on kernel-patch-squashfs concerning
+ squashfs-source. Thanks to Bastian Kleineidam
+ <calvin@debian.org>. Closes: #364768.
+ + Add docbook-xml to Build-Depends for manpages.
+ + Add binutils-hppa64 and gcc-4.0-hppa64 Build-Depends for hppa.
+
+ * debian/control.modules.in:
+ + Remove Daniel Baumann from Uploaders.
+
+ * debian/docs:
+ + Add README-3.0.
+
+ * debian/rules:
+ + Add unsquashfs to build program.
+ + Add upstream changelog to the packages (CHANGES).
+ + Fix FTBFS for hppa64* and sparc64* by specifying respectively
+ CROSS_COMPILE and ARCH for building the modules.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Wed, 26 Apr 2006 18:38:20 +0200
+
+squashfs (1:3.0-1) unstable; urgency=low
+
+ * New upstream release.
+ * Building module out-of-tree, thanks to Daniel Baumann
+ <daniel.baumann@panthera-systems.net>. Closes: #355554.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Sun, 02 Apr 2006 11:47:00 +0200
+
+squashfs (1:2.2r2-3) unstable; urgency=low
+
+ * debian/kernel-patch-squashfs.kpatches and
+ debian/kernel-patch-squashfs.k_patches.commented updated to support
+ Linux 2.6.14 and later.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Tue, 31 Jan 2006 12:52:18 +0100
+
+squashfs (1:2.2r2-2) unstable; urgency=low
+
+ * Removed source root debian Makefile (not upstream) in favor of
+ CDBS (so modified debian/rules), added debian/control.in.
+ * Added debian/cdbs/1/class/makefile.mk in order to fix bug #338625.
+ * Added french translation by Frédéric Boiteux and Olivier Trichet.
+ Moved mksquashfs.dbk from debian/ to debian/doc/en/.
+ * Switch to po4a. Thanks to Nicolas François.
+ * Updated debian/watch.
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Thu, 10 Nov 2005 15:22:28 +0100
+
+squashfs (1:2.2r2-1) unstable; urgency=low
+
+ * New upstream release. Closes: #317795.
+ * Suggested 'kernel-source | linux-source' instead of 'kernel-source'
+ in debian/control. Thanks to Marco Bodrato. Closes: #329623.
+ * Updated debian/kernel-patch-squashfs.kpatches and
+ debian/kernel-patch-squashfs.k_patches.commented due to new
+ upstream patches. Closes: #303032.
+ * Updated FSF address in debian/copyright.
+ * Updated Standards-Version to 3.6.2.1 (no changes needed).
+
+ -- Arnaud Fontaine <arnaud@andesi.org> Tue, 11 Oct 2005 20:12:55 +0200
+
+squashfs (1:2.1r2-0.1) unstable; urgency=low
+
+ * NMU: build also a kernel-patch-squashfs module.
+ * New upstream release. Closes: #287919.
+ * Change Debian helper from yada to Debhelper.
+ * change mksquashfs install directory from /usr/bin/ to /usr/sbin/.
+
+ -- Frédéric Boiteux <fboiteux@calistel.com> Mon, 20 Dec 2004 12:47:46 +0100
+
+squashfs (1:2.0-1) unstable; urgency=low
+
+ * New upstream release.
+ * Fixes for build script. It can be called debian/rules build after
+ interrupt.
+
+ -- Piotr Roszatycki <dexter@debian.org> Thu, 05 Aug 2004 18:57:15 +0200
+
+squashfs (2.0-ALPHA-1) unstable; urgency=low
+
+ * New upstream release. Closes: #255470.
+
+ -- Piotr Roszatycki <dexter@debian.org> Mon, 21 Jun 2004 13:06:46 +0200
+
+squashfs (1.3r3-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Piotr Roszatycki <dexter@debian.org> Thu, 11 Mar 2004 21:29:32 +0100
+
+squashfs (1.3r2-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Piotr Roszatycki <dexter@debian.org> Tue, 18 Nov 2003 12:48:13 +0100
+
+squashfs (1.3-2) unstable; urgency=low
+
+ * Fixed missing build-depends on libz-dev, closes: #215338.
+
+ -- Piotr Roszatycki <dexter@debian.org> Mon, 13 Oct 2003 12:35:38 +0200
+
+squashfs (1.3-1) unstable; urgency=low
+
+ * Initial release.
+
+ -- Piotr Roszatycki <dexter@debian.org> Wed, 01 Oct 2003 14:28:30 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..c0aca05
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,35 @@
+Source: squashfs-tools
+Section: kernel
+Priority: optional
+Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.org>
+Uploaders: Filesystems Group <filesystems-devel@lists.alioth.debian.org>
+Build-Depends:
+ debhelper (>= 9), libattr1-dev, liblzma-dev, liblzo2-dev, liblz4-dev, zlib1g-dev
+Standards-Version: 3.9.6
+Homepage: http://squashfs.sourceforge.net/
+
+Package: squashfs-tools
+Architecture: linux-any kfreebsd-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Tool to create and append to squashfs filesystems
+ Squashfs is a highly compressed read-only filesystem for Linux. It uses zlib
+ compression to compress both files, inodes and directories. Inodes in the
+ system are very small and all blocks are packed to minimise data overhead.
+ Block sizes greater than 4K are supported up to a maximum of 64K.
+ .
+ Squashfs is intended for general read-only filesystem use, for archival use
+ (i.e. in cases where a .tar.gz file may be used), and in constrained block
+ device/memory systems (e.g. embedded systems) where low overhead is needed.
+
+Package: squashfs-tools-dbg
+Section: debug
+Priority: extra
+Architecture: linux-any kfreebsd-any
+Depends: ${misc:Depends}, squashfs-tools (= ${binary:Version})
+Description: Tool to create and append to squashfs filesystems (debug)
+ Squashfs is a highly compressed read-only filesystem for Linux. It uses zlib
+ compression to compress both files, inodes and directories. Inodes in the
+ system are very small and all blocks are packed to minimise data overhead.
+ Block sizes greater than 4K are supported up to a maximum of 64K.
+ .
+ This package contains the debugging symbols.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..5eeed1c
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,31 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Squashfs
+Upstream-Contact: Phillip Lougher <phillip@squashfs.org.uk>
+Source: http://sourceforge.net/projects/squashfs/files/squashfs/
+
+Files: *
+Copyright: 2002-2013 Phillip Lougher <phillip@squashfs.org.uk>
+License: GPL-2+
+
+Files: debian/*
+Copyright: 2013 Laszlo Boszormenyi (GCS) <gcs@debian.org>,
+ 2013 Luk Claes <luk@debian.org,
+ 2009-2013 Daniel Baumann <mail@daniel-baumann.ch>
+License: GPL-2+
+
+License: GPL-2+
+ 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 of the License, 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, see <http://www.gnu.org/licenses/>.
+ .
+ The complete text of the GNU General Public License
+ can be found in /usr/share/common-licenses/GPL-2 file.
diff --git a/debian/manpages/mksquashfs.1 b/debian/manpages/mksquashfs.1
new file mode 100644
index 0000000..3f7ad25
--- /dev/null
+++ b/debian/manpages/mksquashfs.1
@@ -0,0 +1,124 @@
+.TH MKSQUASHFS 1 "2012\-06\-30" "4.2" "create and append squashfs filesystems"
+
+.SH NAME
+mksquashfs \- tool to create and append to squashfs filesystems
+
+.SH SYNOPSIS
+\fBmksquashfs\fR \fISOURCE\fR [\fISOURCE2\fR \fI...\fR] \fIDESTINATION\fR [\fIOPTIONS\fR]
+
+.SH DESCRIPTION
+Squashfs is a highly compressed read\-only filesystem for Linux. It uses zlib compression to compress both files, inodes and directories. Inodes in the system are very small and all blocks are packed to minimize data overhead. Block sizes greater than 4K are supported up to a maximum of 64K.
+.PP
+Squashfs is intended for general read\-only filesystem use, for archival use (i.e. in cases where a .tar.gz file may be used), and in constrained block device/memory systems (e.g. embedded systems) where low overhead is needed.
+
+.SH OPTIONS
+
+.SS Filesystem build options
+.IP "\-comp \fICOMPRESSION\fR" 4
+select \fICOMPRESSION\fR compression. Compressors available: gzip (default), lzo, xz.
+.IP "\-b \fIBLOCK_SIZE\fR"
+set data block to \fIBLOCK_SIZE\fR. Default 131072 bytes.
+.IP "\-no\-exports" 4
+don't make the filesystem exportable via NFS.
+.IP "\-no\-sparse" 4
+don't detect sparse files.
+.IP "\-no\-xattrs" 4
+don't store extended attributes.
+.IP "\-xattrs" 4
+store extended attributes (default).
+.IP "\-noI" 4
+do not compress inode table.
+.IP "\-noD" 4
+do not compress data blocks.
+.IP "\-noF" 4
+do not compress fragment blocks.
+.IP "\-noX" 4
+do not compress extended attributes.
+.IP "\-no\-fragments" 4
+do not use fragments.
+.IP "\-always\-use\-fragments" 4
+use fragment blocks for files larger than block size.
+.IP "\-no\-duplicates" 4
+do not perform duplicate checking.
+.IP "\-all\-root" 4
+make all files owned by root.
+.IP "\-force\-uid uid" 4
+set all file uids to uid.
+.IP "\-force\-gid gid" 4
+set all file gids to gid.
+.IP "\-nopad" 4
+do not pad filesystem to a multiple of 4K.
+.IP "\-keep\-as\-directory" 4
+if one source directory is specified, create a root directory containing that directory, rather than the contents of the directory.
+
+.SS Filesystem filter options
+.IP "\-p \fIPSEUDO_DEFINITION\fR" 4
+Add pseudo file definition.
+.IP "\-pf \fIPSEUDO_FILE\fR" 4
+Add list of pseudo file definitions.
+.IP "\-sort \fISORT_FILE\fR" 4
+sort files according to priorities in \fISORT_FILE\fR. One file or dir with priority per line. Priority \-32768 to 32767, default priority 0.
+.IP "\-ef \fIEXCLUDE_FILE\fR" 4
+list of exclude dirs/files. One per line.
+.IP "\-wildcards" 4
+Allow extended shell wildcards (globbing) to be used in exclude dirs/files
+.IP "\-regex" 4
+Allow POSIX regular expressions to be used in exclude dirs/files.
+
+.SS Filesystem append options
+.IP "\-noappend" 4
+do not append to existing filesystem.
+.IP "\-root\-becomes \fINAME\fR" 4
+when appending source files/directories, make the original root become a subdirectory in the new root called \fINAME\fR, rather than adding the new source items to the original root.
+
+.SS Mksquashfs runtime options:
+.IP "\-version" 4
+print version, licence and copyright message.
+.IP "\-recover \fINAME\fR" 4
+recover filesystem data using recovery file \fINAME\fR.
+.IP "\-no\-recovery" 4
+don't generate a recovery file.
+.IP "\-info" 4
+print files written to filesystem.
+.IP "\-no\-progress" 4
+don't display the progress bar.
+.IP "\-processors \fINUMBER\fR" 4
+Use \fINUMBER\fR processors. By default will use number of processors available.
+.IP "\-read\-queue \fISIZE\fR" 4
+Set input queue to \fISIZE\fR Mbytes. Default 64 Mbytes.
+.IP "\-write\-queue \fISIZE\fR" 4
+Set output queue to \fISIZE\fR Mbytes. Default 512 Mbytes.
+.IP "\-fragment\-queue \fISIZE\fR" 4
+Set fragment queue to \fISIZE\fR Mbytes. Default 64 Mbytes.
+
+.SS Miscellaneous options
+.IP "\-root\-owned" 4
+alternative name for \-all\-root.
+.IP "\-noInodeCompression" 4
+alternative name for \-noI.
+.IP "\-noDataCompression" 4
+alternative name for \-noD.
+.IP "\-noFragmentCompression" 4
+alternative name for \-noF.
+.IP "\-noXattrCompression" 4
+alternative name for \-noX.
+
+.SS Compressors available and compressor specific options
+.IP "gzip (no options) (default)"
+.IP "lzo (no options)"
+.IP "xz"
+.IP "\-Xbcj filter1,filter2,...,filterN" 4
+Compress using filter1,filter2,...,filterN in turn (in addition to no filter), and choose the best compression. Available filters: x86, arm, armthumb, powerpc, sparc, ia64.
+.IP "\-Xdict\-size \fIDICT_SIZE\fR" 4
+Use \fIDICT_SIZE\fR as the XZ dictionary size. The dictionary size can be specified as a percentage of the block size, or as an absolute value. The dictionary size must be less than or equal to the block size and 8192 bytes or larger. It must also be storable in the xz header as either 2^n or as 2^n+2^(n+1). Example dict\-sizes are 75%, 50%, 37.5%, 25%, or 32K, 16K, 8K etc.
+
+.SH SEE ALSO
+unsquashfs(1)
+
+.SH HOMEPAGE
+More information about mksquashfs and the squashfs filesystem can be found at <\fIhttp://squashfs.sourceforge.net/\fR>.
+
+.SH AUTHOR
+squashfs was written by Phillip Lougher <\fIphillip@squashfs.org.uk\fR>.
+.PP
+This manual page was written by Daniel Baumann <\fImail@daniel\-baumann.ch\fR>.
diff --git a/debian/manpages/unsquashfs.1 b/debian/manpages/unsquashfs.1
new file mode 100644
index 0000000..1bab59b
--- /dev/null
+++ b/debian/manpages/unsquashfs.1
@@ -0,0 +1,62 @@
+.TH UNSQUASHFS 1 "2012\-06\-30" "4.2" "uncompress squashfs filesystems"
+
+.SH NAME
+mksquashfs \- tool to uncompress squashfs filesystems
+
+.SH SYNOPSIS
+\fBunsquashfs\fR [\fIOPTIONS\fR] \fIFILESYSTEM\fR [\fIdirectories or files to extract\fR]
+
+.SH DESCRIPTION
+Squashfs is a highly compressed read\-only filesystem for Linux. It uses zlib compression to compress both files, inodes and directories. Inodes in the system are very small and all blocks are packed to minimize data overhead. Block sizes greater than 4K are supported up to a maximum of 64K.
+.PP
+Squashfs is intended for general read\-only filesystem use, for archival use (i.e. in cases where a .tar.gz file may be used), and in constrained block device/memory systems (e.g. embedded systems) where low overhead is needed.
+
+.SH OPTIONS
+.IP "\-v, \-version" 4
+print version, licence and copyright information.
+.IP "\-d \fIPATHNAME\fR, \-dest \fIPATHNAME\fR" 4
+unsquash to \fIPATHNAME\fR, default "squashfs\-root".
+.IP "\-n, \-no\-progress" 4
+don't display the progress bar.
+.IP "\-no, \-no\-xattrs" 4
+don't extract xattrs in file system.
+.IP "\-x, \-xattrs" 4
+extract xattrs in file system (default).
+.IP "\-p \fINUMBER\fR, \-processors \fINUMBER\fR" 4
+use \fINUMBER\fR processors. By default will use number of processors available.
+.IP "\-i, \-info" 4
+print files as they are unsquashed.
+.IP "\-li, \-linfo" 4
+print files as they are unsquashed with file attributes (like ls \-l output).
+.IP "\-l, \-ls" 4
+list filesystem, but don't unsquash.
+.IP "\-ll, \-lls" 4
+list filesystem with file attributes (like ls \-l output), but don't unsquash.
+.IP "\-f, \-force" 4
+if file already exists then overwrite.
+.IP "\-s, \-stat" 4
+display filesystem superblock information.
+.IP "\-e \fIEXTRACT_FILE\fR, \-ef \fIEXTRACT_FILE\fR" 4
+list of directories or files to extract. One per line.
+.IP "\-da \fISIZE\fR, \-data-queue \fISIZE\fR" 4
+Set data queue to \fISIZE\fR Mbytes. Default 256 Mbytes.
+.IP "\-fr \fISIZE\fR, \-frag\-queue \fISIZE\fR" 4
+Set fragment queue to \fISIZE\fR Mbytes. Default 256 Mbytes.
+.IP "\-r, \-regex" 4
+treat extract names as POSIX regular expressions rather than use the default shell wildcard expansion (globbing).
+
+.SS Decompressors available
+.IP "gzip" 4
+.IP "lzo" 4
+.IP "xz" 4
+
+.SH SEE ALSO
+mksquashfs(1)
+
+.SH HOMEPAGE
+More information about unsquashfs and the squashfs filesystem can be found at <\fIhttp://squashfs.sourceforge.net/\fR>.
+
+.SH AUTHOR
+squashfs was written by Phillip Lougher <\fIphillip@squashfs.org.uk\fR>.
+.PP
+This manual page was written by Daniel Baumann <\fImail@daniel\-baumann.ch\fR>.
diff --git a/debian/patches/0001-kfreebsd.patch b/debian/patches/0001-kfreebsd.patch
new file mode 100644
index 0000000..7ce6cd5
--- /dev/null
+++ b/debian/patches/0001-kfreebsd.patch
@@ -0,0 +1,123 @@
+Author: Cyril Brulebois <kibi@debian.org>
+Description: Fixes FTBFS on kfreebsd (Closes: #557174).
+Last-Update: 2015-09-06
+
+--- squashfs-tools-4.3.orig/squashfs-tools/mksquashfs.c
++++ squashfs-tools-4.3/squashfs-tools/mksquashfs.c
+@@ -51,7 +51,7 @@
+ #include <limits.h>
+ #include <ctype.h>
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+@@ -4105,7 +4105,7 @@ void initialise_threads(int readq, int f
+ BAD_ERROR("Failed to set signal mask in intialise_threads\n");
+
+ if(processors == -1) {
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ int mib[2];
+ size_t len = sizeof(processors);
+
+--- squashfs-tools-4.3.orig/squashfs-tools/read_fs.c
++++ squashfs-tools-4.3/squashfs-tools/read_fs.c
+@@ -35,7 +35,7 @@
+ #include <limits.h>
+ #include <dirent.h>
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+--- squashfs-tools-4.3.orig/squashfs-tools/read_xattrs.c
++++ squashfs-tools-4.3/squashfs-tools/read_xattrs.c
+@@ -31,7 +31,7 @@
+ #include <stdio.h>
+ #include <string.h>
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+--- squashfs-tools-4.3.orig/squashfs-tools/swap.c
++++ squashfs-tools-4.3/squashfs-tools/swap.c
+@@ -19,7 +19,7 @@
+ * swap.c
+ */
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+--- squashfs-tools-4.3.orig/squashfs-tools/unsquashfs.c
++++ squashfs-tools-4.3/squashfs-tools/unsquashfs.c
+@@ -2190,7 +2190,7 @@ void initialise_threads(int fragment_buf
+ "\n");
+
+ if(processors == -1) {
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ int mib[2];
+ size_t len = sizeof(processors);
+
+--- squashfs-tools-4.3.orig/squashfs-tools/unsquashfs.h
++++ squashfs-tools-4.3/squashfs-tools/unsquashfs.h
+@@ -47,7 +47,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+--- squashfs-tools-4.3.orig/squashfs-tools/xz_wrapper.h
++++ squashfs-tools-4.3/squashfs-tools/xz_wrapper.h
+@@ -24,7 +24,7 @@
+ *
+ */
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+--- squashfs-tools-4.3.orig/squashfs-tools/gzip_wrapper.h
++++ squashfs-tools-4.3/squashfs-tools/gzip_wrapper.h
+@@ -24,7 +24,7 @@
+ *
+ */
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+--- squashfs-tools-4.3.orig/squashfs-tools/lz4_wrapper.h
++++ squashfs-tools-4.3/squashfs-tools/lz4_wrapper.h
+@@ -24,7 +24,7 @@
+ *
+ */
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+--- squashfs-tools-4.3.orig/squashfs-tools/lzo_wrapper.h
++++ squashfs-tools-4.3/squashfs-tools/lzo_wrapper.h
+@@ -24,7 +24,7 @@
+ *
+ */
+
+-#ifndef linux
++#if !defined(linux) && !defined(__GLIBC__)
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
diff --git a/debian/patches/0002-fix_phys_mem_calculation.patch b/debian/patches/0002-fix_phys_mem_calculation.patch
new file mode 100644
index 0000000..20f9005
--- /dev/null
+++ b/debian/patches/0002-fix_phys_mem_calculation.patch
@@ -0,0 +1,159 @@
+From 55f7ba830d40d438f0b0663a505e0c227fc68b6b Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip@squashfs.org.uk>
+Date: Tue, 10 Jun 2014 21:51:52 +0100
+Subject: [PATCH] mksquashfs: fix phys mem calculation for 32-bit processes on
+ PAE/64-bit kernels
+
+When adding the code to base default memory usage on physical memory
+(by default use 25% of physical memory), I made an oversight. I assumed
+the process would be able to address 25% of physical memory.
+
+However, for 32-bit processes running on a PAE kernel or 64-bit kernel,
+25% of physical memory can easily exceed the addressible memory for a
+32-bit process, e.g. if a machine has 24 GB of physical memory, the
+code would asume the process could easily use 6 GB.
+
+A 32-bit process by definition can only address 4 GB (32-bit pointers).
+But, due to the typical kernel/user-space split (1GB/3GB, or 2GB/2GB)
+on PAE kernels, a 32-bit process may only be able to address 2 GB.
+
+So, if Mksquashfs is a 32-bit application running on a PAE/64-bit kernel,
+the code assumes it can address much more memory than it really can, which
+means it runs out of memory.
+
+The fix is to impose a maximum default limit on 32-bit kernels, or
+otherwise to never use a value more than 25% of the address space. If
+we assume the maximum address space is 2 GB, then the maximum becomes
+512 MB. But, given most kernels used the 1GB/3GB split, that may be
+unduely conservative, and 25% of 3 GB (756 MB) may be better. This
+patch compromises on 640 MB, which is mid-way between the 512 MB and 756 MB
+values. It is also the fixed default value previously used by Mksquashfs.
+
+This patch also alters the code which imposes a maximum size. Previously
+it was believed limiting to the physical memory size was adequate. But
+obviously this needs to be updated to take into account a 32-bit process
+may only be able to address 2 GB. In the process I've also taken the
+opportunity to limit all requests to no more than 75% of physical memory.
+
+Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+---
+ squashfs-tools/mksquashfs.c | 78 ++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 70 insertions(+), 8 deletions(-)
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index 86f82bb..5370ecf 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -304,7 +304,7 @@ void restorefs();
+ struct dir_info *scan1_opendir(char *pathname, char *subpath, int depth);
+ void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad);
+ unsigned short get_checksum_mem(char *buff, int bytes);
+-int get_physical_memory();
++void check_usable_phys_mem(int total_mem);
+
+
+ void prep_exit()
+@@ -4053,11 +4053,7 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq,
+ BAD_ERROR("Queue sizes rediculously too large\n");
+ total_mem += fwriteq;
+
+- if(total_mem > get_physical_memory()) {
+- ERROR("Total queue sizes larger than physical memory.\n");
+- ERROR("Mksquashfs will exhaust physical memory and thrash.\n");
+- BAD_ERROR("Queues too large\n");
+- }
++ check_usable_phys_mem(total_mem);
+
+ /*
+ * convert from queue size in Mbytes to queue size in
+@@ -4879,6 +4875,72 @@ int get_physical_memory()
+ }
+
+
++void check_usable_phys_mem(int total_mem)
++{
++ /*
++ * We want to allow users to use as much of their physical
++ * memory as they wish. However, for practical reasons there are
++ * limits which need to be imposed, to protect users from themselves
++ * and to prevent people from using Mksquashfs as a DOS attack by using
++ * all physical memory. Mksquashfs uses memory to cache data from disk
++ * to optimise performance. It is pointless to ask it to use more
++ * than 75% of physical memory, as this causes thrashing and it is thus
++ * self-defeating.
++ */
++ int mem = get_physical_memory();
++
++ mem = (mem >> 1) + (mem >> 2); /* 75% */
++
++ if(total_mem > mem) {
++ ERROR("Total memory requested is more than 75%% of physical "
++ "memory.\n");
++ ERROR("Mksquashfs uses memory to cache data from disk to "
++ "optimise performance.\n");
++ ERROR("It is pointless to ask it to use more than this amount "
++ "of memory, as this\n");
++ ERROR("causes thrashing and it is thus self-defeating.\n");
++ BAD_ERROR("Requested memory size too large\n");
++ }
++
++ if(sizeof(void *) == 4 && total_mem > 2048) {
++ /*
++ * If we're running on a kernel with PAE or on a 64-bit kernel,
++ * then the 75% physical memory limit can still easily exceed
++ * the addressable memory by this process.
++ *
++ * Due to the typical kernel/user-space split (1GB/3GB, or
++ * 2GB/2GB), we have to conservatively assume the 32-bit
++ * processes can only address 2-3GB. So refuse if the user
++ * tries to allocate more than 2GB.
++ */
++ ERROR("Total memory requested may exceed maximum "
++ "addressable memory by this process\n");
++ BAD_ERROR("Requested memory size too large\n");
++ }
++}
++
++
++int get_default_phys_mem()
++{
++ int mem = get_physical_memory() / SQUASHFS_TAKE;
++
++ if(sizeof(void *) == 4 && mem > 640) {
++ /*
++ * If we're running on a kernel with PAE or on a 64-bit kernel,
++ * the default memory usage can exceed the addressable
++ * memory by this process.
++ * Due to the typical kernel/user-space split (1GB/3GB, or
++ * 2GB/2GB), we have to conservatively assume the 32-bit
++ * processes can only address 2-3GB. So limit the default
++ * usage to 640M, which gives room for other data.
++ */
++ mem = 640;
++ }
++
++ return mem;
++}
++
++
+ void calculate_queue_sizes(int mem, int *readq, int *fragq, int *bwriteq,
+ int *fwriteq)
+ {
+@@ -4890,7 +4952,7 @@ void calculate_queue_sizes(int mem, int *readq, int *fragq, int *bwriteq,
+
+
+ #define VERSION() \
+- printf("mksquashfs version 4.3 (2014/05/12)\n");\
++ printf("mksquashfs version 4.3-git (2014/06/09)\n");\
+ printf("copyright (C) 2014 Phillip Lougher "\
+ "<phillip@squashfs.org.uk>\n\n"); \
+ printf("This program is free software; you can redistribute it and/or"\
+@@ -4918,7 +4980,7 @@ int main(int argc, char *argv[])
+ int fragq;
+ int bwriteq;
+ int fwriteq;
+- int total_mem = get_physical_memory() / SQUASHFS_TAKE;
++ int total_mem = get_default_phys_mem();
+ int progress = TRUE;
+ int force_progress = FALSE;
+ struct file_buffer **fragment = NULL;
diff --git a/debian/patches/0003-CVE-2015-4645_and_CVE-2015-4646.patch b/debian/patches/0003-CVE-2015-4645_and_CVE-2015-4646.patch
new file mode 100644
index 0000000..d81639f
--- /dev/null
+++ b/debian/patches/0003-CVE-2015-4645_and_CVE-2015-4646.patch
@@ -0,0 +1,76 @@
+From 6777e08cc38bc780d27c69c1d8c272867b74524f Mon Sep 17 00:00:00 2001
+From: Giancarlo Canales Barreto <gcanalesb@me.com>
+Date: Wed, 17 Jun 2015 00:22:19 -0400
+Subject: [PATCH] Update unsquash-4.c
+
+There seems to be a stack overflow in read_fragment_table_4 at via what seems to be an integer overflow. Still looking into this problem, it seems like two or three different problems combined.
+
+The first problem overflows the bytes variable, so that the allocation is enormous.
+```c
+int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
+```
+
+If we fix this by making the variable size_t, we run into an unrelated problem in which the stack VLA allocation of fragment_table_index can easily exceed RLIMIT_STACK.
+```c
+long long fragment_table_index[indexes];
+```
+
+In the case of my system, the RLIMIT_STACK is 8388608, and VLA is asking for 15728648. Plus the stack probably already has a bunch of other things. This is what I believe ultimately leads to the stack overflow.
+
+Afterwards, the heap allocation seems to succeed, and the disastrous call to read_fs_bytes is made, which initiates transfer from the squashfs image to the stack. At this stage, a stack overflow appears to be in full effect.
+
+```c
+ res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+ SQUASHFS_FRAGMENT_INDEX_BYTES(sBlk.s.fragments),
+ fragment_table_index);
+```
+This problem is also present in other read_fragment_table_N functions, and in in the original squashfs-tools.
+
+```
+Parallel unsquashfs: Using 8 processors
+ASAN:SIGSEGV
+=================================================================
+==8221==ERROR: AddressSanitizer: stack-overflow on address 0x7ffef3ae9608 (pc 0x000000559011 bp 0x7ffef49e9670 sp 0x7ffef3ae9610 T0)
+ #0 0x559010 in read_fragment_table_4 /home/septimus/vr/squashfs-vr/squashfs-tools/unsquash-4.c:40:9
+ #1 0x525073 in main /home/septimus/vr/squashfs-vr/squashfs-tools/unsquashfs.c:2763:5
+ #2 0x7fb56c533a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
+ #3 0x418468 in _start (/home/septimus/vr/squashfs-vr/squashfs-tools/unsquashfs+0x418468)
+SUMMARY: AddressSanitizer: stack-overflow /home/septimus/vr/squashfs-vr/squashfs-tools/unsquash-4.c:40:9 in read_fragment_table_4
+==8221==ABORTING
+```
+
+Perhaps we should avoid using VLA altogether, and allocate fragment_table_index to the heap?
+This pull request is an example implementation of the fix for unsquash-4, but I don't have enough test vectors to verify it will not break anything.
+---
+ unsquash-4.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c
+index ecdaac7..2c0cf63 100644
+--- a/squashfs-tools/unsquash-4.c
++++ b/squashfs-tools/unsquash-4.c
+@@ -31,9 +31,9 @@ static unsigned int *id_table;
+ int read_fragment_table_4(long long *directory_table_end)
+ {
+ int res, i;
+- int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
+- int indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
+- long long fragment_table_index[indexes];
++ size_t bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
++ size_t indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
++ long long *fragment_table_index;
+
+ TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+ "from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -44,6 +44,11 @@ int read_fragment_table_4(long long *directory_table_end)
+ return TRUE;
+ }
+
++ fragment_table_index = malloc(indexes*sizeof(long long));
++ if(fragment_table_index == NULL)
++ EXIT_UNSQUASH("read_fragment_table: failed to allocate "
++ "fragment table index\n");
++
+ fragment_table = malloc(bytes);
+ if(fragment_table == NULL)
+ EXIT_UNSQUASH("read_fragment_table: failed to allocate "
diff --git a/debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch b/debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch
new file mode 100644
index 0000000..258416b
--- /dev/null
+++ b/debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch
@@ -0,0 +1,102 @@
+From c2dc60a94b01a1fff4a22db1c0569651afa6c959 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski@gmail.com>
+Date: Wed, 19 Oct 2011 11:44:57 +0200
+Subject: [PATCH] unsquashfs: add support for LZMA magics
+X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM<pyWR#k60!#=#>/Vb;]yA5<GWI5`6u&+
+ ;6b'@y|8w"wB;4/e!7wYYrcqdJFY,~%Gk_4]cq$Ei/7<j&N3ah(m`ku?pX.&+~:_/wC~dwn^)MizBG
+ !pE^+iDQQ1yC6^,)YDKkxDd!T>\I~93>J<_`<4)A{':UrE
+
+Some vendor (e.g. Thomson/Technicolor) use a different super block magic
+to indicate LZMA compression:
+
+ qshs (0x71736873) - LZMA compression
+ shsq (0x73687371) - LZMA compression, SWAPPED fields
+
+Add support for detecting this and enable extraction for filesystems
+from those firmwares.
+
+Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
+Tested-by: Antonio Ospite <ospite@studenti.unina.it>
+---
+ squashfs-tools/squashfs_fs.h | 6 ++++++
+ squashfs-tools/unsquashfs.c | 24 ++++++++++++++++++------
+ 2 files changed, 24 insertions(+), 6 deletions(-)
+
+diff --git a/squashfs-tools/squashfs_fs.h b/squashfs-tools/squashfs_fs.h
+index d4fba1b..8462a6b 100644
+--- a/squashfs-tools/squashfs_fs.h
++++ b/squashfs-tools/squashfs_fs.h
+@@ -30,6 +30,12 @@
+ #define SQUASHFS_MAGIC_SWAP 0x68737173
+ #define SQUASHFS_START 0
+
++/*
++ * Squashfs + LZMA
++ */
++#define SQUASHFS_MAGIC_LZMA 0x71736873
++#define SQUASHFS_MAGIC_LZMA_SWAP 0x73687371
++
+ /* size of metadata (inode and directory) blocks */
+ #define SQUASHFS_METADATA_SIZE 8192
+ #define SQUASHFS_METADATA_LOG 13
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+index 320bead..7869a38 100644
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -1516,10 +1516,12 @@ int read_super(char *source)
+ */
+ read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block),
+ &sBlk_4);
+- swap = sBlk_4.s_magic != SQUASHFS_MAGIC;
++ swap = (sBlk_4.s_magic != SQUASHFS_MAGIC &&
++ sBlk_4.s_magic != SQUASHFS_MAGIC_LZMA);
+ SQUASHFS_INSWAP_SUPER_BLOCK(&sBlk_4);
+
+- if(sBlk_4.s_magic == SQUASHFS_MAGIC && sBlk_4.s_major == 4 &&
++ if((sBlk_4.s_magic == SQUASHFS_MAGIC ||
++ sBlk_4.s_magic == SQUASHFS_MAGIC_LZMA) && sBlk_4.s_major == 4 &&
+ sBlk_4.s_minor == 0) {
+ s_ops.squashfs_opendir = squashfs_opendir_4;
+ s_ops.read_fragment = read_fragment_4;
+@@ -1532,7 +1534,11 @@ int read_super(char *source)
+ /*
+ * Check the compression type
+ */
+- comp = lookup_compressor_id(sBlk.s.compression);
++ if (sBlk_4.s_magic == SQUASHFS_MAGIC_LZMA)
++ comp = lookup_compressor("lzma");
++ else
++ comp = lookup_compressor_id(sBlk.s.compression);
++
+ return TRUE;
+ }
+
+@@ -1547,8 +1553,10 @@ int read_super(char *source)
+ * Check it is a SQUASHFS superblock
+ */
+ swap = 0;
+- if(sBlk_3.s_magic != SQUASHFS_MAGIC) {
+- if(sBlk_3.s_magic == SQUASHFS_MAGIC_SWAP) {
++ if(sBlk_3.s_magic != SQUASHFS_MAGIC &&
++ sBlk_3.s_magic != SQUASHFS_MAGIC_LZMA) {
++ if(sBlk_3.s_magic == SQUASHFS_MAGIC_SWAP ||
++ sBlk_3.s_magic == SQUASHFS_MAGIC_LZMA_SWAP) {
+ squashfs_super_block_3 sblk;
+ ERROR("Reading a different endian SQUASHFS filesystem "
+ "on %s\n", source);
+@@ -1626,7 +1634,11 @@ int read_super(char *source)
+ /*
+ * 1.x, 2.x and 3.x filesystems use gzip compression.
+ */
+- comp = lookup_compressor("gzip");
++ if (sBlk.s.s_magic == SQUASHFS_MAGIC_LZMA)
++ comp = lookup_compressor("lzma");
++ else
++ comp = lookup_compressor("gzip");
++
+ return TRUE;
+
+ failed_mount:
+--
+1.7.10.4
+
diff --git a/debian/patches/0006-uptream-fix-race.patch b/debian/patches/0006-uptream-fix-race.patch
new file mode 100644
index 0000000..3cefbe5
--- /dev/null
+++ b/debian/patches/0006-uptream-fix-race.patch
@@ -0,0 +1,54 @@
+commit de03266983ceb62e5365aac84fcd3b2fd4d16e6f
+Author: Phillip Lougher <phillip@squashfs.org.uk>
+Date: Thu Sep 18 01:28:11 2014 +0100
+
+ mksquashfs: fix rare race in fragment waiting in filesystem finalisation
+
+ Fix a rare race condition in fragment waiting when finalising the
+ filesystem. This is a race condition that was initially fixed in 2009,
+ but inadvertantly re-introduced in the latest release when the code
+ was rewritten.
+
+ Background:
+
+ When finalising the filesystem, the main control thread needs to ensure
+ all the in-flight fragments have been queued to the writer thread before
+ asking the writer thread to finish, and then writing the metadata.
+
+ It does this by waiting on the fragments_outstanding counter. Once this
+ counter reaches 0, it synchronises with the writer thread, waiting until
+ the writer thread reports no outstanding data to be written.
+
+ However, the main thread can race with the fragment deflator thread(s)
+ because the fragment deflator thread(s) decrement the fragments_outstanding
+ counter and release the mutex before queueing the compressed fragment
+ to the writer thread, i.e. the offending code is:
+
+ fragments_outstanding --;
+ pthread_mutex_unlock(&fragment_mutex);
+ queue_put(to_writer, write_buffer);
+
+ In extremely rare circumstances, the main thread may see the
+ fragments_outstanding counter is zero before the fragment
+ deflator sends the fragment buffer to the writer thread, and synchronise
+ with the writer thread, and finalise before the fragment has been written.
+
+ The fix is to ensure the fragment is queued to the writer thread
+ before releasing the mutex.
+
+ Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index 87b7d86..f1fcff1 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -2445,8 +2445,8 @@ void *frag_deflator(void *arg)
+ write_buffer->block = bytes;
+ bytes += compressed_size;
+ fragments_outstanding --;
+- pthread_mutex_unlock(&fragment_mutex);
+ queue_put(to_writer, write_buffer);
++ pthread_mutex_unlock(&fragment_mutex);
+ TRACE("Writing fragment %lld, uncompressed size %d, "
+ "compressed size %d\n", file_buffer->block,
+ file_buffer->size, compressed_size);
diff --git a/debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch b/debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch
new file mode 100644
index 0000000..c689a3a
--- /dev/null
+++ b/debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch
@@ -0,0 +1,27 @@
+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 f1fcff1..d221c35 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -2055,7 +2055,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
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8975032
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,6 @@
+0001-kfreebsd.patch
+0002-fix_phys_mem_calculation.patch
+0003-CVE-2015-4645_and_CVE-2015-4646.patch
+0004-unsquashfs-add-support-for-LZMA-magics.patch
+0006-uptream-fix-race.patch
+0007-fix-2GB-limit-in-mksquashfs.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..e107e44
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,27 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export DEB_CFLAGS_MAINT_APPEND = -fgnu89-inline
+
+%:
+ dh ${@} --sourcedirectory=squashfs-tools/ --parallel
+
+override_dh_auto_configure:
+ dh_auto_configure -- $(shell dpkg-buildflags --export=cmdline)
+
+override_dh_auto_build:
+ LZMA_XZ_SUPPORT=1 LZ4_SUPPORT=1 LZO_SUPPORT=1 XZ_SUPPORT=1 dh_auto_build
+
+override_dh_auto_install:
+ dh_auto_install -- INSTALL_DIR=$(CURDIR)/debian/squashfs-tools/usr/bin
+
+override_dh_builddeb:
+ dh_builddeb -- -Zxz
+
+override_dh_strip:
+ dh_strip --dbg-package=squashfs-tools-dbg
+
+.PHONY: override_dh_auto_build override_dh_auto_install override_dh_strip override_dh_builddeb
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 0000000..5bd47b7
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+compression = xz
diff --git a/debian/squashfs-tools.manpages b/debian/squashfs-tools.manpages
new file mode 100644
index 0000000..2fb19fb
--- /dev/null
+++ b/debian/squashfs-tools.manpages
@@ -0,0 +1 @@
+debian/manpages/*