-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
Conversation
additionally, fixup squashfs compression and decompression
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": |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"
pyDeComp/DeComp/definitions.py
Lines 199 to 230 in 0e53690
"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": [ |
There was a problem hiding this comment.
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" | ||
], |
There was a problem hiding this comment.
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.
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. |
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.