[source] package-ipkg: Do not fail build without base-files

LEDE Commits lede-commits at lists.infradead.org
Tue Jan 24 11:15:06 PST 2017


florian pushed a commit to source.git, branch master:
https://git.lede-project.org/25e2cf392a7ff6c3ba6aee2ab1fa64d42f076776

commit 25e2cf392a7ff6c3ba6aee2ab1fa64d42f076776
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Fri Dec 9 16:04:49 2016 -0800

    package-ipkg: Do not fail build without base-files
    
    If the base-files package is not selected, we will fail executing the
    very first postinst script:
    
    make[3]: Leaving directory `/local/users/fainelli/openwrt/trunk'
    cp -fpR
    /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root-orion
    /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root.orig-orion
    ./usr/lib/opkg/info/busybox.postinst: line 3:
    /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root-orion/lib/functions.sh:
    No such file or directory
    ./usr/lib/opkg/info/busybox.postinst: line 4: default_postinst: command
    not found
    postinst script ./usr/lib/opkg/info/busybox.postinst has failed with
    exit code 127
    make[2]: *** [package/install] Error 1
    
    Check for the existence of lib/functions.sh, and if it does not exist,
    just bail out gracefully.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 include/package-ipkg.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 3e2e31c..b9d67f5 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -207,11 +207,13 @@ $(_endef)
 		( \
 			echo "#!/bin/sh"; \
 			echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
+			echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
 			echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
 			echo "default_postinst \$$$$0 \$$$$@"; \
 		) > postinst; \
 		( \
 			echo "#!/bin/sh"; \
+			echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
 			echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
 			echo "default_prerm \$$$$0 \$$$$@"; \
 		) > prerm; \



More information about the lede-commits mailing list