Permalink
Browse files

include sync 2018.05

  • Loading branch information...
zyxmon committed May 12, 2018
1 parent 3a198d9 commit 78447b30e199d9d874988c067677b0c4cb0800bb
@@ -23,8 +23,6 @@ ifneq ($(CONFIG_PER_FEED_REPO),)
endif
endif
PACKAGE_DIR_ALL := $(TOPDIR)/staging_dir/packages/$(BOARD)
opkg_package_files = $(wildcard \
$(foreach dir,$(PACKAGE_SUBDIRS), \
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
@@ -52,6 +52,7 @@ endef
HOST_CONFIGURE_VARS = \
CC="$(HOSTCC)" \
CFLAGS="$(HOST_CFLAGS)" \
CXX="$(HOSTCXX)" \
CPPFLAGS="$(HOST_CPPFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
CONFIG_SHELL="$(SHELL)"
@@ -77,16 +77,17 @@ define Build/append-squashfs-fakeroot-be
cat $@.fakesquashfs >> $@
endef
# append a fake/empty rootfs uImage header, to fool the bootloaders
# rootfs integrity check
define Build/append-uImage-fakeroot-hdr
rm -f $@.fakeroot
# append a fake/empty uImage header, to fool bootloaders rootfs integrity check
# for example
define Build/append-uImage-fakehdr
touch $@.fakehdr
$(STAGING_DIR_HOST)/bin/mkimage \
-A $(LINUX_KARCH) -O linux -T filesystem -C none \
-n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) fakeroot' \
-A $(LINUX_KARCH) -O linux -T $(1) -C none \
-n '$(VERSION_DIST) fake $(1)' \
-d $@.fakehdr \
-s \
$@.fakeroot
cat $@.fakeroot >> $@
$@.fakehdr
cat $@.fakehdr >> $@
endef
define Build/tplink-safeloader
@@ -113,16 +114,12 @@ define Build/install-dtb
)
endef
define Build/install-zImage
$(CP) $(KDIR)/zImage \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage
endef
define Build/fit
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
@@ -138,7 +135,7 @@ define Build/lzma-no-dict
endef
define Build/gzip
gzip -9n -c $@ $(1) > $@.new
gzip --force -9n -c $@ $(1) > $@.new
@mv $@.new $@
endef
@@ -18,10 +18,8 @@ ifndef IB
endif
include $(INCLUDE_DIR)/image-legacy.mk
ifdef TARGET_PER_DEVICE_ROOTFS
include $(INCLUDE_DIR)/rootfs.mk
endif
include $(INCLUDE_DIR)/feeds.mk
include $(INCLUDE_DIR)/rootfs.mk
override MAKE:=$(_SINGLE)$(SUBMAKE)
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
@@ -142,6 +140,7 @@ endef
define Image/BuildKernel/MkFIT
$(TOPDIR)/scripts/mkits.sh \
-D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
endef
@@ -261,10 +260,7 @@ define Image/mkfs/ext4
endef
define Image/Manifest
$(STAGING_DIR_HOST)/bin/opkg \
--offline-root $(TARGET_DIR) \
--add-arch all:100 \
--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 list-installed > \
$(call opkg,$(TARGET_DIR_ORIG)) list-installed > \
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
endef
@@ -305,7 +301,7 @@ target-dir-%: FORCE
$(call opkg_package_files,$(mkfs_packages_add)))
-$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/
rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf
$(call prepare_rootfs,$(mkfs_cur_target_dir))
$(call prepare_rootfs,$(mkfs_cur_target_dir),$(TOPDIR)/files)
$(KDIR)/root.%: kernel_prepare
$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
@@ -352,6 +348,7 @@ define Device/Init
FS_OPTIONS/ubifs = $$(MKUBIFS_OPTS)
DEVICE_DTS :=
DEVICE_DTS_CONFIG :=
DEVICE_DTS_DIR :=
BOARD_NAME :=
@@ -364,8 +361,8 @@ endef
DEFAULT_DEVICE_VARS := \
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
KERNEL_LOADADDR DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE \
UBOOTENV_IN_UBI KERNEL_IN_UBI \
KERNEL_LOADADDR DEVICE_DTS DEVICE_DTS_CONFIG DEVICE_DTS_DIR BOARD_NAME \
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI \
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS \
SUPPORTED_DEVICES IMAGE_METADATA
@@ -225,8 +225,7 @@ $(call KernelPackage/$(1)/config)
$(call KernelPackage/hooks)
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
ifneq ($(strip $(FILES)),)
define Package/kmod-$(1)/install
define Package/kmod-$(1)/install
@for mod in $$(call version_filter,$$(FILES)); do \
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
echo "NOTICE: module '$$$$$$$$mod' is built-in."; \
@@ -240,8 +239,7 @@ $(call KernelPackage/$(1)/config)
done;
$(call ModuleAutoLoad,$(1),$$(1),$(filter-out 0-,$(word 1,$(AUTOLOAD))-),$(filter-out 0,$(word 2,$(AUTOLOAD))),$(wordlist 3,99,$(AUTOLOAD)))
$(call KernelPackage/$(1)/install,$$(1))
endef
endif
endef
$(if $(CONFIG_PACKAGE_kmod-$(1)),
else
compile: $(1)-disabled
@@ -86,16 +86,22 @@ $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_RECENT, $(P_X
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_CONNMARK)))
#conntrack-label
$(eval $(call nf_add,IPT_CONNTRACK_LABEL,CONFIG_NETFILTER_XT_MATCH_CONNLABEL, $(P_XT)xt_connlabel))
# extra
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_ADDRTYPE, $(if $(NF_KMOD),$(P_XT)xt_addrtype,$(P_XT)ipt_addrtype)))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_OWNER, $(P_XT)xt_owner))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_physdev))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_PKTTYPE, $(P_XT)xt_pkttype))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_QUOTA, $(P_XT)xt_quota))
#$(eval $(call nf_add,IPT_EXTRA,CONFIG_IP_NF_TARGET_ROUTE, $(P_V4)ipt_ROUTE))
# physdev
$(eval $(call nf_add,IPT_PHYSDEV,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_physdev))
# filter
@@ -139,6 +145,8 @@ $(eval $(call nf_add,IPT_IPSEC,CONFIG_IP_NF_MATCH_AH, $(P_V4)ipt_ah))
$(eval $(call nf_add,IPT_IPSEC,CONFIG_NETFILTER_XT_MATCH_ESP, $(P_XT)xt_esp))
$(eval $(call nf_add,IPT_IPSEC,CONFIG_NETFILTER_XT_MATCH_POLICY, $(P_XT)xt_policy))
# flow offload support
$(eval $(call nf_add,IPT_FLOW,CONFIG_NETFILTER_XT_TARGET_FLOWOFFLOAD, $(P_XT)xt_FLOWOFFLOAD))
# IPv6
@@ -365,7 +373,9 @@ IPT_BUILTIN += $(NF_CONNTRACK6-y)
IPT_BUILTIN += $(IPT_CONNTRACK-y)
IPT_BUILTIN += $(IPT_CONNTRACK_EXTRA-y)
IPT_BUILTIN += $(IPT_EXTRA-y)
IPT_BUILTIN += $(IPT_PHYSDEV-y)
IPT_BUILTIN += $(IPT_FILTER-y)
IPT_BUILTIN += $(IPT_FLOW-y) $(IPT_FLOW-m)
IPT_BUILTIN += $(IPT_IPOPT-y)
IPT_BUILTIN += $(IPT_IPRANGE-y)
IPT_BUILTIN += $(IPT_CLUSTER-y)
@@ -65,7 +65,7 @@ Build/Patch:=$(Build/Patch/Default)
ifneq ($(strip $(PKG_UNPACK)),)
define Build/Prepare/Default
$(PKG_UNPACK)
[ ! -d ./src/ ] || $(CP) ./src/* $(PKG_BUILD_DIR)
[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
$(Build/Patch)
endef
endif
@@ -120,7 +120,12 @@ ifdef USE_GIT_TREE
define Build/Prepare/Default
mkdir -p $(PKG_BUILD_DIR)
ln -s $(CURDIR)/git-src $(PKG_BUILD_DIR)/.git
( cd $(PKG_BUILD_DIR); git checkout .)
( cd $(PKG_BUILD_DIR); \
git checkout .; \
git submodule update --recursive; \
git submodule foreach git config --unset core.worktree; \
git submodule foreach git checkout .; \
)
endef
endif
ifdef USE_SOURCE_DIR
@@ -28,13 +28,15 @@ $(eval $(call TestHostCommand,proper-umask, \
$(eval $(call SetupHostCommand,gcc, \
Please install the GNU C Compiler (gcc) 4.8 or later \
$(CC) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
gcc -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc48 --version | grep gcc, \
gcc49 --version | grep gcc, \
gcc5 --version | grep gcc, \
gcc6 --version | grep gcc, \
gcc7 --version | grep gcc, \
gcc8 --version | grep gcc, \
gcc9 --version | grep gcc, \
gcc --version | grep Apple.LLVM ))
$(eval $(call TestHostCommand,working-gcc, \
@@ -45,13 +47,15 @@ $(eval $(call TestHostCommand,working-gcc, \
$(eval $(call SetupHostCommand,g++, \
Please install the GNU C++ Compiler (g++) 4.8 or later \
$(CXX) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
g++ -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++48 --version | grep g++, \
g++49 --version | grep g++, \
g++5 --version | grep g++, \
g++6 --version | grep g++, \
g++7 --version | grep g++, \
g++8 --version | grep g++, \
g++9 --version | grep g++, \
g++ --version | grep Apple.LLVM ))
$(eval $(call TestHostCommand,working-g++, \
@@ -72,11 +76,6 @@ else
zlib_link_flags := -lz
endif
$(eval $(call TestHostCommand,zlib, \
Please install a static zlib. (Missing libz.a or zlib.h), \
echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - $(zlib_link_flags)))
$(eval $(call TestHostCommand,perl-thread-queue, \
Please install the Perl Thread::Queue module, \
perl -MThread::Queue -e 1))
@@ -139,6 +138,10 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \
$(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \
wget --version | grep GNU))
$(eval $(call SetupHostCommand,gtime,Please install GNU 'time', \
gtime --version 2>&1 | grep GNU, \
time --version 2>&1 | grep GNU))
$(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
perl --version | grep "perl.*v5"))
@@ -90,7 +90,8 @@ define SetupHostCommand
for cmd in $(call QuoteHostCommand,$(3)) $(call QuoteHostCommand,$(4)) \
$(call QuoteHostCommand,$(5)) $(call QuoteHostCommand,$(6)) \
$(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \
$(call QuoteHostCommand,$(9)); do \
$(call QuoteHostCommand,$(9)) $(call QuoteHostCommand,$(10)) \
$(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%% *}")"; \
@@ -1,5 +1,3 @@
include $(INCLUDE_DIR)/feeds.mk
ifdef CONFIG_USE_MKLIBS
define mklibs
rm -rf $(TMP_DIR)/mklibs-progs $(TMP_DIR)/mklibs-out
@@ -49,16 +47,23 @@ TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD)
ifdef CONFIG_CLEAN_IPKG
define clean_ipkg
-find $(1)/opt/lib/opkg -type f -and -not -name '*.control' | $(XARGS) rm -rf
-find $(1)/opt/lib/opkg/info -type f -and -not -name '*.control' | $(XARGS) rm -rf
-sed -i -ne '/^Require-User: /p' $(1)/opt/lib/opkg/info/*.control
awk ' \
BEGIN { conffiles = 0; print "Conffiles:" } \
/^Conffiles:/ { conffiles = 1; next } \
!/^ / { conffiles = 0; next } \
conffiles == 1 { print } \
' $(1)/opt/lib/opkg/status >$(1)/opt/lib/opkg/status.new
mv $(1)/opt/lib/opkg/status.new $(1)/opt/lib/opkg/status
-find $(1)/opt/lib/opkg -empty | $(XARGS) rm -rf
endef
endif
define prepare_rootfs
@if [ -d $(TOPDIR)/files ]; then \
$(call file_copy,$(TOPDIR)/files/.,$(1)); \
fi
$(if $(2),@if [ -d '$(2)' ]; then \
$(call file_copy,$(2)/.,$(1)); \
fi)
@mkdir -p $(1)/etc/rc.d
@mkdir -p $(1)/var/lock
@( \
@@ -82,9 +87,8 @@ define prepare_rootfs
@-find $(1) -name .git | $(XARGS) rm -rf
@-find $(1) -name '.#*' | $(XARGS) rm -f
rm -rf $(1)/tmp/*
rm -f $(1)/usr/lib/opkg/lists/*
rm -f $(1)/usr/lib/opkg/info/*.postinst*
rm -f $(1)/usr/lib/opkg/info/*.prerm*
rm -f $(1)/opt/lib/opkg/lists/*
rm -f $(1)/opt/lib/opkg/info/*.postinst*
rm -f $(1)/var/lock/*.lock
$(call clean_ipkg,$(1))
$(call mklibs,$(1))
@@ -43,6 +43,7 @@ log_make = \
$(if $(BUILD_LOG), \
set -o pipefail; \
mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
gtime -f "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#%U\#%S\#%e" -- \
$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
@@ -188,6 +188,7 @@ ifeq ($(DUMP),1)
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
CPU_CFLAGS_cortex-a72 = -mcpu=cortex-a72
CPU_CFLAGS_fa526 = -mcpu=fa526
CPU_CFLAGS_mpcore = -mcpu=mpcore
CPU_CFLAGS_xscale = -mcpu=xscale
@@ -269,9 +270,7 @@ ifeq ($(DUMP),1)
FEATURES += virtio
endif
ifneq ($(CONFIG_CPU_MIPS32_R2),)
ifneq ($(CPU_SUBTYPE),nomips16)
FEATURES += mips16
endif
FEATURES += mips16
endif
FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v)))
@@ -285,6 +284,7 @@ ifeq ($(SUBTARGETS),)
CUR_SUBTARGET := default
endif
# Entware specific! Target-Arch-Packages contains the board, not cpu
define BuildTargets/DumpCurrent
.PHONY: dumpinfo
dumpinfo : export DESCRIPTION=$$(Target/Description)
@@ -42,8 +42,8 @@ TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
UBOOT_MAKE_FLAGS = \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \
HOSTLDFLAGS=""
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
HOSTLDFLAGS="$(HOST_LDFLAGS)"
define Build/U-Boot/Target
$(eval $(call U-Boot/Init,$(1)))

0 comments on commit 78447b3

Please sign in to comment.