From: Michal Marek <mmarek@suse.cz>
To: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: Doug Ledford <dledford@redhat.com>,
linux-kbuild@vger.kernel.org, mmarcini@yahoo.com
Subject: Re: [PATCH 3/3] kbuild: add generation of kernel-devel
Date: Thu, 04 Jul 2013 17:15:39 +0200 [thread overview]
Message-ID: <51D5919B.7010208@suse.cz> (raw)
In-Reply-To: <20130624143833.10761.94871.stgit@phlsvslse11.ph.intel.com>
On 24.6.2013 16:38, Mike Marciniszyn wrote:
> Change the spec file to generate a kernel-devel module
> allowing for compilation of external kernel modules.
>
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
> ---
> scripts/package/mkspec | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> index 514aeb2..65131df 100755
> --- a/scripts/package/mkspec
> +++ b/scripts/package/mkspec
> @@ -59,6 +59,14 @@ echo "header files define structures and constants that are needed for"
> echo "building most standard programs and are also needed for rebuilding the"
> echo "glibc package."
> echo ""
> +echo "%package devel"
> +echo "Summary: Development package for building kernel modules to match the $__KERNELRELEASE kernel"
> +echo "Group: System Environment/Kernel"
> +echo "AutoReqProv: no"
> +echo "%description -n kernel-devel"
> +echo "This package provides kernel headers and makefiles sufficient to build modules"
> +echo "against the $__KERNELRELEASE kernel package."
> +echo ""
>
> if ! $PREBUILT; then
> echo "%prep"
> @@ -109,6 +117,11 @@ echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2"
> echo 'mv vmlinux.orig vmlinux'
> echo "%endif"
>
> +echo 'rm -rf $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}"
> +echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE"
> +echo "EXCLUDES=\"--exclude-vcs --exclude .tmp_versions --exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=firmware --exclude .config.old --exclude .missing-syscalls.d\""
> +echo "tar "'$EXCLUDES'" -cf- . | (cd "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE;tar xvf -)"
For consistency and compatibility with older tar versions, please use
$RCS_TAR_EXCLUDE instead of --exclude-vcs. Also, you only need .config,
scripts/, include/ and the Makefiles to build external modules. But
that's an optimization that can be done in a later patch.
> +echo "%post devel"
> +echo "cd /lib/modules/$KERNELRELEASE"
> +echo "ln -sf /usr/src/kernels/$KERNELRELEASE build"
> +echo "ln -sf /usr/src/kernels/$KERNELRELEASE source"
> +echo ""
> +echo "%postun devel"
> +echo "cd /lib/modules/$KERNELRELEASE"
> +echo "rm -f build source"
These symlinks should be part of the RPM payload.
Michal
next prev parent reply other threads:[~2013-07-04 15:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 14:38 [PATCH 0/3] RPM enhancements for kbuild Mike Marciniszyn
2013-06-24 14:38 ` [PATCH 1/3] kbuild: add %post section to create initramfs and grub hooks Mike Marciniszyn
2013-07-23 13:19 ` Michal Marek
2013-06-24 14:38 ` [PATCH 2/3] kbuilld: install firmware files in kernel relative directory Mike Marciniszyn
2013-07-23 13:19 ` Michal Marek
2013-06-24 14:38 ` [PATCH 3/3] kbuild: add generation of kernel-devel Mike Marciniszyn
2013-07-04 15:15 ` Michal Marek [this message]
2013-07-05 13:04 ` Marciniszyn, Mike
2013-07-05 20:29 ` Michal Marek
2013-07-05 13:12 ` Marciniszyn, Mike
2013-07-05 13:17 ` Marciniszyn, Mike
2013-07-05 20:30 ` Michal Marek
2013-07-08 11:55 ` Marciniszyn, Mike
2013-07-08 12:12 ` Michal Marek
2013-07-08 13:15 ` Marciniszyn, Mike
2013-07-08 13:32 ` Doug Ledford
2013-07-08 13:39 ` Marciniszyn, Mike
2013-07-08 14:45 ` Michal Marek
2013-07-08 15:52 ` Marciniszyn, Mike
2013-07-08 16:20 ` Doug Ledford
2013-07-08 17:17 ` Marciniszyn, Mike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51D5919B.7010208@suse.cz \
--to=mmarek@suse.cz \
--cc=dledford@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=mike.marciniszyn@intel.com \
--cc=mmarcini@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox