Skip to content

Commit

Permalink
Merge pull request #73 from mayank-sirotiya-imgtec/master
Browse files Browse the repository at this point in the history
Updating master
  • Loading branch information
Abhijit A. Mahajani committed May 27, 2016
2 parents c5ee3de + cda52dc commit d43d472
Show file tree
Hide file tree
Showing 2,754 changed files with 284,880 additions and 303,291 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
TOPDIR:=${CURDIR}
LC_ALL:=C
LANG:=C
export TOPDIR LC_ALL LANG
TZ:=UTC
export TOPDIR LC_ALL LANG TZ

empty:=
space:= $(empty) $(empty)
Expand Down
5 changes: 2 additions & 3 deletions config/Config-build.in
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ menu "Global build settings"
choice
prompt "Binary stripping method"
default USE_STRIP if EXTERNAL_TOOLCHAIN
default USE_STRIP if USE_GLIBC || USE_MUSL
default USE_STRIP if USE_GLIBC
default USE_SSTRIP
help
Select the binary stripping method you wish to use.
Expand All @@ -152,7 +152,7 @@ menu "Global build settings"
bool "none"
help
This will install unstripped binaries (useful for native
compiling/debugging).
compiling/debugging).

config USE_STRIP
bool "strip"
Expand All @@ -162,7 +162,6 @@ menu "Global build settings"

config USE_SSTRIP
bool "sstrip"
depends on !DEBUG
depends on !USE_GLIBC
help
This will install binaries stripped using sstrip.
Expand Down
1 change: 1 addition & 0 deletions config/Config-devel.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ menuconfig DEVEL

config EXTRA_OPTIMIZATION
string "Additional compiler options" if DEVEL
default "-fno-caller-saves -fno-plt" if !CONFIG_EXTERNAL_TOOLCHAIN && !arc
default "-fno-caller-saves"
help
Extra target-independent optimizations to use when building for the target.
50 changes: 50 additions & 0 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@
# See /LICENSE for more information.
#

config KERNEL_BUILD_USER
string "Custom Kernel Build User Name"
default ""
help
Sets the Kernel build user string, which for example will be returned
by 'uname -a' on running systems.
If not set, uses system user at build time.

config KERNEL_BUILD_DOMAIN
string "Custom Kernel Build Domain Name"
default ""
help
Sets the Kernel build domain string, which for example will be
returned by 'uname -a' on running systems.
If not set, uses system hostname at build time.

config KERNEL_PRINTK
bool "Enable support for printk"
default y
Expand Down Expand Up @@ -574,3 +590,37 @@ if KERNEL_IPV6
def_bool n

endif

#
# NFS related symbols
#
config KERNEL_IP_PNP
bool "Compile the kernel with rootfs on NFS"
help
If you want to make your kernel boot off a NFS server as root
filesystem, select Y here.

if KERNEL_IP_PNP

config KERNEL_IP_PNP_DHCP
def_bool y

config KERNEL_IP_PNP_BOOTP
def_bool n

config KERNEL_IP_PNP_RARP
def_bool n

config KERNEL_NFS_FS
def_bool y

config KERNEL_NFS_V2
def_bool y

config KERNEL_NFS_V3
def_bool y

config KERNEL_ROOT_NFS
def_bool y

endif
7 changes: 0 additions & 7 deletions feeds.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,4 @@ src-git telephony https://github.com/openwrt/telephony.git
src-git management https://github.com/openwrt-management/packages.git
src-git targets https://github.com/openwrt/targets.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-svn xwrt http://x-wrt.googlecode.com/svn/trunk/package
#src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone
#src-svn efl svn://svn.openwrt.org/openwrt/feeds/efl
#src-svn xorg svn://svn.openwrt.org/openwrt/feeds/xorg
#src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop
#src-svn xfce svn://svn.openwrt.org/openwrt/feeds/xfce
#src-svn lxde svn://svn.openwrt.org/openwrt/feeds/lxde
#src-link custom /usr/src/openwrt/custom-feed
4 changes: 2 additions & 2 deletions include/autotools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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/.* //p') && \
GETTEXT_VERSION=$(shell $(STAGING_DIR)/host/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.* //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)/host/bin/autopoint --force \
);
endef

Expand Down
10 changes: 6 additions & 4 deletions include/cmake.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmake_bool = $(patsubst %,-D%:BOOL=$(if $($(1)),ON,OFF),$(2))

PKG_INSTALL:=1

ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
Expand Down Expand Up @@ -28,8 +30,8 @@ CMAKE_AR:=$(call cmake_tool,$(TARGET_AR))
CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))

CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR);$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR_HOST)
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_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions

