mirror of
https://github.com/Heleguo/lede.git
synced 2025-12-16 19:01:32 +00:00
feeds: add APK package build support
This commit is contained in:
parent
81818f9b19
commit
0226adfb37
@ -70,8 +70,7 @@ menu "Global build settings"
|
|||||||
|
|
||||||
config USE_APK
|
config USE_APK
|
||||||
imply PACKAGE_apk-mbedtls
|
imply PACKAGE_apk-mbedtls
|
||||||
bool "Use APK instead of OPKG to build distribution (BROKEN)"
|
bool "Use APK instead of OPKG to build distribution (EXPERIMENTAL)"
|
||||||
depends on BROKEN
|
|
||||||
|
|
||||||
comment "General build options"
|
comment "General build options"
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,10 @@ opkg_package_files = $(wildcard \
|
|||||||
$(foreach dir,$(PACKAGE_SUBDIRS), \
|
$(foreach dir,$(PACKAGE_SUBDIRS), \
|
||||||
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
|
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
|
||||||
|
|
||||||
|
apk_package_files = $(wildcard \
|
||||||
|
$(foreach dir,$(PACKAGE_SUBDIRS), \
|
||||||
|
$(foreach pkg,$(1), $(dir)/$(pkg)_*.apk)))
|
||||||
|
|
||||||
# 1: package name
|
# 1: package name
|
||||||
define FeedPackageDir
|
define FeedPackageDir
|
||||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||||
@ -41,6 +45,34 @@ define FeedSourcesAppend
|
|||||||
) >> $(1)
|
) >> $(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# 1: destination file
|
||||||
|
define FeedSourcesAppendOPKG
|
||||||
|
( \
|
||||||
|
echo 'src/gz %d_core %U/targets/%S/packages'; \
|
||||||
|
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||||
|
echo 'src/gz %d_base %U/packages/%A/base'; \
|
||||||
|
$(if $(CONFIG_BUILDBOT), \
|
||||||
|
echo 'src/gz %d_kmods %U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)';) \
|
||||||
|
$(foreach feed,$(FEEDS_AVAILABLE), \
|
||||||
|
$(if $(CONFIG_FEED_$(feed)), \
|
||||||
|
echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )src/gz %d_$(feed) %U/packages/%A/$(feed)';)))) \
|
||||||
|
) >> $(1)
|
||||||
|
endef
|
||||||
|
|
||||||
|
# 1: destination file
|
||||||
|
define FeedSourcesAppendAPK
|
||||||
|
( \
|
||||||
|
echo '%U/targets/%S/packages/packages.adb'; \
|
||||||
|
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||||
|
echo '%U/packages/%A/base/packages.adb'; \
|
||||||
|
$(if $(CONFIG_BUILDBOT), \
|
||||||
|
echo '%U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)/packages.adb';) \
|
||||||
|
$(foreach feed,$(FEEDS_AVAILABLE), \
|
||||||
|
$(if $(CONFIG_FEED_$(feed)), \
|
||||||
|
echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )%U/packages/%A/$(feed)/packages.adb';)))) \
|
||||||
|
) >> $(1)
|
||||||
|
endef
|
||||||
|
|
||||||
# 1: package name
|
# 1: package name
|
||||||
define GetABISuffix
|
define GetABISuffix
|
||||||
$(if $(ABIV_$(1)),$(ABIV_$(1)),$(call FormatABISuffix,$(1),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
|
$(if $(ABIV_$(1)),$(ABIV_$(1)),$(call FormatABISuffix,$(1),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
|
||||||
|
|||||||
@ -113,6 +113,14 @@ define Build/Compile/Default
|
|||||||
endef
|
endef
|
||||||
Build/Compile = $(Build/Compile/Default)
|
Build/Compile = $(Build/Compile/Default)
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_USE_APK),)
|
||||||
|
ifndef CONFIG_BUILDBOT
|
||||||
|
define Package/base-files/install-key
|
||||||
|
mkdir -p $(1)/etc/apk/keys
|
||||||
|
$(CP) $(BUILD_KEY_APK_PUB) $(1)/etc/apk/keys/
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
else
|
||||||
ifdef CONFIG_SIGNED_PACKAGES
|
ifdef CONFIG_SIGNED_PACKAGES
|
||||||
define Build/Configure
|
define Build/Configure
|
||||||
[ -s $(BUILD_KEY) -a -s $(BUILD_KEY).pub ] || \
|
[ -s $(BUILD_KEY) -a -s $(BUILD_KEY).pub ] || \
|
||||||
@ -131,6 +139,7 @@ ifndef CONFIG_BUILDBOT
|
|||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_NAND_SUPPORT),)
|
ifeq ($(CONFIG_NAND_SUPPORT),)
|
||||||
define Package/base-files/nand-support
|
define Package/base-files/nand-support
|
||||||
@ -229,16 +238,26 @@ endif
|
|||||||
cat $(BIN_DIR)/feeds.buildinfo >>$(1)/etc/build.feeds; \
|
cat $(BIN_DIR)/feeds.buildinfo >>$(1)/etc/build.feeds; \
|
||||||
cat $(BIN_DIR)/version.buildinfo >>$(1)/etc/build.version)
|
cat $(BIN_DIR)/version.buildinfo >>$(1)/etc/build.version)
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_USE_APK),)
|
||||||
|
mkdir -p $(1)/etc/apk/repositories.d
|
||||||
|
$(call FeedSourcesAppendAPK,$(1)/etc/apk/repositories.d/distfeeds.list)
|
||||||
|
$(VERSION_SED_SCRIPT) $(1)/etc/apk/repositories.d/distfeeds.list
|
||||||
|
|
||||||
|
rm -f $(1)/etc/uci-defaults/13_fix-group-user
|
||||||
|
rm -f $(1)/sbin/pkg_check
|
||||||
|
echo $(PKG_RELEASE)~$(lastword $(subst -, ,$(REVISION))) >$(TMP_DIR)/base-files.version
|
||||||
|
else
|
||||||
$(if $(CONFIG_CLEAN_IPKG),, \
|
$(if $(CONFIG_CLEAN_IPKG),, \
|
||||||
mkdir -p $(1)/etc/opkg; \
|
mkdir -p $(1)/etc/opkg; \
|
||||||
$(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
|
$(call FeedSourcesAppendOPKG,$(1)/etc/opkg/distfeeds.conf); \
|
||||||
$(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf)
|
$(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf)
|
||||||
$(if $(CONFIG_IPK_FILES_CHECKSUMS),, \
|
$(if $(CONFIG_IPK_FILES_CHECKSUMS),, \
|
||||||
rm -f $(1)/sbin/pkg_check)
|
rm -f $(1)/sbin/pkg_check)
|
||||||
|
endif
|
||||||
|
|
||||||
$(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \
|
$(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \
|
||||||
rm -f $(1)/etc/banner.failsafe,)
|
rm -f $(1)/etc/banner.failsafe,)
|
||||||
|
|
||||||
if [ -f $(TOPDIR)/feeds/luci/package.json ]; then \
|
if [ -f $(TOPDIR)/feeds/luci/package.json ]; then \
|
||||||
$(CP) ./luci2/* $(1)/; \
|
$(CP) ./luci2/* $(1)/; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -36,6 +36,7 @@ sed -i 's/services/nas/g' /usr/lib/lua/luci/view/minidlna_status.htm
|
|||||||
sed -i 's/\"services\"/\"nas\"/g' /usr/share/luci/menu.d/luci-app-samba4.json
|
sed -i 's/\"services\"/\"nas\"/g' /usr/share/luci/menu.d/luci-app-samba4.json
|
||||||
|
|
||||||
sed -i 's#downloads.openwrt.org#mirrors.tencent.com/lede#g' /etc/opkg/distfeeds.conf
|
sed -i 's#downloads.openwrt.org#mirrors.tencent.com/lede#g' /etc/opkg/distfeeds.conf
|
||||||
|
sed -i 's#downloads.openwrt.org#mirrors.tencent.com/lede#g' /etc/apk/repositories.d/distfeeds.list
|
||||||
sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
|
sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
|
||||||
sed -i 's/root:::0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
|
sed -i 's/root:::0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean
|
|||||||
|
|
||||||
ifeq ($(CONFIG_IB_STANDALONE),)
|
ifeq ($(CONFIG_IB_STANDALONE),)
|
||||||
echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf
|
echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf
|
||||||
$(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf)
|
$(call FeedSourcesAppendOPKG,$(PKG_BUILD_DIR)/repositories.conf)
|
||||||
$(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
|
$(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user