astro / nix-openwrt-imagebuilder

Build OpenWRT images in Nix derivations
MIT License
129 stars 16 forks source link

builder: Support zst #41

Closed pedorich-n closed 3 months ago

pedorich-n commented 3 months ago

Since https://github.com/openwrt/openwrt/pull/14971 OpenWRT provides builds compressed using zst. So the file extension is not .tar.xz but .tar.zst now. For example, openwrt-imagebuilder-mediatek-filogic.Linux-x86_64.tar.zst

This PR makes the builder support both file extensions. If both of them are present in the variantFiles at the same time (not sure if it's possible), then the zst will be chosen.

Tested with 23.05.3 (xz) and snapshot (zst) using the "raw" profile definition rather than identifyProfile:

unpacking source archive /nix/store/z1zpipi2s5gz827m3pjncss3z3mjqm55-openwrt-imagebuilder-23.05.3-mediatek-filogic.Linux-x86_64.tar.xz
...
unpacking source archive /nix/store/fb2kfshazbnpd2s5jr76d1njgy4brpv2-openwrt-imagebuilder-mediatek-filogic.Linux-x86_64.tar.zst
astro commented 3 months ago

Thank you very much!