define Build/Configure/Default
Expand Down Expand Up @@ -94,8 +96,8 @@ define Host/Configure/Default
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_STRIP=: \
-DCMAKE_INSTALL_PREFIX=$(STAGING_DIR_HOST) \
-DCMAKE_PREFIX_PATH=$(STAGING_DIR_HOST) \
-DCMAKE_INSTALL_PREFIX=$(HOST_BUILD_PREFIX) \
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
-DCMAKE_SKIP_RPATH=TRUE \
$(CMAKE_HOST_OPTIONS) \
$(CMAKE_SOURCE_DIR) \
Expand Down
11 changes: 6 additions & 5 deletions include/download.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
define dl_method
$(strip \
$(if $(2),$(2), \
$(if $(filter @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
$(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, \
Expand Down Expand Up @@ -48,7 +48,7 @@ define DownloadMethod/default
endef

define wrap_mirror
$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "" "$(MIRROR_MD5SUM)" || ( $(1) ),$(1))
$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" "" || ( $(1) ),$(1))
endef

define DownloadMethod/cvs
Expand Down Expand Up @@ -90,8 +90,9 @@ define DownloadMethod/git
cd $(TMP_DIR)/dl && \
rm -rf $(SUBDIR) && \
[ \! -d $(SUBDIR) ] && \
git clone $(URL) $(SUBDIR) --recursive && \
(cd $(SUBDIR) && git checkout $(VERSION) && git submodule update) && \
git clone $(URL) $(SUBDIR) && \
(cd $(SUBDIR) && git checkout $(VERSION) && \
git submodule update --init --recursive) && \
echo "Packing checkout..." && \
rm -rf $(SUBDIR)/.git && \
$(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
Expand Down Expand Up @@ -182,6 +183,6 @@ define Download

$(DL_DIR)/$(FILE):
mkdir -p $(DL_DIR)
$(if $(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/unknown))
$(call locked,$(if $(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/unknown)),$(FILE))

endef
6 changes: 3 additions & 3 deletions include/feeds.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# See /LICENSE for more information.
#

-include $(TMP_DIR)/.packagefeeds
-include $(TMP_DIR)/.packagesubdirs

FEEDS_AVAILABLE:=$(shell $(SCRIPT_DIR)/feeds list -n)
FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
Expand All @@ -21,15 +21,15 @@ PKG_CONFIG_DEPENDS += \
# 1: package name
define FeedPackageDir
$(strip $(if $(CONFIG_PER_FEED_REPO), \
$(abspath $(PACKAGE_DIR)/$(if $(Package/$(1)/feed),$(Package/$(1)/feed),base)), \
$(abspath $(PACKAGE_DIR)/$(if $(Package/$(1)/subdir),$(Package/$(1)/subdir),base)), \
$(PACKAGE_DIR)))
endef

# 1: destination file
define FeedSourcesAppend
( \
$(strip $(if $(CONFIG_PER_FEED_REPO), \
$(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/$(feed)";) \
$(foreach feed,base kernel $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/$(feed)";) \
$(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
$(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/$(feed)";)) \
, \
Expand Down
22 changes: 12 additions & 10 deletions include/host-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ BUILD_TYPES += host
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),)))
HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
HOST_STAMP_INSTALLED:=$(STAGING_DIR_HOST)/stamp/.$(PKG_NAME)_installed
HOST_BUILD_PREFIX:=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR)/host,$(STAGING_DIR_HOST))
HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.$(PKG_NAME)_installed

override MAKEFLAGS=

Expand Down Expand Up @@ -68,11 +69,11 @@ HOST_CONFIGURE_ARGS = \
--build=$(GNU_HOST_NAME) \
--program-prefix="" \
--program-suffix="" \
--prefix=$(STAGING_DIR_HOST) \
--exec-prefix=$(STAGING_DIR_HOST) \
--sysconfdir=$(STAGING_DIR_HOST)/etc \
--localstatedir=$(STAGING_DIR_HOST)/var \
--sbindir=$(STAGING_DIR_HOST)/bin
--prefix=$(HOST_BUILD_PREFIX) \
--exec-prefix=$(HOST_BUILD_PREFIX) \
--sysconfdir=$(HOST_BUILD_PREFIX)/etc \
--localstatedir=$(HOST_BUILD_PREFIX)/var \
--sbindir=$(HOST_BUILD_PREFIX)/bin

HOST_MAKE_FLAGS =

Expand Down Expand Up @@ -132,11 +133,12 @@ define Download/default
endef

define Host/Exports/Default
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-*),-I $$(p))
$(1) : export STAGING_PREFIX=$$(STAGING_DIR_HOST)
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(1) : export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(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 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 $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
endef
Host/Exports=$(Host/Exports/Default)

Expand Down
32 changes: 20 additions & 12 deletions include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ $(eval $(foreach S,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/template,$(S))))
$(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))))

