Mailinglist Archive: opensuse-kernel (68 mails)

< Previous Next >
Re: [opensuse-kernel] Build kernel from sources
  • From: Michal Marek <mmarek@xxxxxxx>
  • Date: Wed, 07 Jul 2010 13:46:13 +0200
  • Message-id: <4C346905.1030306@xxxxxxx>
On 6.7.2010 14:11, Ole Streicher wrote:
Hi,

independent from my last question, I would like to try to compile
patched kernel packages. What is the best way to build them efficiently?

Following the Howto I found
(http://www.xadux.eu/wiki/1107-kernel-bau-aus-den-kernel-source-src-red-hat-package-manager.html;
in german) I need to go through the following steps:

1. Install the kernel source src.rpm
2. patch-what-you-need, set new version number
3. copy kernel-defaults.spec and kernel-syms.spec to SPECS
4. rpmbuild -ba kernel-source.spec
rpmbuild -ba kernel-default.spec
5. install kernel and reboot with the new kernel
6. rpmbuild -ba kernel-syms.spec

I have now three problems here:

1. Spec files for kernel and symbols
====================================

The kernel source src.rpm does not contain kernel-default.spec and
kernel-syms.spec, but rather kernel-binary.spec.in and
kernel-syms.spec.in. How can I generate the spec files from them?

./mkspec --release=<your release string>


2. Patching the kernel
======================

To patch the source, I added a mypatch.tar.bz2 to the SOURCES dir, in
kernel-source.spec appended a line

Source300: mypatch.tar.bz2

at the end of the sources list, added a "-n 300" in the "%setup" line.

There is the empty patches.addon.tar.bz2 placeholder for exatcly this
purpose.


In series.conf, I added the lines

########################################################
# Local patches
########################################################
patches.me9x00/me9x00.patch

Correct (in 11.3+, you will be able to add a series file to the
patches.addon.tar.bz2 tarball, saving you the need of editing the main
series.conf).


This compiles already quite well :-) However, I also want to change the
kernel .config (increase the max and runtime number of UARTS). What
would be the best way to do so? What I did is to write a diff to
config.tar.bz2 and put additional lines in kernel-source.spec:

Patch: increase_nr_of_uarts.patch (after the "Source300" line)

%patch (after the "%setup" line)

Are there any drawbacks with that or is this the recommended way?

Well, there is no recommended way in 11.2, unfortunatelly. In 11.3+,
there is a config.addon.tar.bz2 placeholder, where you can package e.g.
a config.addon/i386/pae file with the config options you want to change.
I should really document this in README.SUSE.


3. Version number
=================

I changed the "Release" line of kernel-source.spec to

Release: 0.2.1.mycompany.1

Does this sound reasonable or is there a recommendation for private
numbering?

See above, use the mkspec --release option to set the release string.

Michal
--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-kernel+help@xxxxxxxxxxxx

< Previous Next >
References