Skip to content

Commit

Permalink
sync with OpenWrt trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Sep 7, 2018
1 parent 6ee9c24 commit 806f5db
Show file tree
Hide file tree
Showing 1,955 changed files with 115,447 additions and 60,034 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ifneq ($(OPENWRT_BUILD),1)
export OPENWRT_BUILD
GREP_OPTIONS=
export GREP_OPTIONS
CDPATH=
export CDPATH
include $(TOPDIR)/include/debug.mk
include $(TOPDIR)/include/depends.mk
include $(TOPDIR)/include/toplevel.mk
Expand Down Expand Up @@ -85,7 +87,7 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
fi

checksum: FORCE
$(call sha256sums,$(BIN_DIR))
$(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))

diffconfig: FORCE
mkdir -p $(BIN_DIR)
Expand Down
56 changes: 52 additions & 4 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ config KERNEL_CRASHLOG

config KERNEL_SWAP
bool "Support for paging of anonymous memory (swap)"
default y
default y if !SMALL_FLASH

config KERNEL_DEBUG_FS
bool "Compile the kernel with debug filesystem enabled"
Expand Down Expand Up @@ -65,9 +65,30 @@ config KERNEL_PROFILING
Enable the extended profiling support mechanisms used by profilers such
as OProfile.

config KERNEL_TASKSTATS
bool "Compile the kernel with task resource/io statistics and accounting"
default n
help
Enable the collection and publishing of task/io statistics and
accounting. Enable this option to enable i/o monitoring in system
monitors.

if KERNEL_TASKSTATS

config KERNEL_TASK_DELAY_ACCT
def_bool y

config KERNEL_TASK_IO_ACCOUNTING
def_bool y

config KERNEL_TASK_XACCT
def_bool y

endif

config KERNEL_KALLSYMS
bool "Compile the kernel with symbol table information"
default n
default y if !SMALL_FLASH
help
This will give you more information in stack traces from kernel oopses.

Expand Down Expand Up @@ -112,7 +133,7 @@ config KERNEL_DEBUG_KERNEL

config KERNEL_DEBUG_INFO
bool "Compile the kernel with debug information"
default y
default y if !SMALL_FLASH
select KERNEL_DEBUG_KERNEL
help
This will compile your kernel and modules with debug information.
Expand Down Expand Up @@ -205,7 +226,7 @@ config KERNEL_COREDUMP
config KERNEL_ELF_CORE
bool "Enable process core dump support"
select KERNEL_COREDUMP
default y
default y if !SMALL_FLASH

config KERNEL_PROVE_LOCKING
bool "Enable kernel lock checking"
Expand Down Expand Up @@ -785,3 +806,30 @@ config KERNEL_DEVKMEM
Say Y here if you want to support the /dev/kmem device. The
/dev/kmem device is rarely used, but can be used for certain
kind of kernel debugging operations.

config KERNEL_SQUASHFS_FRAGMENT_CACHE_SIZE
int "Number of squashfs fragments cached"
default 2 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
default 3

#
# compile optimiziation setting
#
choice
prompt "Compiler optimization level"
default KERNEL_CC_OPTIMIZE_FOR_SIZE if SMALL_FLASH

config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
bool "Optimize for performance"
help
This is the default optimization level for the kernel, building
with the "-O2" compiler flag for best performance and most
helpful compile-time warnings.

config KERNEL_CC_OPTIMIZE_FOR_SIZE
bool "Optimize for size"
help
Enabling this option will pass "-Os" instead of "-O2" to
your compiler resulting in a smaller kernel.

endchoice
4 changes: 0 additions & 4 deletions feeds.conf.default

This file was deleted.

81 changes: 59 additions & 22 deletions include/download.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@ endif

DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)