define Image/mkfs/squashfs
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(TARGET_DIR) $(KDIR)/root.squashfs -nopad -noappend -root-owned -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) -processors $(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1)
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(TARGET_DIR) $(KDIR)/root.squashfs -nopad -noappend -root-owned -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) -processors $(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1) $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
endef

# $(1): board name
Expand All @@ -186,7 +186,9 @@ ifneq ($(CONFIG_NAND_SUPPORT),)
[ -z "$(2)" ] || $(CP) "$(KDIR)/root.$(2)" "$(KDIR_TMP)/sysupgrade-$(1)/root"
[ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(1)/kernel"
(cd "$(KDIR_TMP)"; $(TAR) cvf \
"$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(1))
"$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(1) \
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
)
endef

# $(1) board name
Expand Down Expand Up @@ -248,7 +250,9 @@ define Image/mkfs/cpiogz
endef

define Image/mkfs/targz
$(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 --sort=name -C $(TARGET_DIR)/ .
$(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
-C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
endef

E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
Expand All @@ -259,6 +263,7 @@ define Image/mkfs/ext4
-i $(CONFIG_TARGET_EXT4_MAXINODE) \
-m $(CONFIG_TARGET_EXT4_RESERVED_PCT) \
$(if $(CONFIG_TARGET_EXT4_JOURNAL),,-J) \
$(if $(SOURCE_DATE_EPOCH),-T $(SOURCE_DATE_EPOCH)) \
$(KDIR)/root.ext4 $(TARGET_DIR)/
endef

Expand Down Expand Up @@ -331,7 +336,11 @@ define Build/fit
endef

define Build/lzma
$(STAGING_DIR_HOST)/bin/lzma e $@ -lc1 -lp2 -pb2 $(1) $@.new
$(call Build/lzma-no-dict,-lc1 -lp2 -pb2 $(1))
endef

define Build/lzma-no-dict
$(STAGING_DIR_HOST)/bin/lzma e $@ $(1) $@.new
@mv $@.new $@
endef

Expand All @@ -357,7 +366,7 @@ endef

define Build/kernel-bin
rm -f $@
cp $^ $@
cp $< $@
endef

define Build/patch-cmdline
Expand All @@ -374,6 +383,7 @@ endef

define Build/append-ubi
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
$(if $(KERNEL_IN_UBI),--kernel $(word 1,$^)) \
$(word 2,$^) \
$@.tmp \
Expand Down Expand Up @@ -444,6 +454,7 @@ define Device/Init
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
KERNEL_INSTALL :=
KERNEL_NAME := vmlinux
KERNEL_DEPENDS :=
KERNEL_SIZE :=

FILESYSTEMS := $(TARGET_FILESYSTEMS)
Expand All @@ -468,11 +479,11 @@ define Device/Build/initramfs
$(call Device/Export,$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE),$(1))
$$(_TARGET): $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE)

$(KDIR)/$$(KERNEL_INITRAMFS_NAME): image_prepare
$(KDIR)/$$(KERNEL_INITRAMFS_NAME):: image_prepare
$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
cp $$^ $$@

$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME)
$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
@rm -f $$@
$$(call concat_cmd,$$(KERNEL_INITRAMFS))
endef
Expand All @@ -495,7 +506,7 @@ endef

define Device/Build/kernel
_KERNEL_IMAGES += $(KDIR)/$$(KERNEL_NAME)
$(KDIR)/$$(KERNEL_NAME): image_prepare
$(KDIR)/$$(KERNEL_NAME):: image_prepare
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
$(call Device/Export,$(KDIR)/$$(KERNEL_IMAGE),$(1))
$(BIN_DIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_IMAGE)
Expand All @@ -504,7 +515,7 @@ define Device/Build/kernel
ifdef CONFIG_IB
install: $(KDIR)/$$(KERNEL_IMAGE)
endif
$(KDIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME)
$(KDIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
@rm -f $$@
$$(call concat_cmd,$$(KERNEL))
$$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
Expand Down Expand Up @@ -581,9 +592,6 @@ define BuildImage
$(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
$(foreach fs,$(TARGET_FILESYSTEMS) $(fs-subtypes-y),$(call BuildImage/mkfs,$(fs)))

$$(sort $$(_KERNEL_IMAGES)):
@touch $$@

install: kernel_prepare
$(foreach fs,$(TARGET_FILESYSTEMS),
$(call Image/Build,$(fs))
Expand Down
Loading

0 comments on commit d43d472

Please sign in to comment.