Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1209659 > unrolled thread
| Started by | Daniel Baluta <daniel.baluta@intel.com> |
|---|---|
| First post | 2015-08-19 08:50 +0200 |
| Last post | 2015-08-20 12:00 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] scripts: Extract kernel headers for out of tree modules build Daniel Baluta <daniel.baluta@intel.com> - 2015-08-19 08:50 +0200
Re: [PATCH] scripts: Extract kernel headers for out of tree modules build Michal Marek <mmarek@suse.com> - 2015-08-19 15:00 +0200
Re: [PATCH] scripts: Extract kernel headers for out of tree modules build Ken Moffat <zarniwhoop@ntlworld.com> - 2015-08-19 21:20 +0200
Re: [PATCH] scripts: Extract kernel headers for out of tree modules build Daniel Baluta <daniel.baluta@intel.com> - 2015-08-20 12:00 +0200
| From | Daniel Baluta <daniel.baluta@intel.com> |
|---|---|
| Date | 2015-08-19 08:50 +0200 |
| Subject | [PATCH] scripts: Extract kernel headers for out of tree modules build |
| Message-ID | <pZ5m9-6uL-5@gated-at.bofh.it> |
scripts/package/builddeb already creates a linux-keader .deb package, but we need this feature also for non-Debian distros (e.g. Android or LFS). Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> --- Makefile | 10 +++++++++- scripts/modules_headers_install.sh | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 scripts/modules_headers_install.sh diff --git a/Makefile b/Makefile index 35b4c19..839416d 100644 --- a/Makefile +++ b/Makefile @@ -1042,6 +1042,7 @@ firmware_install: FORCE #Default location for installed headers export INSTALL_HDR_PATH = $(objtree)/usr +export INSTALL_MODULES_HDR_PATH = $(objtree)/usr/src # If we do an all arch process set dst to asm-$(hdr-arch) hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) @@ -1076,6 +1077,10 @@ headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1 $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1 +PHONY += modules_headers_install +modules_headers_install: + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules_headers_install.sh + # --------------------------------------------------------------------------- # Kernel selftest @@ -1274,7 +1279,10 @@ help: @echo ' kernelversion - Output the version stored in Makefile (use with make -s)' @echo ' image_name - Output the image name (use with make -s)' @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ - echo ' (default: $(INSTALL_HDR_PATH))'; \ + echo ' (default: $(INSTALL_HDR_PATH))'; + @echo ' modules_headers_install - Install kernel headers to INSTALL_MODULES_HDR_PATH'; \ + echo ' to be used for out of tree modules build'; \ + echo ' (default: $(INSTALL_MODULES_HDR_PATH))'; \ echo '' @echo 'Static analysers' @echo ' checkstack - Generate a list of stack hogs' diff --git a/scripts/modules_headers_install.sh b/scripts/modules_headers_install.sh new file mode 100755 index 0000000..ebced17 --- /dev/null +++ b/scripts/modules_headers_install.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# modules_headers_install.sh +# +# Simple script to extract linux headers and friends needed to build +# out of tree modules without having the all source tree around. +# +# Inspired from scripts/package/builddeb + +HDR_SRC_FILES=$objtree/hdrsrcfiles +HDR_OBJ_FILES=$objtree/hdrobjfiles +DEST_DIR=linux-modules-headers + +if [ -n "$INSTALL_MODULES_HDR_PATH" ]; then + DEST_DIR="$INSTALL_MODULES_HDR_PATH" +fi + +#fresh start +rm -f $HDR_SRC_FILES +rm -f $HDR_OBJ_FILES + +#build list of headers and friends +(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) \ + > "$HDR_SRC_FILES" +(cd $srctree; find arch/$SRCARCH/include include scripts -type f) \ + >> "$HDR_SRC_FILES" +(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms \ + -o -name Platform) >> "$HDR_SRC_FILES" +(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts \ + -type d) -type f) >> "$HDR_SRC_FILES" +(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts \ + -type f) >> "$HDR_OBJ_FILES" + +mkdir -p "$DEST_DIR" + +(cd $srctree; tar -c -f - -T -) < "$HDR_SRC_FILES" | (cd $DEST_DIR; tar -xf -) +(cd $objtree; tar -c -f - -T -) < "$HDR_OBJ_FILES" | (cd $DEST_DIR; tar -xf -) + +# copy .config manually to be where it's expected to be +(cd $objtree; cp $KCONFIG_CONFIG $DEST_DIR/.config) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Michal Marek <mmarek@suse.com> |
|---|---|
| Date | 2015-08-19 15:00 +0200 |
| Subject | Re: [PATCH] scripts: Extract kernel headers for out of tree modules build |
| Message-ID | <pZb8e-6mr-5@gated-at.bofh.it> |
| In reply to | #1209659 |
On 2015-08-19 08:50, Daniel Baluta wrote: > scripts/package/builddeb already creates a linux-keader .deb > package, but we need this feature also for non-Debian distros > (e.g. Android or LFS). Kbuild supports building out-of-tree modules by providing the /lib/modules/*/build and /lib/modules/*/source symlinks, pointing to the whole build/source trees. IMO, an optimization like your script should remain part of the distro packaging, which also takes care of the symlinks. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ken Moffat <zarniwhoop@ntlworld.com> |
|---|---|
| Date | 2015-08-19 21:20 +0200 |
| Subject | Re: [PATCH] scripts: Extract kernel headers for out of tree modules build |
| Message-ID | <pZh3Y-6Eg-5@gated-at.bofh.it> |
| In reply to | #1209659 |
On Wed, Aug 19, 2015 at 09:50:36AM +0300, Daniel Baluta wrote:
> scripts/package/builddeb already creates a linux-keader .deb
> package, but we need this feature also for non-Debian distros
> (e.g. Android or LFS).
>
> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
In general, LFS does not need this - but obviously we give you the
freedom to change whatever you do ("your system, your rules").
In particular, we assume that you will build on the machine where
the kernel will run, and also that you may need to rebuild the kernel
several times (for additional .config choices) depending on what
parts of BLFS you build. And we do not provide a package manager.
So I submit that we are the people least likely to need this.
ĸen
--
This one goes up to eleven: but only on a clear day, with the wind in
the right direction.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Daniel Baluta <daniel.baluta@intel.com> |
|---|---|
| Date | 2015-08-20 12:00 +0200 |
| Message-ID | <pZuND-1gR-55@gated-at.bofh.it> |
| In reply to | #1210001 |
On Wed, Aug 19, 2015 at 10:09 PM, Ken Moffat <zarniwhoop@ntlworld.com> wrote:
> On Wed, Aug 19, 2015 at 09:50:36AM +0300, Daniel Baluta wrote:
>> scripts/package/builddeb already creates a linux-keader .deb
>> package, but we need this feature also for non-Debian distros
>> (e.g. Android or LFS).
>>
>> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
>
> In general, LFS does not need this - but obviously we give you the
> freedom to change whatever you do ("your system, your rules").
>
> In particular, we assume that you will build on the machine where
> the kernel will run, and also that you may need to rebuild the kernel
> several times (for additional .config choices) depending on what
> parts of BLFS you build. And we do not provide a package manager.
> So I submit that we are the people least likely to need this.
>
> ĸen
Hi Ken / Michal,
While I don't see a huge problem having this script inside the kernel sources, I
agree that we can push this to the distro packaging scripts.
Thanks a lot for your feedback ;).
Daniel.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web