Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
chunkeey committed Feb 10, 2017
2 parents 549d88e + cf009e9 commit aca9ef4
Show file tree
Hide file tree
Showing 2,211 changed files with 173,506 additions and 272,485 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/feeds
/feeds.conf
/files
/overlay
/package/feeds
/package/openwrt-packages
key-build*
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ else
include tools/Makefile
include toolchain/Makefile

$(toolchain/stamp-install): $(tools/stamp-install)
$(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
$(toolchain/stamp-compile): $(tools/stamp-compile)
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
$(package/stamp-install): $(package/stamp-compile)
$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
Expand All @@ -55,7 +55,7 @@ clean: FORCE
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages

dirclean: clean
rm -rf $(STAGING_DIR_HOST) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
rm -rf $(TMP_DIR)

ifndef DUMP_TARGET_DB
Expand Down Expand Up @@ -91,7 +91,7 @@ diffconfig: FORCE
mkdir -p $(BIN_DIR)
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed

prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
$(_SINGLE)$(SUBMAKE) -r package/index
$(_SINGLE)$(SUBMAKE) -r diffconfig
Expand Down
10 changes: 9 additions & 1 deletion config/Config-devel.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ menuconfig DEVEL
help
Automatically rebuild packages when their files change.

config AUTOREMOVE
bool "Automatic removal of build directories" if DEVEL
default n
help
Automatically delete build directories after make target completed.
This allows you to symlink build_dir into a scratch location, e.g. a ramdisk,
which does not have enough space to keep a complete build_dir.

config BUILD_SUFFIX
string "Build suffix to append to the target BUILD_DIR variable" if DEVEL
default ""
Expand All @@ -59,7 +67,7 @@ menuconfig DEVEL
bool "Use ccache" if DEVEL
default n
help
Compiler cache; see http://ccache.samba.org/.
Compiler cache; see https://ccache.samba.org/

config EXTERNAL_KERNEL_TREE
string "Use external kernel tree" if DEVEL
Expand Down
2 changes: 1 addition & 1 deletion config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ config KERNEL_PRINTK

config KERNEL_CRASHLOG
bool "Crash logging"
depends on !(arm || powerpc || sparc || TARGET_uml)
depends on !(arm || powerpc || sparc || TARGET_uml || i386 || x86_64)
default y

config KERNEL_SWAP
Expand Down
1 change: 1 addition & 0 deletions feeds.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ src-git packages https://git.lede-project.org/feed/packages.git
src-git luci https://git.lede-project.org/project/luci.git
src-git routing https://git.lede-project.org/feed/routing.git
src-git telephony https://git.lede-project.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git
#src-git targets https://github.com/openwrt/targets.git
#src-git management https://github.com/openwrt-management/packages.git
#src-git oldpackages http://git.openwrt.org/packages.git
Expand Down
6 changes: 3 additions & 3 deletions include/autotools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ define autoreconf_target
$(strip $(call autoreconf, \
$(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
$(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
$(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
$(STAGING_DIR)/host/share/aclocal $(STAGING_DIR_HOSTPKG)/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
endef

define patch_libtool_target
Expand All @@ -85,11 +85,11 @@ endef

define gettext_version_target
(cd $(PKG_BUILD_DIR) && \
GETTEXT_VERSION=$(shell $(STAGING_DIR)/host/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \
GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \
$(STAGING_DIR_HOST)/bin/sed \
-i $(PKG_BUILD_DIR)/configure.ac \
-e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \
$(STAGING_DIR)/host/bin/autopoint --force \
$(STAGING_DIR_HOSTPKG)/bin/autopoint --force \
);
endef

Expand Down
2 changes: 1 addition & 1 deletion include/cmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
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_HOST)
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions

define Build/Configure/Default
Expand Down
8 changes: 7 additions & 1 deletion include/depends.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# 3: tempfile for file listings
# 4: find options

DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp"
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)) | mkhash md5

Expand All @@ -20,6 +20,7 @@ define rdep
.SILENT: $(2)_check

$(2): $(2)_check
check-depends: $(2)_check

ifneq ($(wildcard $(2)),)
$(2)_check::
Expand All @@ -46,3 +47,8 @@ endif

endef

ifeq ($(filter .%,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),$(MAKECMDGOALS),x))
define rdep
$(2): $(2)_check
endef
endif
3 changes: 0 additions & 3 deletions include/download.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,10 @@ endif

C_md5_deprecated = Use of $(2) is deprecated, switch to $(3)

# Skip MD5SUM check in feeds until OpenWrt is updated
ifneq ($(filter $(foreach dir,package tools toolchain, $(TOPDIR)/$(dir)/%),$(CURDIR)),)
check_md5 = \
$(if $(filter-out x,$(1)), \
$(call check_warn,md5_deprecated,$(1),$(2),$(3)) \
)
endif

hash_var = $(if $(filter-out x,$(1)),MD5SUM,HASH)
endif
Expand Down
2 changes: 1 addition & 1 deletion include/feeds.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n))
FEEDS_ENABLED:=$(foreach feed,$(FEEDS_INSTALLED),$(if $(CONFIG_FEED_$(feed)),$(feed)))
FEEDS_ENABLED:=$(foreach feed,$(FEEDS_AVAILABLE),$(if $(CONFIG_FEED_$(feed)),$(feed)))
FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE))

