All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Fenzi <kevin@tummy.com>
To: linux-kernel@vger.kernel.org
Subject: PATCH: scripts/package/mkspec (2)
Date: Thu, 30 Dec 2004 20:41:03 -0700	[thread overview]
Message-ID: <20041231034104.0BA3395DF8@voldemort.scrye.com> (raw)


Here's another patch to mkspec. 
This one was coipied from the Fedora kernel spec file. 
(I'm not sure who to attibute it to. arjanv@redhat.com ? )

Currently when you do a 'make rpm' on a kernel.org kernel, and then
later want to build a non-included module, you have to have the entire
kernel source tree available to build against. 

This patch copies the needed files to
/lib/modules/<kernelversion>/build 
so you can build modules against that area instead of needing the
entire build tree available. 

Again, I use a fedora based setup, so I would be interested to hear if
this setup works ok for other systems. 

Comments?

kevin
--
diff -Nru linux-2.6.10.orig/scripts/package/mkspec linux-2.6.10/scripts/package/mkspec
--- linux-2.6.10.orig/scripts/package/mkspec    2004-12-24 14:33:49.000000000 -0700
+++ linux-2.6.10/scripts/package/mkspec 2004-12-30 20:31:33.954485598 -0700
@@ -70,6 +70,33 @@
 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"

 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
+echo '    rm -f $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build'
+echo '    rm -f $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/source'
+echo '    mkdir -p $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build'
+echo '    (cd $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE ; ln -s build source)'
+echo '    # first copy everything'
+echo '    cp --parents `find  -type f -name Makefile -o -name "Kconfig*"` $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build'
+echo '    cp Module.symvers $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build'
+echo '    # then drop all but the needed Makefiles/Kconfig files'
+echo '    rm -rf $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/Documentation'
+echo '    rm -rf $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/scripts'
+echo '    rm -rf $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/include'
+echo '    cp arch/%{_arch}/kernel/asm-offsets.s $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/arch/%{_arch}/kernel || :'
+echo '    cp .config $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build'
+echo '    cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build'
+echo '    cp -a arch/%{_arch}/scripts $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/arch/%{_arch} || :'
+echo '    cp -a arch/%{_arch}/*lds $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/arch/%{_arch}/|| :'
+echo '    rm -f $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/scripts/*.o'
+echo '    rm -f $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/scripts/*/*.o'
+echo '    mkdir -p $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/include'
+echo '    cd include'
+echo '    cp -a acpi config linux math-emu media net pcmcia rxrpc scsi sound video asm asm-generic$RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/include'
+echo '    cp -a `readlink asm` $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/include'
+echo '    # Make sure the Makefile and version.h have a matching timestamp so that'
+echo '    # external modules can be built'
+echo '    touch -r $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/Makefile $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/include/linux/version.h'
+echo '    touch -r $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/.config $RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build/include/linux/autoconf.h'
+echo '    cd ..'
 echo ""
 echo "%clean"
 echo '#echo -rf $RPM_BUILD_ROOT'

                 reply	other threads:[~2004-12-31  3:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20041231034104.0BA3395DF8@voldemort.scrye.com \
    --to=kevin@tummy.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.