From be9023ed4311c89fedad17c9d8b821828565903e Mon Sep 17 00:00:00 2001 From: Justin Klaassen Date: Thu, 18 Jan 2024 15:36:22 +0000 Subject: [PATCH] build: fix opkg flags in rootfs By default opkg sets the "user" flag when a package is installed, which resulted in most packages in the rootfs having this flag set incorrectly. This patch removes the "user" flag from all installed packages when preparing the rootfs image. Fixes: #14427 Signed-off-by: Justin Klaassen --- include/rootfs.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/rootfs.mk b/include/rootfs.mk index f2ed648d2f3e..2128aefc2abd 100644 --- a/include/rootfs.mk +++ b/include/rootfs.mk @@ -87,6 +87,11 @@ define prepare_rootfs fi; \ done || true \ ) + awk -i inplace \ + '/^Status:/ { \ + if ($$3 == "user") { $$3 = "ok" } \ + else { sub(/,\|\,/, "", $$3) } \ + }1' $(1)/usr/lib/opkg/status $(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status) @-find $(1) -name CVS -o -name .svn -o -name .git -o -name '.#*' | $(XARGS) rm -rf rm -rf \ -- 2.30.2