Hi,

Quoting Vagrant Cascadian (2021-06-05 03:09:52)
> When mmdebstrap produces a tarball directly, it sets different tarball
> options:
> 
>     # tar2sqfs and genext2fs do not support extended attributes
>     if ($format eq "squashfs") {
>         warning("tar2sqfs does not support extended attributes"
>               . " from the 'system' namespace");
>         push @taropts, '--xattrs', '--xattrs-exclude=system.*';
> 
> But if you're trying to generate a squashfs image with different default
> compression (e.g. zstd), you have to pipe the mmdebstrap output to
> tar2sqfs. But in this case, tar is not passed the above options, as it
> is generating a tarball...

yes. But you can filter the tarball and remove the system.* xattr later:

mmdebstrap ... | mmtarfilter --pax-exclude=SCHILY.xattr.system.* | tar2sqfs ...

> Related, the default tar2sqfs options described in the man page:
> 
>        By default, mmdebstrap runs tar2sqfs with "--no-skip --exportable
>        --compressor xz --block-size 1048576". To choose a different set of
>        options, pipe the output of mmdebstrap into tar2sqfs manually.
> 
> Are somewhat inconsistent with the ones used in the code:
> 
>         if ($format eq 'squashfs') {
>           push @argv, 'tar2sqfs',
>           '--quiet', '--no-skip', '--force',
>           '--exportable',
>           '--compressor', 'xz',
>           '--block-size', '1048576',

Ah whoops, thanks!

> Maybe I'm missing something, but it would be very nice to be able to at least
> append to options passed to tar2sqfs (presuming it doesn't error when passing
> two different --compressor arguments), rather than having to extract them
> from the manpage and/or code, especially given that the tar output changes
> when you create a regular tarball vs. when mmdebstrap is aware that the
> eventual destination is a squashfs...

Is that such a common task? Are you running mmdebstrap manually and find
yourself piping it to tar2sqfs by hand? Do you maybe suggest that the default
options might need changing? I'm trying to understand your use-case here.

> I'm also realizing that the squashfs call doesn't pass --num-jobs=0 to
> tar2sqfs (similar to when creating a .tar.zst).

Indeed that can be fixed.

> Apologies if I'm comingling too many seemingly related issues into a
> single bug report.

Nah, it's fine. There is also overhead to each bug report and for tiny issues,
it's okay to bundle them up. :)

> As always, many thanks for mmdebstrap!

You're welcome!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to