Skip to content

Commit

Permalink
squashfs_zstd support
Browse files Browse the repository at this point in the history
additionally, fixup squashfs compression and decompression
  • Loading branch information
ZeroChaos- committed Oct 26, 2020
1 parent ae26248 commit f033f1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 4 additions & 3 deletions DeComp/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,10 @@ def _sqfs(self, infodict):
self.extension(cmdinfo["mode"])

sqfs_opts = self._sub_other_options(cmdlist.args, cmdinfo)
if not infodict['arch']:
sqfs_opts.remove("-Xbcj")
sqfs_opts.remove("%(arch)s")
if infodict['mode'] == "squashfs_xz":
if not infodict['arch']:
sqfs_opts.remove("-Xbcj")
sqfs_opts.remove("%(arch)s")
opts = ' '.join(sqfs_opts) % (cmdinfo)
args = ' '.join([cmdlist.cmd, opts])

Expand Down
12 changes: 10 additions & 2 deletions DeComp/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ class functions do.
],
"GZIP", ["tar.gz"], {"tar"},
],
"squashfs_zstd": [
"_sqfs", "mksquashfs",
[
"%(basedir)s/%(source)s", "%(filename)s", "-comp", "zstd",
"-Xcompression-level", "19", "-b", "1M", "-no-recovery", "-noappend", "other_options"
],
"SQUASHFS", ["squashfs", "sfs"], {"mksquashfs"},
],
"squashfs_xz": [
"_sqfs", "mksquashfs",
[
Expand Down Expand Up @@ -376,8 +384,8 @@ class functions do.
"squashfs": [
"_common", "unsquashfs",
[
"other_options", "-d", "%(destination)s",
"%(basedir)s/%(source)s"
"other_options", "-f", "-d", "%(destination)s",
"%(source)s"
],
"SQUASHFS", ["squashfs", "sfs"], {"unsquashfs"},
],
Expand Down

0 comments on commit f033f1c

Please sign in to comment.