PATCH: scripts/package/mkspec (2)
From: Kevin Fenzi (kevin_at_tummy.com)
Date: 12/31/04
- Previous message: Felipe Erias: "Queues when accessing disks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Dec 2004 20:41:03 -0700 To: linux-kernel@vger.kernel.org
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'
-
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/
- Previous message: Felipe Erias: "Queues when accessing disks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: custom kernel
... >> I made an attempt to custom build a kernel from the src.rpm. ... .config:4478:
trying to assign nonexistent symbol X86_LONGHAUL ... echo "Patch #1:" ...
(Fedora) - Re: [PATCH 2/3] exporting capability name/code pairs (final#2)
... Who can pick up this patch to the upstreamed tree? ... I'm not an expert of
kernel makefiles. ... | A newer kernel sometimes adds new capabilities, ...
| +echo '#ifndef CAP_NAMES_H' ... (Linux-Kernel) - Re: whats the processing sequence for initramfs during boot?
... the intricacies of the boot sequence regarding how the kernel ... where is that
echo output going so i can see it? ... mknod /dev/null c 1 3 ... insmod
/lib/ehci-hcd.ko ... (Fedora) - Re: [PATCH] exporting capability code/name pairs (try #5.1)
... This patch enables to export code/name of capabilities supported ... A newer
kernel sometimes adds new capabilities, ... +echo '#ifndef CAP_NAMES_H' ...
(Linux-Kernel) - Re: [PATCH] exporting capability code/name pairs (try #5.1)
... This patch enables to export code/name of capabilities supported ... A newer
kernel sometimes adds new capabilities, ... +echo '#ifndef CAP_NAMES_H' ...
(Linux-Kernel)