mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-14 11:13:29 +00:00
include: sync with upstream (#10454)
Signed-off-by: Linhui Liu <liulinhui36@gmail.com> Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
This commit is contained in:
parent
c5b0c71a92
commit
75d227e14f
@ -35,7 +35,7 @@ define autoreconf
|
||||
$(patsubst %,rm -f %;,$(2)) \
|
||||
$(foreach p,$(3), \
|
||||
if [ -f $(p)/configure.ac ] || [ -f $(p)/configure.in ]; then \
|
||||
[ -d $(p)/autom4te.cache ] && rm -rf autom4te.cache; \
|
||||
[ -d $(p)/autom4te.cache ] && rm -rf $(p)/autom4te.cache; \
|
||||
[ -e $(p)/config.rpath ] || \
|
||||
ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath; \
|
||||
touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
|
||||
@ -113,7 +113,7 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),)
|
||||
endif
|
||||
|
||||
ifneq ($(filter libtool,$(PKG_FIXUP)),)
|
||||
PKG_BUILD_DEPENDS += libtool gettext libiconv
|
||||
PKG_BUILD_DEPENDS += libtool
|
||||
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
||||
Hooks/Configure/Pre += autoreconf_target
|
||||
endif
|
||||
@ -124,7 +124,7 @@ ifneq ($(filter libtool-abiver,$(PKG_FIXUP)),)
|
||||
endif
|
||||
|
||||
ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
|
||||
PKG_BUILD_DEPENDS += libtool gettext libiconv
|
||||
PKG_BUILD_DEPENDS += libtool
|
||||
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
||||
Hooks/Configure/Pre += autoreconf_target
|
||||
endif
|
||||
|
@ -63,6 +63,7 @@ BPF_CFLAGS := \
|
||||
-Wno-unused-label \
|
||||
-O2 -emit-llvm -Xclang -disable-llvm-passes
|
||||
|
||||
ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
|
||||
ifeq ($(DUMP),)
|
||||
CLANG_VER:=$(shell $(CLANG) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
|
||||
CLANG_VER_VALID:=$(shell [ "$(CLANG_VER)" -ge "$(CLANG_MIN_VER)" ] && echo 1 )
|
||||
@ -70,6 +71,7 @@ ifeq ($(DUMP),)
|
||||
$(error ERROR: LLVM/clang version too old. Minimum required: $(CLANG_MIN_VER), found: $(CLANG_VER))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
define CompileBPF
|
||||
$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
|
||||
|
@ -52,7 +52,7 @@ CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
|
||||
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
|
||||
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
|
||||
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
|
||||
CMAKE_HOST_INSTALL_PREFIX ?= $(HOST_BUILD_PREFIX)
|
||||
CMAKE_HOST_INSTALL_PREFIX = $(HOST_BUILD_PREFIX)
|
||||
|
||||
ifeq ($(HOST_USE_NINJA),1)
|
||||
CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Ninja"
|
||||
|
@ -12,6 +12,7 @@
|
||||
DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*"
|
||||
|
||||
find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | $(MKHASH) md5
|
||||
find_md5_reproducible=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -print0 | xargs -0 $(MKHASH) md5 | sort | $(MKHASH) md5
|
||||
|
||||
define rdep
|
||||
.PRECIOUS: $(2)
|
||||
@ -27,7 +28,7 @@ ifneq ($(wildcard $(2)),)
|
||||
{ [ \! -f "$(3)" ] || diff $(3) $(3).1 >/dev/null; } && \
|
||||
) \
|
||||
{ \
|
||||
[ -f "$(2)_check.1" ] && mv "$(2)_check.1"; \
|
||||
[ -f "$(2)_check.1" ] && mv "$(2)_check.1" "$(2)_check"; \
|
||||
$(TOPDIR)/scripts/timestamp.pl $(DEP_FINDPARAMS) $(4) -n $(2) $(1) && { \
|
||||
$(call debug_eval,$(SUBDIR),r,echo "No need to rebuild $(2)";) \
|
||||
touch -r "$(2)" "$(2)_check"; \
|
||||
|
@ -63,6 +63,21 @@ define dl_tar_pack
|
||||
$$$${TAR_TIMESTAMP:+--mtime="$$$$TAR_TIMESTAMP"} -c $(2) | $(call dl_pack,$(1))
|
||||
endef
|
||||
|
||||
gen_sha256sum = $(shell $(MKHASH) sha256 $(DL_DIR)/$(1))
|
||||
|
||||
# Used in Build/CoreTargets and HostBuild/Core as an integrity check for
|
||||
# downloaded files. It will add a FORCE rule if the sha256 hash does not
|
||||
# match, so that the download can be more thoroughly handled by download.pl.
|
||||
define check_download_integrity
|
||||
expected_hash:=$(strip $(if $(filter-out x,$(HASH)),$(HASH),$(MIRROR_HASH)))
|
||||
$$(if $$(and $(FILE),$$(wildcard $(DL_DIR)/$(FILE)), \
|
||||
$$(filter undefined,$$(flavor DownloadChecked/$(FILE)))), \
|
||||
$$(eval DownloadChecked/$(FILE):=1) \
|
||||
$$(if $$(filter-out $$(call gen_sha256sum,$(FILE)),$$(expected_hash)), \
|
||||
$(DL_DIR)/$(FILE): FORCE) \
|
||||
)
|
||||
endef
|
||||
|
||||
ifdef CHECK
|
||||
check_escape=$(subst ','\'',$(1))
|
||||
#')
|
||||
@ -78,8 +93,6 @@ else
|
||||
check_warn = $(if $(filter-out undefined,$(origin F_$(1))),$(filter ,$(shell $(call F_$(1),$(2),$(3),$(4)) >&2)),$(check_warn_nofix))
|
||||
endif
|
||||
|
||||
gen_sha256sum = $(shell $(MKHASH) sha256 $(DL_DIR)/$(1))
|
||||
|
||||
ifdef FIXUP
|
||||
F_hash_deprecated = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile fix-hash $(3) $(call gen_sha256sum,$(1)) $(2)
|
||||
F_hash_mismatch = $(F_hash_deprecated)
|
||||
|
@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/depends.mk
|
||||
include $(INCLUDE_DIR)/quilt.mk
|
||||
|
||||
BUILD_TYPES += host
|
||||
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
|
||||
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
|
||||
HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
|
||||
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
|
||||
HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST))
|
||||
@ -51,6 +51,7 @@ HOST_CONFIGURE_VARS = \
|
||||
CFLAGS="$(HOST_CFLAGS)" \
|
||||
CXX="$(HOSTCXX)" \
|
||||
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
||||
CXXFLAGS="$(HOST_CXXFLAGS)" \
|
||||
LDFLAGS="$(HOST_LDFLAGS)" \
|
||||
CONFIG_SHELL="$(SHELL)"
|
||||
|
||||
@ -180,7 +181,7 @@ ifndef DUMP
|
||||
clean-build: host-clean-build
|
||||
endif
|
||||
|
||||
$(DL_DIR)/$(FILE): FORCE
|
||||
$(call check_download_integrity)
|
||||
|
||||
$(_host_target)host-prepare: $(HOST_STAMP_PREPARED)
|
||||
$(_host_target)host-configure: $(HOST_STAMP_CONFIGURED)
|
||||
@ -197,13 +198,13 @@ ifndef DUMP
|
||||
|
||||
ifneq ($(CONFIG_AUTOREMOVE),)
|
||||
host-compile:
|
||||
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \
|
||||
$(XARGS) rm -rf
|
||||
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -print0 | \
|
||||
$(XARGS) -0 rm -rf
|
||||
endif
|
||||
endef
|
||||
endif
|
||||
|
||||
define HostBuild
|
||||
$(HostBuild/Core)
|
||||
$(if $(if $(PKG_HOST_ONLY),,$(STAMP_PREPARED)),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
$(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
endef
|
||||
|
@ -218,6 +218,11 @@ define Build/copy-file
|
||||
cat "$(1)" > "$@"
|
||||
endef
|
||||
|
||||
define Build/edimax-header
|
||||
$(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new $(1)
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/elecom-product-header
|
||||
$(eval product=$(word 1,$(1)))
|
||||
$(eval fw=$(if $(word 2,$(1)),$(word 2,$(1)),$@))
|
||||
@ -291,6 +296,7 @@ define Build/fit
|
||||
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
|
||||
$(if $(DEVICE_DTS_DELIMITER),-l $(DEVICE_DTS_DELIMITER)) \
|
||||
$(if $(DEVICE_DTS_LOADADDR),-s $(DEVICE_DTS_LOADADDR)) \
|
||||
$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtb)) \
|
||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||
|
@ -388,6 +388,7 @@ define Device/Init
|
||||
DEVICE_DTS_CONFIG :=
|
||||
DEVICE_DTS_DELIMITER :=
|
||||
DEVICE_DTS_DIR :=
|
||||
DEVICE_DTS_LOADADDR :=
|
||||
DEVICE_DTS_OVERLAY :=
|
||||
DEVICE_FDT_NUM :=
|
||||
SOC :=
|
||||
@ -413,6 +414,7 @@ DEFAULT_DEVICE_VARS := \
|
||||
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \
|
||||
VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \
|
||||
DEVICE_DTS_CONFIG DEVICE_DTS_DELIMITER DEVICE_DTS_DIR DEVICE_DTS_OVERLAY \
|
||||
DEVICE_DTS_LOADADDR \
|
||||
DEVICE_FDT_NUM DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \
|
||||
SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
|
||||
UBOOT_PATH IMAGE_SIZE \
|
||||
|
@ -10,7 +10,7 @@ ifneq ($(DUMP),1)
|
||||
endif
|
||||
|
||||
KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
|
||||
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,$(KERNEL_FILE_DEPENDS),)))
|
||||
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),$(KERNEL_FILE_DEPENDS),)))
|
||||
STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
|
||||
include $(INCLUDE_DIR)/download.mk
|
||||
include $(INCLUDE_DIR)/quilt.mk
|
||||
|
@ -117,7 +117,7 @@ define Kernel/Configure/Default
|
||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config; \
|
||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
|
||||
}
|
||||
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
||||
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) $(if $(findstring uml,$(BOARD)),ARCH=$(ARCH)) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
||||
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
|
||||
endef
|
||||
|
||||
@ -129,6 +129,10 @@ define Kernel/CompileModules/Default
|
||||
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
|
||||
+$(KERNEL_MAKE) olddefconfig
|
||||
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
# If .config did not change, use the previous timestamp to avoid package rebuilds
|
||||
cmp -s $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save && \
|
||||
mv $(LINUX_DIR)/.config.modules.save $(LINUX_DIR)/.config; \
|
||||
$(CP) $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save
|
||||
endef
|
||||
|
||||
OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
|
||||
@ -165,19 +169,20 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
||||
define Kernel/CompileImage/Initramfs
|
||||
$(call Kernel/Configure/Initramfs)
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR) $(TARGET_DIR)/init)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
|
||||
ifeq ($(CONFIG_EXTERNAL_CPIO),y)
|
||||
ifneq ($(qstrip $(CONFIG_EXTERNAL_CPIO)),)
|
||||
$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio
|
||||
else
|
||||
( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
|
||||
( cd $(TARGET_DIR); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
|
||||
endif
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -n -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma)
|
||||
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -T$(if $(filter 1,$(NPROC)),2,0) -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
endif
|
||||
|
@ -70,11 +70,7 @@ else
|
||||
LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null))
|
||||
endif
|
||||
|
||||
ifeq (,$(findstring -android,$(LINUX_VERSION)))
|
||||
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
|
||||
else
|
||||
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)-android
|
||||
endif
|
||||
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
|
||||
TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
|
||||
|
||||
ifneq ($(TARGET_BUILD),1)
|
||||
@ -105,7 +101,7 @@ endif
|
||||
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
|
||||
|
||||
KERNEL_MAKE_FLAGS = \
|
||||
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR)))" \
|
||||
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR))) $(filter-out -fno-plt,$(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION))) $(call qstrip,$(CONFIG_KERNEL_CFLAGS))" \
|
||||
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
|
||||
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
@ -129,17 +125,17 @@ ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL
|
||||
KERNELRELEASE=$(LINUX_VERSION)
|
||||
endif
|
||||
|
||||
ifneq ($(HOST_OS),Linux)
|
||||
KERNEL_MAKE_FLAGS += CONFIG_STACK_VALIDATION=
|
||||
export SKIP_STACK_VALIDATION:=1
|
||||
endif
|
||||
|
||||
KERNEL_MAKEOPTS := -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
|
||||
|
||||
ifdef CONFIG_USE_SPARSE
|
||||
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
|
||||
endif
|
||||
|
||||
ifneq ($(HOST_OS),Linux)
|
||||
KERNEL_MAKEOPTS += CONFIG_STACK_VALIDATION=
|
||||
export SKIP_STACK_VALIDATION:=1
|
||||
endif
|
||||
|
||||
PKG_EXTMOD_SUBDIRS ?= .
|
||||
|
||||
PKG_SYMVERS_DIR = $(KERNEL_BUILD_DIR)/symvers
|
||||
|
@ -10,27 +10,37 @@ ifeq ($(CONFIG_BUILD_NLS),y)
|
||||
INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-full
|
||||
INTL_FULL:=1
|
||||
|
||||
# iconv stub
|
||||
else
|
||||
ICONV_PREFIX:=$(STAGING_DIR)/usr/lib/libiconv-stub
|
||||
ICONV_PREFIX:=
|
||||
ICONV_FULL:=
|
||||
|
||||
INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-stub
|
||||
INTL_PREFIX:=
|
||||
INTL_FULL:=
|
||||
endif
|
||||
|
||||
PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
|
||||
PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext
|
||||
|
||||
ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
|
||||
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
|
||||
ifeq ($(CONFIG_BUILD_NLS),y)
|
||||
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
|
||||
else
|
||||
ICONV_CFLAGS:=
|
||||
ICONV_CPPFLAGS:=
|
||||
ICONV_LDFLAGS:=
|
||||
endif
|
||||
|
||||
INTL_DEPENDS:=+BUILD_NLS:libintl-full
|
||||
INTL_CFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
|
||||
ifeq ($(CONFIG_BUILD_NLS),y)
|
||||
INTL_CFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
|
||||
else
|
||||
INTL_CFLAGS:=
|
||||
INTL_CPPFLAGS:=
|
||||
INTL_LDFLAGS:=
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
|
||||
TARGET_CPPFLAGS += $(ICONV_CPPFLAGS) $(INTL_CPPFLAGS)
|
||||
|
@ -4,7 +4,8 @@
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
define BuildTarget/bin
|
||||
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
|
||||
TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(filter-out *,$(VARIANT)),$(firstword $(ALL_VARIANTS))))
|
||||
ifeq ($(if $(TARGET_VARIANT),$(BUILD_VARIANT)),$(TARGET_VARIANT))
|
||||
ifdef Package/$(1)/install
|
||||
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
||||
$(_pkg_target)compile: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
||||
|
@ -105,7 +105,8 @@ ifeq ($(DUMP),)
|
||||
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
|
||||
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
|
||||
|
||||
ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT)))
|
||||
TARGET_VARIANT:=$$(if $(ALL_VARIANTS),$$(if $$(VARIANT),$$(filter-out *,$$(VARIANT)),$(firstword $(ALL_VARIANTS))))
|
||||
ifeq ($(BUILD_VARIANT),$$(if $$(TARGET_VARIANT),$$(TARGET_VARIANT),$(BUILD_VARIANT)))
|
||||
do_install=
|
||||
ifdef Package/$(1)/install
|
||||
do_install=yes
|
||||
|
@ -13,6 +13,7 @@ PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
|
||||
PKG_BUILD_PARALLEL ?=
|
||||
PKG_USE_MIPS16 ?= 1
|
||||
PKG_IREMAP ?= 1
|
||||
PKG_SKIP_DOWNLOAD=$(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT)
|
||||
|
||||
MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) $(if $(filter 3.% 4.0 4.1,$(MAKE_VERSION)),-j))
|
||||
|
||||
@ -84,7 +85,7 @@ ifneq ($(PREV_STAMP_PREPARED),)
|
||||
STAMP_PREPARED:=$(PREV_STAMP_PREPARED)
|
||||
CONFIG_AUTOREBUILD:=
|
||||
else
|
||||
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
|
||||
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
|
||||
endif
|
||||
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
|
||||
STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
|
||||
@ -183,7 +184,7 @@ define Build/CoreTargets
|
||||
$(call Build/Autoclean)
|
||||
$(call DefaultTargets)
|
||||
|
||||
$(DL_DIR)/$(FILE): FORCE
|
||||
$(call check_download_integrity)
|
||||
|
||||
download:
|
||||
$(foreach hook,$(Hooks/Download),
|
||||
@ -258,13 +259,13 @@ define Build/CoreTargets
|
||||
ifneq ($(CONFIG_AUTOREMOVE),)
|
||||
compile:
|
||||
-touch -r $(PKG_BUILD_DIR)/.built $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null
|
||||
$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
|
||||
$(XARGS) rm -rf
|
||||
$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' -print0 | \
|
||||
$(XARGS) -0 rm -rf
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/DefaultTargets
|
||||
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
$(if $(PKG_SKIP_DOWNLOAD),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
$(if $(DUMP),,$(Build/CoreTargets))
|
||||
|
||||
define Build/DefaultTargets
|
||||
|
@ -53,6 +53,13 @@ $(eval $(call TestHostCommand,ncurses, \
|
||||
Please install ncurses. (Missing libncurses.so or ncurses.h), \
|
||||
echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
|
||||
gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
|
||||
|
||||
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
|
||||
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule, \
|
||||
git submodule --help | grep -- --recursive))
|
||||
|
||||
$(eval $(call SetupHostCommand,rsync,Please install 'rsync', \
|
||||
rsync --version </dev/null))
|
||||
endif # IB
|
||||
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
@ -130,7 +137,12 @@ $(eval $(call SetupHostCommand,getopt, \
|
||||
Please install an extended getopt version that supports --long, \
|
||||
gnugetopt -o t --long test -- --test | grep '^ *--test *--', \
|
||||
getopt -o t --long test -- --test | grep '^ *--test *--', \
|
||||
/usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- --test | grep '^ *--test *--'))
|
||||
/usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- --test | grep '^ *--test *--', \
|
||||
/opt/local/bin/getopt -o t --long test -- --test | grep '^ *--test *--'))
|
||||
|
||||
$(eval $(call SetupHostCommand,realpath,Please install a 'realpath' utility, \
|
||||
grealpath /, \
|
||||
realpath /))
|
||||
|
||||
$(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
|
||||
gnustat -c%s $(TOPDIR)/Makefile, \
|
||||
@ -176,19 +188,19 @@ $(eval $(call SetupHostCommand,python3,Please install Python >= 3.6, \
|
||||
|
||||
$(eval $(call TestHostCommand,python3-distutils, \
|
||||
Please install the Python3 distutils module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import distutils'))
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'from distutils import util'))
|
||||
|
||||
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
|
||||
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))
|
||||
$(eval $(call TestHostCommand,python3-stdlib, \
|
||||
Please install the Python3 stdlib module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import ntpath'))
|
||||
|
||||
$(eval $(call SetupHostCommand,file,Please install the 'file' package, \
|
||||
file --version 2>&1 | grep file))
|
||||
|
||||
$(eval $(call SetupHostCommand,rsync,Please install 'rsync', \
|
||||
rsync --version </dev/null))
|
||||
|
||||
$(eval $(call SetupHostCommand,which,Please install 'which', \
|
||||
which which | grep which))
|
||||
/usr/bin/which which, \
|
||||
/bin/which which, \
|
||||
which which))
|
||||
|
||||
$(STAGING_DIR_HOST)/bin/mkhash: $(SCRIPT_DIR)/mkhash.c
|
||||
mkdir -p $(dir $@)
|
||||
@ -201,4 +213,4 @@ prereq: $(STAGING_DIR_HOST)/bin/mkhash $(STAGING_DIR_HOST)/bin/xxd
|
||||
|
||||
# Install ldconfig stub
|
||||
$(eval $(call TestHostCommand,ldconfig-stub,Failed to install stub, \
|
||||
$(LN) /bin/true $(STAGING_DIR_HOST)/bin/ldconfig))
|
||||
$(LN) $(firstword $(wildcard /bin/true /usr/bin/true)) $(STAGING_DIR_HOST)/bin/ldconfig))
|
||||
|
@ -49,7 +49,7 @@ endef
|
||||
|
||||
define RequireCommand
|
||||
define Require/$(1)
|
||||
which $(1)
|
||||
command -v $(1)
|
||||
endef
|
||||
|
||||
$$(eval $$(call Require,$(1),$(2)))
|
||||
@ -103,7 +103,7 @@ define SetupHostCommand
|
||||
$(call QuoteHostCommand,$(11)) $(call QuoteHostCommand,$(12)); do \
|
||||
if [ -n "$$$$$$$$cmd" ]; then \
|
||||
bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
|
||||
which "$$$$$$$${cmd%% *}")"; \
|
||||
command -v "$$$$$$$${cmd%% *}")"; \
|
||||
if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \
|
||||
mkdir -p "$(STAGING_DIR_HOST)/bin"; \
|
||||
ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
|
||||
|
@ -116,7 +116,7 @@ define Quilt/RefreshDir
|
||||
endef
|
||||
|
||||
define Quilt/Refresh/Host
|
||||
$(call Quilt/RefreshDir,$(HOST_BUILD_DIR),$(PATCH_DIR))
|
||||
$(call Quilt/RefreshDir,$(HOST_BUILD_DIR),$(HOST_PATCH_DIR))
|
||||
endef
|
||||
|
||||
define Quilt/Refresh/Package
|
||||
|
@ -72,7 +72,7 @@ endif
|
||||
|
||||
$(FILELIST): $(OVERRIDELIST)
|
||||
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
|
||||
find -L $(SCAN_DIR) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
|
||||
find -L $(SCAN_DIR) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) $(SCAN_EXTRA) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
|
||||
|
||||
$(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
|
||||
( \
|
||||
|
@ -27,14 +27,16 @@ lastdir=$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1)))
|
||||
diralias=$(if $(findstring $(1),$(call lastdir,$(1))),,$(call lastdir,$(1)))
|
||||
|
||||
subdir_make_opts = \
|
||||
-r -C $(1) \
|
||||
$(if $(SUBDIR_MAKE_DEBUG),-d) -r -C $(1) \
|
||||
BUILD_SUBDIR="$(1)" \
|
||||
BUILD_VARIANT="$(4)"
|
||||
BUILD_VARIANT="$(4)" \
|
||||
ALL_VARIANTS="$(5)"
|
||||
|
||||
# 1: subdir
|
||||
# 2: target
|
||||
# 3: build type
|
||||
# 4: build variant
|
||||
# 5: all variants
|
||||
log_make = \
|
||||
$(if $(call debug,$(1),v),,@)+ \
|
||||
$(if $(BUILD_LOG), \
|
||||
@ -62,15 +64,15 @@ define subdir
|
||||
$(foreach target,$(SUBTARGETS) $($(1)/subtargets),
|
||||
$(foreach btype,$(buildtypes-$(bd)),
|
||||
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(btype)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(btype)/$(target)) $(call $(1)//$(btype)/$(target),$(1)/$(bd)/$(btype))))
|
||||
$(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant))) \
|
||||
$(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \
|
||||
|| $(call ERROR,$(2), ERROR: $(1)/$(bd) [$(btype)] failed to build.,$(findstring $(bd),$($(1)/builddirs-ignore-$(btype)-$(target))))
|
||||
$(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(btype)/$(target): $(1)/$(bd)/$(btype)/$(target)))
|
||||
)
|
||||
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd))))
|
||||
$(foreach variant,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default))),
|
||||
$(foreach variant,$(filter-out *,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default)))),
|
||||
$(if $(BUILD_LOG),@mkdir -p $(BUILD_LOG_DIR)/$(1)/$(bd)/$(filter-out __default,$(variant)))
|
||||
$(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))))
|
||||
$(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))) \
|
||||
$(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)))
|
||||
$(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \
|
||||
|| $(call ERROR,$(1), ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).,$(findstring $(bd),$($(1)/builddirs-ignore-$(target))))
|
||||
)
|
||||
$(if $(PREREQ_ONLY)$(DUMP_TARGET_DB),,
|
||||
|
@ -12,6 +12,7 @@ DEVICE_TYPE?=router
|
||||
# Default packages - the really basic set
|
||||
DEFAULT_PACKAGES:=\
|
||||
base-files \
|
||||
ca-bundle \
|
||||
dropbear \
|
||||
fstools \
|
||||
libc \
|
||||
@ -23,7 +24,8 @@ DEFAULT_PACKAGES:=\
|
||||
opkg \
|
||||
uci \
|
||||
uclient-fetch \
|
||||
urandom-seed
|
||||
urandom-seed \
|
||||
urngd
|
||||
|
||||
ifneq ($(CONFIG_SELINUX),)
|
||||
DEFAULT_PACKAGES+=busybox-selinux procd-selinux
|
||||
@ -31,6 +33,16 @@ else
|
||||
DEFAULT_PACKAGES+=busybox procd
|
||||
endif
|
||||
|
||||
# include ujail on systems with enough storage
|
||||
ifeq ($(CONFIG_SMALL_FLASH),)
|
||||
DEFAULT_PACKAGES+=procd-ujail
|
||||
endif
|
||||
|
||||
# include seccomp ld-preload hooks if kernel supports it
|
||||
ifneq ($(CONFIG_SECCOMP),)
|
||||
DEFAULT_PACKAGES+=procd-seccomp
|
||||
endif
|
||||
|
||||
# For the basic set
|
||||
DEFAULT_PACKAGES.basic:=
|
||||
# For nas targets
|
||||
@ -54,7 +66,7 @@ endif
|
||||
|
||||
target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
|
||||
ifeq ($(DUMP),)
|
||||
PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
|
||||
PLATFORM_DIR:=$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(BOARD) $(TOPDIR)/target/linux/$(BOARD)))
|
||||
SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir))))
|
||||
else
|
||||
PLATFORM_DIR:=${CURDIR}
|
||||
@ -159,22 +171,30 @@ USE_SUBTARGET_CONFIG = $(if $(wildcard $(LINUX_TARGET_CONFIG)),,$(if $(LINUX_SUB
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(if $(USE_SUBTARGET_CONFIG),$(LINUX_SUBTARGET_CONFIG)))
|
||||
LINUX_RECONFIG_TARGET = $(if $(USE_SUBTARGET_CONFIG),$(LINUX_SUBTARGET_CONFIG),$(LINUX_TARGET_CONFIG))
|
||||
|
||||
CFG_TARGET = $(CONFIG_TARGET)
|
||||
ifeq ($(CFG_TARGET),platform)
|
||||
CFG_TARGET = target
|
||||
$(warning Deprecation warning: use CONFIG_TARGET=target instead.)
|
||||
else ifeq ($(CFG_TARGET),subtarget_platform)
|
||||
CFG_TARGET = subtarget_target
|
||||
$(warning Deprecation warning: use CONFIG_TARGET=subtarget_target instead.)
|
||||
endif
|
||||
|
||||
# select the config file to be changed by kernel_menuconfig/kernel_oldconfig
|
||||
ifeq ($(CONFIG_TARGET),platform)
|
||||
ifeq ($(CFG_TARGET),target)
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG))
|
||||
LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG)
|
||||
endif
|
||||
ifeq ($(CONFIG_TARGET),subtarget)
|
||||
else ifeq ($(CFG_TARGET),subtarget)
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(LINUX_SUBTARGET_CONFIG))
|
||||
LINUX_RECONFIG_TARGET = $(LINUX_SUBTARGET_CONFIG)
|
||||
endif
|
||||
ifeq ($(CONFIG_TARGET),subtarget_platform)
|
||||
else ifeq ($(CFG_TARGET),subtarget_target)
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_SUBTARGET_CONFIG) $(LINUX_TARGET_CONFIG))
|
||||
LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG)
|
||||
endif
|
||||
ifeq ($(CONFIG_TARGET),env)
|
||||
else ifeq ($(CFG_TARGET),env)
|
||||
LINUX_RECONFIG_LIST = $(LINUX_KCONFIG_LIST)
|
||||
LINUX_RECONFIG_TARGET = $(TOPDIR)/env/kernel-config
|
||||
else ifneq ($(strip $(CFG_TARGET)),)
|
||||
$(error CONFIG_TARGET=$(CFG_TARGET) is invalid. Valid: target|subtarget|subtarget_target|env)
|
||||
endif
|
||||
|
||||
__linux_confcmd = $(2) $(patsubst %,+,$(wordlist 2,9999,$(1))) $(1)
|
||||
@ -219,6 +239,7 @@ ifeq ($(DUMP),1)
|
||||
endif
|
||||
ifeq ($(ARCH),powerpc64)
|
||||
CPU_TYPE ?= powerpc64
|
||||
CPU_CFLAGS_e5500:=-mcpu=e5500
|
||||
CPU_CFLAGS_powerpc64:=-mcpu=powerpc64
|
||||
endif
|
||||
ifeq ($(ARCH),sparc)
|
||||
|
@ -18,6 +18,6 @@ define FixupLibdir
|
||||
mkdir -p $(1)/lib; \
|
||||
mv $(1)/lib64/* $(1)/lib/; \
|
||||
rm -rf $(1)/lib64; \
|
||||
ln -sf lib $(1)/lib64; \
|
||||
fi
|
||||
ln -sf lib $(1)/lib64
|
||||
endef
|
||||
|
@ -60,6 +60,7 @@ endif
|
||||
|
||||
SCAN_COOKIE?=$(shell echo $$$$)
|
||||
export SCAN_COOKIE
|
||||
export STAGING_DIR_HOST=$(TOPDIR)/staging_dir/host
|
||||
|
||||
SUBMAKE:=umask 022; $(SUBMAKE)
|
||||
|
||||
@ -77,7 +78,7 @@ prepare-tmpinfo: FORCE
|
||||
@+$(MAKE) -r -s staging_dir/host/.prereq-build $(PREP_MK)
|
||||
mkdir -p tmp/info
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||
for type in package target; do \
|
||||
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
|
||||
[ "$$t" -nt "$$f" ] || ./scripts/$${type}-metadata.pl $(_ignore) config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
|
||||
@ -101,7 +102,7 @@ ifneq ($(DISTRO_PKG_CONFIG),)
|
||||
scripts/config/%onf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
endif
|
||||
scripts/config/%onf: CFLAGS+= -O2
|
||||
scripts/config/%onf:
|
||||
scripts/config/%onf: FORCE
|
||||
@$(_SINGLE)$(SUBMAKE) $(if $(findstring s,$(OPENWRT_VERBOSE)),,-s) \
|
||||
-C scripts/config $(notdir $@)
|
||||
|
||||
|
@ -68,6 +68,9 @@ define Build/Trusted-Firmware-A/Target
|
||||
endef
|
||||
endef
|
||||
|
||||
define Build/Configure/Trusted-Firmware-A
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
|
||||
endef
|
||||
|
||||
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
|
||||
|
||||
|
@ -45,6 +45,11 @@ UBOOT_MAKE_FLAGS = \
|
||||
HOSTCC="$(HOSTCC)" \
|
||||
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
|
||||
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
|
||||
LOCALVERSION="-OpenWrt-$(REVISION)" \
|
||||
STAGING_PREFIX="$(STAGING_DIR_HOST)" \
|
||||
PKG_CONFIG_PATH="$(STAGING_DIR_HOST)/lib/pkgconfig" \
|
||||
PKG_CONFIG_LIBDIR="$(STAGING_DIR_HOST)/lib/pkgconfig" \
|
||||
PKG_CONFIG_EXTRAARGS="--static" \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
|
||||
|
||||
define Build/U-Boot/Target
|
||||
|
@ -29,15 +29,15 @@ ifeq ($(IS_TTY),1)
|
||||
endif
|
||||
endif
|
||||
|
||||
define ERROR_MESSAGE
|
||||
printf "$(_R)%s$(_N)\n" "$(1)" >&8
|
||||
endef
|
||||
|
||||
ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
|
||||
define MESSAGE
|
||||
printf "$(_Y)%s$(_N)\n" "$(1)" >&8
|
||||
endef
|
||||
|
||||
define ERROR_MESSAGE
|
||||
printf "$(_R)%s$(_N)\n" "$(1)" >&8
|
||||
endef
|
||||
|
||||
ifeq ($(QUIET),1)
|
||||
ifneq ($(CURDIR),$(TOPDIR))
|
||||
_DIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
|
||||
@ -60,5 +60,4 @@ else
|
||||
define MESSAGE
|
||||
printf "%s\n" "$(1)"
|
||||
endef
|
||||
ERROR_MESSAGE=$(MESSAGE)
|
||||
endif
|
||||
|
@ -224,7 +224,7 @@ def main(argv):
|
||||
try:
|
||||
(opts, args) = getopt.getopt(
|
||||
argv[1:],
|
||||
"hdBwDb:",
|
||||
"hdBw:D:b:",
|
||||
[
|
||||
"help",
|
||||
"dry-run",
|
||||
@ -268,12 +268,15 @@ def main(argv):
|
||||
if o in ("-b", "--build-dir"):
|
||||
builddir = v
|
||||
|
||||
if args:
|
||||
directory = args[0]
|
||||
|
||||
if not os.path.exists(directory):
|
||||
print("Can't find dl path", directory)
|
||||
print("Can't find download directory", directory)
|
||||
return 1
|
||||
|
||||
if not os.path.exists(builddir):
|
||||
print("Can't find dl path", builddir)
|
||||
print("Can't find build directory", builddir)
|
||||
return 1
|
||||
|
||||
# Create a directory listing and parse the file names.
|
||||
|
@ -14,7 +14,7 @@
|
||||
# <VERSION> The version number of upgrade. Not checked so use arbitrary value (8 bytes)
|
||||
# <TYPE> Model of target device, padded (0x20) to (15 bytes)
|
||||
# <CRC> CRC checksum of the image to flash (8 byte)
|
||||
# <padding> Padding (0x20) (7 bytes)
|
||||
# <padding> Padding ('0' + 0x20 *7) (8 bytes)
|
||||
# <signature> Signature of signer. Not checked so use arbitrary value (16 bytes)
|
||||
# <padding> Padding (0x00) (192 bytes)
|
||||
# 0x0A (1 byte)
|
||||
@ -58,7 +58,7 @@ IMG_OUT="${IMG_IN}.new"
|
||||
dd if="${IMG_IN}" of="${IMG_TMP_OUT}"
|
||||
CRC=$(printf "%08X" $(dd if="${IMG_IN}" bs=$(stat -c%s "${IMG_IN}") count=1|cksum| cut -d ' ' -f1))
|
||||
|
||||
printf ".LINKSYS.01000409%-15s%-8s%-7s%-16s" "${TYPE}" "${CRC}" "" "K0000000F0246434" >> "${IMG_TMP_OUT}"
|
||||
printf ".LINKSYS.01000409%-15s%-8s%-8s%-16s" "${TYPE}" "${CRC}" "0" "K0000000F0246434" >> "${IMG_TMP_OUT}"
|
||||
|
||||
dd if=/dev/zero bs=1 count=192 conv=notrunc >> "${IMG_TMP_OUT}"
|
||||
|
||||
|
@ -35,6 +35,7 @@ usage() {
|
||||
printf "\n\t-l ==> legacy mode character (@ etc otherwise -)"
|
||||
printf "\n\t-o ==> create output file 'its_file'"
|
||||
printf "\n\t-O ==> create config with dt overlay 'name:dtb'"
|
||||
printf "\n\t-s ==> set FDT load address to 'addr' (hex)"
|
||||
printf "\n\t\t(can be specified more than once)\n"
|
||||
exit 1
|
||||
}
|
||||
@ -48,7 +49,7 @@ LOADABLES=
|
||||
DTOVERLAY=
|
||||
DTADDR=
|
||||
|
||||
while getopts ":A:a:c:C:D:d:e:f:i:k:l:n:o:O:v:r:H:" OPTION
|
||||
while getopts ":A:a:c:C:D:d:e:f:i:k:l:n:o:O:v:r:s:H:" OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
A ) ARCH=$OPTARG;;
|
||||
@ -66,6 +67,7 @@ do
|
||||
o ) OUTPUT=$OPTARG;;
|
||||
O ) DTOVERLAY="$DTOVERLAY ${OPTARG}";;
|
||||
r ) ROOTFS=$OPTARG;;
|
||||
s ) FDTADDR=$OPTARG;;
|
||||
H ) HASH=$OPTARG;;
|
||||
v ) VERSION=$OPTARG;;
|
||||
* ) echo "Invalid option passed to '$0' (options:$*)"
|
||||
@ -87,10 +89,14 @@ if [ -n "${COMPATIBLE}" ]; then
|
||||
fi
|
||||
|
||||
[ "$DTOVERLAY" ] && {
|
||||
dtbsize=$(wc -c "$DTB" | cut -d' ' -f1)
|
||||
dtbsize=$(wc -c "$DTB" | awk '{print $1}')
|
||||
DTADDR=$(printf "0x%08x" $(($LOAD_ADDR - $dtbsize)) )
|
||||
}
|
||||
|
||||
[ "$FDTADDR" ] && {
|
||||
DTADDR="$FDTADDR"
|
||||
}
|
||||
|
||||
# Conditionally create fdt information
|
||||
if [ -n "${DTB}" ]; then
|
||||
FDT_NODE="
|
||||
@ -162,7 +168,7 @@ OVCONFIGS=""
|
||||
overlay_blob=${overlay##*:}
|
||||
ovname=${overlay%%:*}
|
||||
ovnode="fdt-$ovname"
|
||||
ovsize=$(wc -c "$overlay_blob" | cut -d' ' -f1)
|
||||
ovsize=$(wc -c "$overlay_blob" | awk '{print $1}')
|
||||
echo "$ovname ($overlay_blob) : $ovsize" >&2
|
||||
DTADDR=$(printf "0x%08x" $(($DTADDR - $ovsize)))
|
||||
FDTOVERLAY_NODE="$FDTOVERLAY_NODE
|
||||
|
Loading…
Reference in New Issue
Block a user