Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support squashfs* properly #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ZeroChaos-
Copy link

@ZeroChaos- ZeroChaos- commented Oct 20, 2020

More or less this adds squashfs_zstd support and fixes the squashfs types to actually work for compression.

This now works as expected for squashfs_zstd. It should decompress any squashfs* options, I haven't tested compressing them all yet.

New catalyst doesn't use pydecomp for compressing snapshots, but this does work properly with stages.

@ZeroChaos- ZeroChaos- changed the title CHANGES NEEDED Changes desired Oct 20, 2020
@ZeroChaos- ZeroChaos- changed the title Changes desired support squashfs* properly Oct 23, 2020
additionally, fixup squashfs compression and decompression
@ZeroChaos-
Copy link
Author

Okay, this is correct, my other issues were caused by catalyst oddities which I will resolve in my catalyst fork I guess. This should be good to go

if not infodict['arch']:
sqfs_opts.remove("-Xbcj")
sqfs_opts.remove("%(arch)s")
if infodict['mode'] == "squashfs_xz":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rick, why did you limit the next block to only to squashfs_xz?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the squashfs_xz definition contains "-Xbcj %(arch)s"

"squashfs_xz": [
"_sqfs", "mksquashfs",
[
"%(basedir)s/%(source)s", "%(filename)s", "-comp", "xz",
"-Xbcj", "%(arch)s", "-b", "1M", "other_options"
],
"SQUASHFS", ["squashfs", "sfs"], {"mksquashfs"},
],
"squashfs_gzip": [
"_sqfs", "mksquashfs",
[
"%(basedir)s/%(source)s", "%(filename)s", "-comp", "gzip",
"-b", "1M", "other_options"
],
"SQUASHFS", ["squashfs", "sfs"], {"mksquashfs"},
],
"squashfs_zstd": [
"_sqfs", "mksquashfs",
[
"%(basedir)s/%(source)s", "%(filename)s", "-comp", "zstd",
"-Xcompression-level", "2", "-b", "1M", "other_options"
],
"SQUASHFS", ["squashfs", "sfs"], {"mksquashfs"},
],
"squashfs_pzstd": [
"_sqfs", "mksquashfs",
[
"%(basedir)s/%(source)s", "%(filename)s", "-comp", "pzstd",
"-Xcompression-level", "2", "-b", "1M", "other_options"
],
"SQUASHFS", ["squashfs", "sfs"], {"mksquashfs"},
],

For other compression types, raises:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/DeComp/compress.py", line 135, in _compress
    return self._run(infodict)
  File "/usr/lib/python3.9/site-packages/DeComp/compress.py", line 202, in _run
    success = func(infodict)
  File "/usr/lib/python3.9/site-packages/DeComp/compress.py", line 421, in _sqfs
    sqfs_opts.remove("-Xbcj")
ValueError: list.remove(x): x not in list

"-Xcompression-level", "19", "-b", "1M", "-no-recovery", "-noappend", "other_options"
],
"SQUASHFS", ["squashfs", "sfs"], {"mksquashfs"},
],
"squashfs_xz": [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've merged a different PR that added this plus pzstd

"other_options", "-d", "%(destination)s",
"%(basedir)s/%(source)s"
"other_options", "-f", "-d", "%(destination)s",
"%(source)s"
],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this change. You dropped %(basedir)s/ which is common to all, plus you can use the other_options variable to add the -f flag for your use case without hard coding it.. This change forces the -f flag to everyone.

@ZeroChaos-
Copy link
Author

Honestly, this was all written quite some time ago and I've been using my fork since then. I don't remember why I did most of this, but it was to make it work right with catalyst.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants