From 5af7ce9b0bd521b7f35c45aad8562bebcdcc50ea Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sat, 17 Oct 2020 10:06:03 -1000 Subject: [PATCH] build,IB: reload packages/ only if existing With the fix of external kmod feeds it is possible to ship the ImageBuilder without any packages except the pseudo packages kernel and libc. Therefore the local package feeds becomes optional. This commit adds a check to the package_reload function to only run if the local feed is existing. Signed-off-by: Paul Spooren --- target/imagebuilder/files/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 36f1f20c95..70e0e7b3ca 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -133,7 +133,10 @@ package_index: FORCE $(OPKG) update >&2 || true package_reload: - if [ ! -f "$(PACKAGE_DIR)/Packages" ] || [ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ]; then \ + if [ -d "$(PACKAGE_DIR)" ] && ( \ + [ ! -f "$(PACKAGE_DIR)/Packages" ] || \ + [ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || \ + [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ] ); then \ echo "Package list missing or not up-to-date, generating it." >&2 ;\ $(MAKE) package_index; \ else \