From: Mike Marciniszyn <mike.marciniszyn@intel.com>
To: mmarek@suse.cz
Cc: Doug Ledford <dledford@redhat.com>,
linux-kbuild@vger.kernel.org, mmarcini@yahoo.com
Subject: [PATCH 3/3] kbuild: add generation of kernel-devel
Date: Mon, 24 Jun 2013 10:38:33 -0400 [thread overview]
Message-ID: <20130624143833.10761.94871.stgit@phlsvslse11.ph.intel.com> (raw)
In-Reply-To: <20130624143658.10761.3787.stgit@phlsvslse11.ph.intel.com>
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 -)"
+
echo ""
echo "%clean"
echo 'rm -rf $RPM_BUILD_ROOT'
@@ -122,6 +135,15 @@ echo "/sbin/installkernel $KERNELRELEASE /boot/vmlinuz-$KERNELRELEASE-rpm /boot/
echo "rm -f /boot/vmlinuz-$KERNELRELEASE-rpm /boot/System.map-$KERNELRELEASE-rpm"
echo "fi"
echo ""
+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"
+echo ""
echo "%files"
echo '%defattr (-, root, root)'
echo "%dir /lib/modules"
@@ -133,3 +155,7 @@ echo "%files headers"
echo '%defattr (-, root, root)'
echo "/usr/include"
echo ""
+echo "%files devel"
+echo '%defattr (-, root, root)'
+echo "/usr/src/kernels/$KERNELRELEASE"
+echo ""
next prev parent reply other threads:[~2013-06-24 14:38 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 ` Mike Marciniszyn [this message]
2013-07-04 15:15 ` [PATCH 3/3] kbuild: add generation of kernel-devel Michal Marek
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=20130624143833.10761.94871.stgit@phlsvslse11.ph.intel.com \
--to=mike.marciniszyn@intel.com \
--cc=dledford@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=mmarcini@yahoo.com \
--cc=mmarek@suse.cz \
/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