[OpenWrt-Devel] [PATCH] [Build] Allows external kernel tree to be a relative path

Cuero Bugot cuero.bugot at gmail.com
Sun Jul 17 08:08:34 EDT 2016


Should I include more description for this change? This is quite
interesting when using an external tree for the kernel sources and yet want
to share the project in the team (thus absolute path is not an option). I
do not mind keeping this patch on my private fork, only I thought it could
be interesting to other people too.



On Mon, Jul 11, 2016 at 4:44 PM, Cuero Bugot <cuero.bugot at gmail.com> wrote:

> From: Cuero Bugot <cuero.bugot at gmail.com>
>
> CONFIG_EXTERNAL_KERNEL_TREE .config settings allows building the kernel
> from an external tree directory. It currently only accept absolute path.
> This patch is about allowing relative path. This is particularly
> convenient if you have your openwrt and kernel sources hosted remotely,
> have several persons working on the same sources, but possibly on different
> location on their machine!
> The code bellow check if the path is relative or absolute, and if relative
> prepend it with openwrt TOPDIR path.
>
> ---
>
> diff --git a/config/Config-devel.in b/config/Config-devel.in
> index 938f0b3..5ab32d6 100644
> --- a/config/Config-devel.in
> +++ b/config/Config-devel.in
> @@ -64,6 +64,9 @@ menuconfig DEVEL
>   config EXTERNAL_KERNEL_TREE
>   string "Use external kernel tree" if DEVEL
>   default ""
> + help
> +  Path to the external kernel source tree. If the provided path is not
> absolute, it is
> +  relative to the openwrt top directory.
>
>   config KERNEL_GIT_CLONE_URI
>   string "Enter git repository to clone" if DEVEL
> diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
> index 406fd46..fdfcb23 100644
> --- a/include/kernel-defaults.mk
> +++ b/include/kernel-defaults.mk
> @@ -63,7 +63,13 @@ else
>   if [ -d $(LINUX_DIR) ]; then \
>   rmdir $(LINUX_DIR); \
>   fi
> - ln -s $(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_DIR)
> + # Check if the provided external path is absolute or relative
> + # if the path is relative, build the proper path from the openwrt top
> dir.
> + if [ "${CONFIG_EXTERNAL_KERNEL_TREE:0:1}" = "/" ]; then \
> + ln -s $(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_DIR); \
> + else \
> + ln -s $(TOPDIR)/$(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_DIR); \
> + fi
>    endef
>  endif
>
>
> Signed-off-by: Cuero Bugot <cuero.bugot at gmail.com>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20160717/211b9cdd/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list