PACKAGE_SUBDIRS=$(PACKAGE_DIR)
Expand Down
57 changes: 34 additions & 23 deletions include/host-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk

BUILD_TYPES += host
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),)))
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_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))
Expand All @@ -35,6 +35,8 @@ override MAKEFLAGS=
include $(INCLUDE_DIR)/quilt.mk
include $(INCLUDE_DIR)/autotools.mk

_host_target:=$(if $(HOST_QUILT),,.)

Host/Patch:=$(Host/Patch/Default)
ifneq ($(strip $(HOST_UNPACK)),)
define Host/Prepare/Default
Expand Down Expand Up @@ -67,6 +69,12 @@ HOST_CONFIGURE_ARGS = \
--localstatedir=$(HOST_BUILD_PREFIX)/var \
--sbindir=$(HOST_BUILD_PREFIX)/bin

HOST_MAKE_VARS = \
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS)" \
CXXFLAGS="$(HOST_CXXFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)"

HOST_MAKE_FLAGS =

HOST_CONFIGURE_CMD = $(BASH) ./configure
Expand All @@ -89,7 +97,8 @@ define Host/Configure
endef

define Host/Compile/Default
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+$(HOST_MAKE_VARS) \
$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
$(HOST_MAKE_FLAGS) \
$(1)
endef
Expand All @@ -99,7 +108,7 @@ define Host/Compile
endef

define Host/Install/Default
$(_SINGLE)$(MAKE) -C $(HOST_BUILD_DIR) install
$(call Host/Compile/Default,install)
endef

define Host/Install
Expand All @@ -115,7 +124,7 @@ ifneq ($(if $(HOST_QUILT),,$(CONFIG_AUTOREBUILD)),)
endif

define Host/Exports/Default
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
$(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
Expand Down Expand Up @@ -161,32 +170,34 @@ ifndef DUMP
touch $(HOST_STAMP_BUILT)
touch $$@

$(call DefaultTargets,$(patsubst %,host-%,$(DEFAULT_SUBDIR_TARGETS)))
ifndef STAMP_BUILT
prepare: host-prepare
compile: host-compile
install: host-install
clean: host-clean
update: host-update
refresh: host-refresh
$(foreach t,$(DEFAULT_SUBDIR_TARGETS),
$(t): host-$(t)
.$(t): .host-$(t)
)
clean-build: host-clean-build
endif

host-prepare: $(HOST_STAMP_PREPARED)
host-configure: $(HOST_STAMP_CONFIGURED)
host-compile: $(HOST_STAMP_BUILT) $(if $(STAMP_BUILT),$(HOST_STAMP_INSTALLED))
host-install: $(HOST_STAMP_INSTALLED)
host-clean: FORCE
$(_host_target)host-prepare: $(HOST_STAMP_PREPARED)
$(_host_target)host-configure: $(HOST_STAMP_CONFIGURED)
$(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED)
host-install: host-compile

host-clean-build: FORCE
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_BUILT)

