mirror of
https://github.com/openwrt/openwrt.git
synced 2024-11-23 01:45:38 +08:00
imagebuilder: fix APK for packages dir and cache
This commit solves multiple issues. First of just install the three special packages base-files, libc and kernel directly from the index. In upstream indexes, those will never appear to prevent accidental upgrades may breaking the system. Next, enable caching for the ImageBuilder, which speeds up consecutive builds from ~33 seconds to ~5 seconds. Using cache however makes APK create the folder `/var/cache/apk/` which conflicts with the base-files installation, which ships a symlink from `/var` to `/tmp`, so specify `--no-cache` for the rootfs initialization. Lastly, drop the use of `apk update` since APK automatically does that. Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
parent
15de218a56
commit
ad1c1b7047
@ -48,7 +48,6 @@ apk = \
|
||||
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk \
|
||||
--root $(1) \
|
||||
--keys-dir $(if $(APK_KEYS),$(APK_KEYS),$(TOPDIR)) \
|
||||
--no-cache \
|
||||
--no-logfile \
|
||||
--preserve-env
|
||||
|
||||
|
@ -98,7 +98,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 --no-scripts --arch $(ARCH_PACKAGES) \
|
||||
$(call apk,$(TARGET_DIR)) add --no-cache --initdb --no-scripts --arch $(ARCH_PACKAGES) \
|
||||
--repositories-file /dev/zero --repository file://$(PACKAGE_DIR_ALL)/packages.adb \
|
||||
$$(cat $(TMP_DIR)/apk_install_list)
|
||||
else
|
||||
@ -130,7 +130,7 @@ ifneq ($(CONFIG_USE_APK),)
|
||||
--keys-dir $(TOPDIR) \
|
||||
--sign $(BUILD_KEY_APK_SEC) \
|
||||
--output packages.adb \
|
||||
$$(ls *.apk | grep -v 'kernel\|libc'); \
|
||||
$$(ls *.apk | grep -v 'base-files\|kernel\|libc'); \
|
||||
done
|
||||
else
|
||||
@for d in $(PACKAGE_SUBDIRS); do ( \
|
||||
|
@ -71,15 +71,21 @@ endif
|
||||
ifeq ($(CONFIG_BUILDBOT),)
|
||||
ifeq ($(CONFIG_IB_STANDALONE),)
|
||||
$(FIND) $(call FeedPackageDir,libc) -type f \
|
||||
\( -name 'libc*.$(PACKAGE_SUFFIX)' -or -name 'kernel*.$(PACKAGE_SUFFIX)' -or -name 'kmod-*.$(PACKAGE_SUFFIX)' \) \
|
||||
-exec $(CP) -t $(PKG_BUILD_DIR)/packages {} +
|
||||
\( \
|
||||
-name 'base-files*.$(PACKAGE_SUFFIX)' -or \
|
||||
-name 'libc*.$(PACKAGE_SUFFIX)' -or \
|
||||
-name 'kernel*.$(PACKAGE_SUFFIX)' \) \
|
||||
-exec $(CP) -t $(PKG_BUILD_DIR)/packages {} +
|
||||
else
|
||||
$(FIND) $(wildcard $(PACKAGE_SUBDIRS)) -type f -name '*.$(PACKAGE_SUFFIX)' \
|
||||
-exec $(CP) -t $(PKG_BUILD_DIR)/packages/ {} +
|
||||
endif
|
||||
else
|
||||
$(FIND) $(call FeedPackageDir,libc) -type f \
|
||||
\( -name 'libc*.$(PACKAGE_SUFFIX)' -or -name 'kernel*.$(PACKAGE_SUFFIX)' \) \
|
||||
\( \
|
||||
-name 'base-files*.$(PACKAGE_SUFFIX)' -or \
|
||||
-name 'libc*.$(PACKAGE_SUFFIX)' -or \
|
||||
-name 'kernel*.$(PACKAGE_SUFFIX)' \) \
|
||||
-exec $(CP) -t $(IB_LDIR)/ {} +
|
||||
endif
|
||||
|
||||
|
@ -185,7 +185,6 @@ else
|
||||
(cd $(PACKAGE_DIR); $(APK) mkndx \
|
||||
$(if $(CONFIG_SIGNATURE_CHECK), --keys-dir $(APK_KEYS) --sign $(BUILD_KEY_APK_SEC)) \
|
||||
--allow-untrusted --output packages.adb *.apk) >/dev/null 2>/dev/null || true
|
||||
$(APK) update >&2 || true
|
||||
endif
|
||||
|
||||
package_reload:
|
||||
@ -208,7 +207,6 @@ else
|
||||
$(MAKE) package_index; \
|
||||
else \
|
||||
mkdir -p $(TARGET_DIR)/tmp; \
|
||||
$(APK) update >&2 || true; \
|
||||
fi
|
||||
endif
|
||||
|
||||
@ -228,8 +226,6 @@ ifeq ($(CONFIG_USE_APK),)
|
||||
$(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/kernel_*.ipk $(PACKAGE_DIR)/kernel_*.ipk))
|
||||
$(OPKG) install $(BUILD_PACKAGES)
|
||||
else
|
||||
$(APK) add --no-scripts $(firstword $(wildcard $(LINUX_DIR)/libc-*.apk $(PACKAGE_DIR)/libc-*.apk))
|
||||
$(APK) add --no-scripts $(firstword $(wildcard $(LINUX_DIR)/kernel-*.apk $(PACKAGE_DIR)/kernel-*.apk))
|
||||
$(APK) add --no-scripts $(BUILD_PACKAGES)
|
||||
endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user