define dl_method_git
$(if $(filter https://github.com/% git://github.com/%,$(1)),github_archive,git)
endef

# Try to guess the download method from the URL
define dl_method
$(strip \
$(if $(2),$(2), \
$(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
$(if $(filter git://%,$(1)),git, \
$(if $(filter svn://%,$(1)),svn, \
$(if $(filter cvs://%,$(1)),cvs, \
$(if $(filter hg://%,$(1)),hg, \
$(if $(filter sftp://%,$(1)),bzr, \
unknown \
$(if $(filter git,$(2)),$(call dl_method_git,$(1),$(2)),
$(if $(2),$(2), \
$(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
$(if $(filter git://%,$(1)),$(call dl_method_git,$(1),$(2)), \
$(if $(filter svn://%,$(1)),svn, \
$(if $(filter cvs://%,$(1)),cvs, \
$(if $(filter hg://%,$(1)),hg, \
$(if $(filter sftp://%,$(1)),bzr, \
unknown \
) \
) \
) \
) \
Expand All @@ -56,6 +62,10 @@ ifdef CHECK
check_escape=$(subst ','\'',$(1))
#')

# $(1): suffix of the F_, C_ variables, e.g. hash_deprecated, hash_mismatch, etc.
# $(2): filename
# $(3): expected hash value
# $(4): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
check_warn_nofix = $(info $(shell printf "$(_R)WARNING: %s$(_N)" '$(call check_escape,$(call C_$(1),$(2),$(3),$(4)))'))
ifndef FIXUP
check_warn = $(check_warn_nofix)
Expand All @@ -71,11 +81,17 @@ F_hash_mismatch = $(F_hash_deprecated)
F_hash_missing = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile add-hash $(3) $(call gen_sha256sum,$(1))
endif

# $(1): filename
# $(2): expected hash value
# $(3): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
C_download_missing = $(1) is missing, please run make download before re-running this check
C_hash_mismatch = $(3) does not match $(1) hash $(call gen_sha256sum,$(1))
C_hash_deprecated = $(3) uses deprecated hash, set to $(call gen_sha256sum,$(1))
C_hash_missing = $(3) is missing, set to $(call gen_sha256sum,$(1))

# $(1): filename
# $(2): expected hash value
# $(3): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
check_hash = \
$(if $(wildcard $(DL_DIR)/$(1)), \
$(if $(filter-out x,$(2)), \
Expand Down Expand Up @@ -116,6 +132,9 @@ define DownloadMethod/default
)
endef

# $(1): "check"
# $(2): "PKG_" if <name> as in Download/<name> is "default", otherwise "Download/<name>:"
# $(3): shell command sequence to do the download
define wrap_mirror
$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_HASH))),$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_HASH)" "" || ( $(3) ),$(3)) \
$(if $(filter check,$(1)), \
Expand Down Expand Up @@ -159,23 +178,41 @@ endef

define DownloadMethod/git
$(call wrap_mirror,$(1),$(2), \
echo "Checking out files from the git repository..."; \
mkdir -p $(TMP_DIR)/dl && \
cd $(TMP_DIR)/dl && \
rm -rf $(SUBDIR) && \
[ \! -d $(SUBDIR) ] && \
git clone $(OPTS) $(URL) $(SUBDIR) && \
(cd $(SUBDIR) && git checkout $(VERSION) && \
git submodule update --init --recursive) && \
echo "Packing checkout..." && \
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
rm -rf $(SUBDIR)/.git && \
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
rm -rf $(SUBDIR); \
$(call DownloadMethod/rawgit) \
)
endef

define DownloadMethod/github_archive
$(call wrap_mirror,$(1),$(2), \
$(SCRIPT_DIR)/dl_github_archive.py \
--dl-dir="$(DL_DIR)" \
--url="$(URL)" \
--version="$(VERSION)" \
--subdir="$(SUBDIR)" \
--source="$(FILE)" \
--hash="$(MIRROR_HASH)" \
|| ( $(call DownloadMethod/rawgit) ); \
)
endef

# Only intends to be called as a submethod from other DownloadMethod
define DownloadMethod/rawgit
echo "Checking out files from the git repository..."; \
mkdir -p $(TMP_DIR)/dl && \
cd $(TMP_DIR)/dl && \
rm -rf $(SUBDIR) && \
[ \! -d $(SUBDIR) ] && \
git clone $(OPTS) $(URL) $(SUBDIR) && \
(cd $(SUBDIR) && git checkout $(VERSION) && \
git submodule update --init --recursive) && \
echo "Packing checkout..." && \
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
rm -rf $(SUBDIR)/.git && \
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
rm -rf $(SUBDIR);
endef

define DownloadMethod/bzr
$(call wrap_mirror,$(1),$(2), \
echo "Checking out files from the bzr repository..."; \
Expand Down
4 changes: 2 additions & 2 deletions include/hardening.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ifdef CONFIG_PKG_CHECK_FORMAT_SECURITY
endif
ifdef CONFIG_PKG_ASLR_PIE
ifeq ($(strip $(PKG_ASLR_PIE)),1)
TARGET_CFLAGS += -fPIC
TARGET_LDFLAGS += -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
TARGET_CFLAGS += $(FPIC)
TARGET_LDFLAGS += $(FPIC) -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
endif
endif
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
Expand Down
2 changes: 1 addition & 1 deletion include/host-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ define Host/Exports/Default
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache
$(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache)
$(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
$(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
endef
Expand Down
42 changes: 42 additions & 0 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ define Build/eva-image
mv $@.new $@
endef

define Build/zyxel-ras-image
let \
newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
$(STAGING_DIR_HOST)/bin/mkrasimage \
-b $(RAS_BOARD) \
-v $(RAS_VERSION) \
-r $@ \
-s $$newsize \
-o $@.new \
$(if $(findstring separate-kernel,$(word 1,$(1))),-k $(IMAGE_KERNEL)) \
&& mv $@.new $@
endef

define Build/mkbuffaloimg
$(STAGING_DIR_HOST)/bin/mkbuffaloimg -B $(BOARDNAME) \
-R $$(($(subst k, * 1024,$(ROOTFS_SIZE)))) \
-K $$(($(subst k, * 1024,$(KERNEL_SIZE)))) \
-i $@ -o $@.new
mv $@.new $@
endef

define Build/netgear-chk
$(STAGING_DIR_HOST)/bin/mkchkimg \
-o $@.new \
Expand Down Expand Up @@ -102,6 +123,16 @@ define Build/tplink-safeloader
$(if $(findstring sysupgrade,$(word 1,$(1))),-S) && mv $@.new $@ || rm -f $@
endef

define Build/mksercommfw
-$(STAGING_DIR_HOST)/bin/mksercommfw \
$@ \
$(KERNEL_OFFSET) \
$(HWID) \
$(HWVER) \
$(SWVER)
endef


define Build/append-dtb
cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@
endef
Expand Down Expand Up @@ -243,6 +274,11 @@ define Build/openmesh-image
"$(call param_get_default,rootfs,$(1),$@)" "rootfs"
endef

define Build/senao-header
$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o $@.new
mv $@.new $@
endef

define Build/sysupgrade-tar
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
Expand Down Expand Up @@ -296,6 +332,12 @@ metadata_json = \

define Build/append-metadata
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
[ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" ] || { \
cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
ucert -A -c "$@.ucert" -x "$@.sig" ;\
fwtool -S "$@.ucert" "$@" ;\
}
endef

define Build/kernel2minor
Expand Down
10 changes: 6 additions & 4 deletions include/kernel-version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

LINUX_RELEASE?=1

LINUX_VERSION-4.9 = .123
LINUX_VERSION-4.14 = .66
LINUX_VERSION-3.18 = .119
LINUX_VERSION-4.9 = .124
LINUX_VERSION-4.14 = .67

LINUX_KERNEL_HASH-4.9.123 = 8d12ceab9f8cbfd0555c881b35ed4384cf3ea8e223d894c030b04786005e5071
LINUX_KERNEL_HASH-4.14.66 = a38061ca4c864d11a72beb3dc5918a99f13372fe9ee35508d004fdfabd460413
LINUX_KERNEL_HASH-3.18.119 = 2bab623ed868b679eac224f62212cc285264061bedf1e32897f72e35aa26160d
LINUX_KERNEL_HASH-4.9.124 = 5ca6b0d48c8dd1265005169f1b97149a4e893668c0d8aa566a73c7663c8e4311
LINUX_KERNEL_HASH-4.14.67 = 3f4b056dc27233a78f7a4a35ed6fdcfd0a9680ec40b611a898bb6c8b905070ba

remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
Expand Down
1 change: 1 addition & 0 deletions include/netfilter.mk
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ $(eval $(call nf_add,IPT_PHYSDEV,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_ph
# filter

$(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_STRING, $(P_XT)xt_string))
$(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_BPF, $(P_XT)xt_bpf))


# ipopt
Expand Down
2 changes: 1 addition & 1 deletion include/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ define Build/Exports/Default
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache
$(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache)
endef
Build/Exports=$(Build/Exports/Default)

Expand Down
9 changes: 2 additions & 7 deletions include/prereq-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(eval $(call TestHostCommand,proper-umask, \
umask | grep -xE 00[012][012]))

$(eval $(call SetupHostCommand,gcc, \
Please install the GNU C Compiler (gcc) 4.8 or later \
Please install the GNU C Compiler (gcc) 4.8 or later, \
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc48 --version | grep gcc, \
Expand All @@ -46,7 +46,7 @@ $(eval $(call TestHostCommand,working-gcc, \
gcc -x c -o $(TMP_DIR)/a.out -))

$(eval $(call SetupHostCommand,g++, \
Please install the GNU C++ Compiler (g++) 4.8 or later \
Please install the GNU C++ Compiler (g++) 4.8 or later, \
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++48 --version | grep g++, \
Expand Down Expand Up @@ -138,11 +138,6 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \
$(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \
wget --version | grep GNU))

$(eval $(call SetupHostCommand,time,Please install GNU 'time' or BusyBox 'time' that supports -f, \
gtime --version 2>&1 | grep GNU, \
time --version 2>&1 | grep GNU, \
busybox time 2>&1 | grep -- '-f FMT'))

$(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
perl --version | grep "perl.*v5"))

Expand Down
Loading

0 comments on commit 806f5db

Please sign in to comment.