summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Marko2025-11-19 12:46:29 +0000
committerRobert Marko2025-11-19 12:51:04 +0000
commitf4ff823435edd5343c54d01cb717dcadb12eaf13 (patch)
tree28cda7e8fac151e71be02539b1bde7c73b0a4417
parent9359fc93767ee9e1345c914d77b1cd09d1bdb78f (diff)
downloadopenwrt-f4ff823435edd5343c54d01cb717dcadb12eaf13.tar.gz
include: rootfs: fix APK compressed scripts tarball support
APK will generate the compressed scripts.tar by default, however we rely on using TAR support for updating the tarball on the fly and this does not work when tarball is compressed and will cause the following errors: staging_dir/host/bin/tar: Cannot update compressed archives Try /staging_dir/host/bin/tar --help' or staging_dir/host/bin/tar --usage' for more information. So, lets simply decompress the scripts.tar.gz before usage and then compress it after we are done. Fixes: 5d85657f6dbb ("apk-tools: implement compression of on-device scripts.tar") Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--include/rootfs.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/rootfs.mk b/include/rootfs.mk
index ebf4e40683..02fa3b13d7 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -78,7 +78,8 @@ define prepare_rootfs
cd $(1); \
if [ -n "$(CONFIG_USE_APK)" ]; then \
IPKG_POSTINST_PATH=./lib/apk/db/*.post-install; \
- $(STAGING_DIR_HOST)/bin/tar -C ./lib/apk/db/ -xzf ./lib/apk/db/scripts.tar.gz --wildcards "*.post-install"; \
+ $(STAGING_DIR_HOST)/bin/gzip -d ./lib/apk/db/scripts.tar; \
+ $(STAGING_DIR_HOST)/bin/tar -C ./lib/apk/db/ -xf ./lib/apk/db/scripts.tar --wildcards "*.post-install"; \
else \
IPKG_POSTINST_PATH=./usr/lib/opkg/info/*.postinst; \
fi; \
@@ -89,8 +90,9 @@ define prepare_rootfs
echo "postinst script $$script has failed with exit code $$ret" >&2; \
exit 1; \
fi; \
- [ -n "$(CONFIG_USE_APK)" ] && $(STAGING_DIR_HOST)/bin/tar --delete -zf ./lib/apk/db/scripts.tar.gz $$(basename $$script); \
+ [ -n "$(CONFIG_USE_APK)" ] && $(STAGING_DIR_HOST)/bin/tar --delete -f ./lib/apk/db/scripts.tar $$(basename $$script); \
done; \
+ [ -n "$(CONFIG_USE_APK)" ] && $(STAGING_DIR_HOST)/bin/gzip -f -9n -S ".gz" ./lib/apk/db/scripts.tar; \
if [ -z "$(CONFIG_USE_APK)" ]; then \
$(if $(IB),,awk -i inplace \
'/^Status:/ { \