base-files: fix build for /sbin/pkg_check
authorXu Wang <xwang1498@gmx.com>
Mon, 6 Jan 2020 17:12:43 +0000 (17:12 +0000)
committerJo-Philipp Wich <jo@mein.io>
Tue, 14 Jan 2020 16:52:34 +0000 (17:52 +0100)
Setting CONFIG_IPK_FILES_CHECKSUMS=y causes sha256 checksum files to be
included with the packages to check for corruption. This commit fixes two
issues:
- /sbin/pkg_check was being removed incorrectly if IPK_FILES_CHECKSUMS=y
- checksums were being saved in the wrong file

Signed-off-by: Xu Wang <xwang1498@gmx.com>
include/package-ipkg.mk
package/base-files/Makefile

index 442d3854f046f5795e24d6ad7c5031b083f9e54f..c4c8f4a36feb613ea4065099e55f624970127737 100644 (file)
@@ -207,7 +207,7 @@ $(_endef)
        (cd $$(IDIR_$(1)); \
                ( \
                        find . -type f \! -path ./CONTROL/\* -exec sha256sum \{\} \; 2> /dev/null | \
-                       sed 's|\([[:blank:]]\)\./|\1/|' > $$(IDIR_$(1))/CONTROL/files-sha256 \
+                       sed 's|\([[:blank:]]\)\./|\1/|' > $$(IDIR_$(1))/CONTROL/files-sha256sum \
                ) || true \
        )
     endif
index 35ad80888f070d6c1426c912a22d31ae1217d09f..268d7d4cc9e4a3654febd97d0deb182b4f3aab78 100644 (file)
@@ -204,8 +204,8 @@ define Package/base-files/install
                mkdir -p $(1)/etc/opkg; \
                $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
                $(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf)
-       $(if $(CONFIG_IPK_FILES_CHECKSUMS), \
-               rm -f $(1)/sbin/pkg_check,)
+       $(if $(CONFIG_IPK_FILES_CHECKSUMS),, \
+               rm -f $(1)/sbin/pkg_check)
 endef
 
 ifneq ($(DUMP),1)