host-clean: host-clean-build
$(call Host/Clean)
$(call Host/Uninstall)
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
rm -rf $(HOST_STAMP_INSTALLED)

ifneq ($(CONFIG_AUTOREMOVE),)
host-compile:
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \
$(XARGS) rm -rf
endif
endef

download:
prepare:
compile:
install:
clean:

endif

define HostBuild
Expand Down
47 changes: 46 additions & 1 deletion include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,39 @@ define Build/uImage
@mv $@.new $@
endef

define Build/buffalo-enc
$(eval product=$(word 1,$(1)))
$(eval version=$(word 2,$(1)))
$(eval args=$(wordlist 3,$(words $(1)),$(1)))
$(STAGING_DIR_HOST)/bin/buffalo-enc \
-p $(product) -v $(version) $(args) \
-i $@ -o $@.new
mv $@.new $@
endef

define Build/buffalo-enc-tag
$(call Build/buffalo-enc,'' '' -S 152 $(1))
endef

define Build/buffalo-tag-dhp
$(eval product=$(word 1,$(1)))
$(eval region=$(word 2,$(1)))
$(eval language=$(word 3,$(1)))
$(STAGING_DIR_HOST)/bin/buffalo-tag \
-d 0x01000000 -w 1 \
-a $(BUFFALO_TAG_PLATFORM) \
-v $(BUFFALO_TAG_VERSION) -m $(BUFFALO_TAG_MINOR) \
-b $(product) -p $(product) \
-r $(region) -r $(region) -l $(language) \
-I $@ -o $@.new
mv $@.new $@
endef

define Build/buffalo-dhp-image
$(STAGING_DIR_HOST)/bin/mkdhpimg $@ $@.new
mv $@.new $@
endef

define Build/netgear-chk
$(STAGING_DIR_HOST)/bin/mkchkimg \
-o $@.new \
Expand All @@ -29,6 +62,18 @@ define Build/netgear-dni
mv $@.new $@
endef

# append a fake/empty rootfs uImage header, to fool the bootloaders
# rootfs integrity check
define Build/append-uImage-fakeroot-hdr
rm -f $@.fakeroot
$(STAGING_DIR_HOST)/bin/mkimage \
-A $(LINUX_KARCH) -O linux -T filesystem -C none \
-n '$(call toupper,$(LINUX_KARCH)) LEDE fakeroot' \
-s \
$@.fakeroot
cat $@.fakeroot >> $@
endef

define Build/tplink-safeloader
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
-B $(TPLINK_BOARD_NAME) \
Expand Down Expand Up @@ -59,7 +104,7 @@ define Build/fit
-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)) \
-A $(ARCH) -v $(LINUX_VERSION)
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
endef
Expand Down
16 changes: 14 additions & 2 deletions include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,17 @@ 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) \
-A $(ARCH) -v $(LINUX_VERSION)
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
endef

ifdef CONFIG_TARGET_IMAGES_GZIP
define Image/Gzip
rm -f $(1).gz
gzip -9n $(1)
endef
endif

# $(1) source dts file
# $(2) target dtb file
# $(3) extra CPP flags
Expand Down Expand Up @@ -445,7 +452,8 @@ define Device/Build/kernel
endef

define Device/Build/image
$$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))
GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
$$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX)
$(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1)))
ROOTFS/$(1)/$(3) := \
$(KDIR)/root.$(1)$$(strip \
Expand All @@ -462,6 +470,10 @@ define Device/Build/image
$$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2))))

.IGNORE: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))

$(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
gzip -c -9n $$^ > $$@

$(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
cp $$^ $$@

Expand Down
2 changes: 1 addition & 1 deletion include/kernel-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ define Download/git-kernel
PROTO:=git
VERSION:=$(CONFIG_KERNEL_GIT_BRANCH)
FILE:=$(LINUX_SOURCE)
SUBDIR:=linux-$(KERNEL_PATCHVER)
SUBDIR:=linux-$(LINUX_VERSION)
OPTS:=$(KERNEL_GIT_OPTS)
endef

Expand Down
Loading

0 comments on commit aca9ef4

Please sign in to comment.