diff --git a/include/image.mk b/include/image.mk index b154d835f41482..af394c078ff20b 100644 --- a/include/image.mk +++ b/include/image.mk @@ -332,7 +332,8 @@ opkg_target = \ $(call opkg,$(mkfs_cur_target_dir)) \ -f $(mkfs_cur_target_dir).conf -apk_target = $(call apk,$(mkfs_cur_target_dir)) +apk_target = $(call apk,$(mkfs_cur_target_dir)) --no-scripts + target-dir-%: FORCE ifdef CONFIG_USE_APK diff --git a/include/rootfs.mk b/include/rootfs.mk index 6e6f3b60599bcf..c51e778d042829 100644 --- a/include/rootfs.mk +++ b/include/rootfs.mk @@ -50,7 +50,6 @@ apk = \ --keys-dir $(TOPDIR) \ --no-cache \ --no-logfile \ - --no-scripts \ --preserve-env \ --repository file://$(PACKAGE_DIR_ALL)/packages.adb @@ -92,6 +91,7 @@ define prepare_rootfs exit 1; \ fi; \ done; \ + $(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status); \ fi; \ for script in ./etc/init.d/*; do \ grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \ @@ -103,7 +103,6 @@ define prepare_rootfs echo "Disabling" $$(basename $$script); \ fi; \ done || true \ - $(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 diff --git a/package/Makefile b/package/Makefile index c351c16f873831..aa35e459558bd6 100644 --- a/package/Makefile +++ b/package/Makefile @@ -87,8 +87,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(curdir)/merge-index ifneq ($(CONFIG_USE_APK),) $(file >$(TMP_DIR)/apk_install_list,\ $(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg)))) - - $(call apk,$(TARGET_DIR)) add --initdb --arch $(ARCH_PACKAGES) $$(cat $(TMP_DIR)/apk_install_list) + $(call apk,$(TARGET_DIR)) add --no-scripts --initdb --arch $(ARCH_PACKAGES) $$(cat $(TMP_DIR)/apk_install_list) else $(file >$(TMP_DIR)/opkg_install_list,\ $(call opkg_package_files,\ diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 350ea84ec0a6c4..0d77a72479de0a 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -186,7 +186,11 @@ config_list_foreach() { } default_prerm() { - update_alternatives remove + local root="${IPKG_INSTROOT}" + local pkgname="$(basename ${1%.*})" + local ret=0 + + update_alternatives remove "$pkgname" local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root/lib/apk/packages/${pkgname}.list"); do @@ -258,6 +262,7 @@ add_group_and_user() { update_alternatives() { local action="$1" + local pkgname="$2" if [ -f "$root/lib/apk/packages/${pkgname}.alternatives" ]; then for pkg_alt in $(cat $root/lib/apk/packages/${pkgname}.alternatives); do @@ -314,7 +319,7 @@ default_postinst() { add_group_and_user "${pkgname}" else filelist="${root}/lib/apk/packages/${pkgname}.list" - update_alternatives install + update_alternatives install "${pkgname}" fi if [ -d "$root/rootfs-overlay" ]; then