[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: shrinking the squashfs image size



Am 18.02.2017 um 16:30 schrieb intrigeri:
>> Also, I would like to run mksquashfs with additional parameters
>> -b 1048576 -comp xz
>> as that seems to shrink the image even further, thus reducing transfer
>> times (even though RAM usage will probably be the same).
>> Where would I specify that?
> Use the MKSQUASHFS_OPTIONS environment variable.
> 
> FWIW, in Tails we determined experimentaly that these settings were
> the most efficient in our case:
> 
>   -comp xz -Xbcj x86 -b 1024K -Xdict-size 1024K

When I run

mksquashfs . ../my-file.squashfs -comp xz -Xbcj x86 -b 1024K -Xdict-size
1024K

(all on one line) manually, everything works as expected.

But, when I run
export MKSQUASHFS_OPTIONS="-comp xz -Xbcj x86 -b 1024K -Xdict-size 1024K"

(again, all on one line), followed by "lb build", I get:

mksquashfs: -comp must appear before -X options

Which I found rather confusing at first, as it appears in exactly that
order.

However, mksquashfs is called in /usr/lib/live/build/binary_rootfs,
which contains:

                if [ "${LB_MODE}" != "ubuntu" ]
                then
                        MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp xz"
                fi

so it adds "-comp xz" after the parameters set by the environment
variable, which in turn confuses mksquashfs, leading to a failed build. :-/

Any suggestions, other than patching /usr/lib/live/build/binary_rootfs?

Kind Regards,
Stefan Baur


Reply to: