--- zzzz-none-000/linux-4.9.276/fs/squashfs/xz_wrapper.c 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/fs/squashfs/xz_wrapper.c 2023-04-05 08:19:02.000000000 +0000 @@ -39,10 +39,28 @@ struct xz_buf buf; }; +/* + * These changes are needed for OpenWrt till and including version 15.5 CC + * because the default squashfs tool uses a different format. Upstream squashfs + * tools and the squashfs tools shipped with LEDE are using the default format. + * If this is not fixed, Squash over UBIFS will fail to mount. + * Use the GCC version to detect if we are in a OpenWrt CC environment or in + * something else, GCC version < 5 means we are in OpenWrt CC. + * TODO: try to get rid of this hack + */ +#if GCC_VERSION < 50000 +struct disk_comp_opts { + __le32 flags; + __le16 bit_opts; + __le16 fb; + __le32 dictionary_size; +}; +#else struct disk_comp_opts { __le32 dictionary_size; __le32 flags; }; +#endif struct comp_opts { int dict_size; @@ -68,7 +86,7 @@ goto out; } - opts->dict_size = le32_to_cpu(comp_opts->dictionary_size); + opts->dict_size = squash_le32_to_cpu(comp_opts->dictionary_size); /* the dictionary size should be 2^n or 2^n+2^(n+1) */ n = ffs(opts->dict_size) - 1;