X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Frootfs.mk;h=90d70a11f2e775c83b9907ec1f296c0e4d535ad6;hb=19d3b78304794bc5c87dc74df4c3735715579b5c;hp=4b4482c2131bd3e6bc503aa50bee25bd6a69c635;hpb=37e82e4e42155901756a67ad14f3d5c1335f3b0a;p=librecmc%2Flibrecmc.git diff --git a/include/rootfs.mk b/include/rootfs.mk index 4b4482c213..90d70a11f2 100644 --- a/include/rootfs.mk +++ b/include/rootfs.mk @@ -34,19 +34,18 @@ ifdef CONFIG_USE_MKLIBS endif # where to build (and put) .ipk packages -OPKG:= \ +opkg = \ IPKG_NO_SCRIPT=1 \ - IPKG_INSTROOT=$(TARGET_DIR) \ - $(XARGS) $(STAGING_DIR_HOST)/bin/opkg \ - --offline-root $(TARGET_DIR) \ - --force-depends \ - --force-overwrite \ + IPKG_INSTROOT=$(1) \ + TMPDIR=$(1)/tmp \ + $(STAGING_DIR_HOST)/bin/opkg \ + --offline-root $(1) \ --force-postinstall \ - --force-maintainer \ --add-dest root:/ \ --add-arch all:100 \ --add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 +TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD) define prepare_rootfs @if [ -d $(TOPDIR)/files ]; then \ @@ -57,6 +56,11 @@ define prepare_rootfs cd $(1); \ for script in ./usr/lib/opkg/info/*.postinst; do \ IPKG_INSTROOT=$(1) $$(which bash) $$script; \ + ret=$$?; \ + if [ $$ret -ne 0 ]; then \ + echo "postinst script $$script has failed with exit code $$ret" >&2; \ + exit 1; \ + fi; \ done; \ for script in ./etc/init.d/*; do \ grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \ @@ -68,6 +72,7 @@ define prepare_rootfs @-find $(1) -name .svn | $(XARGS) rm -rf @-find $(1) -name .git | $(XARGS) rm -rf @-find $(1) -name '.#*' | $(XARGS) rm -f + rm -f $(1)/usr/lib/opkg/lists/* rm -f $(1)/usr/lib/opkg/info/*.postinst* rm -f $(1)/usr/lib/opkg/info/*.prerm* $(if $(CONFIG_CLEAN_IPKG),rm -rf $(1)/usr/lib/opkg)