PDA

View Full Version : Compile a kernel for i686, i586 and others (NO i386)


alpha645
2006-12-17, 02:29 PM CST
Kernel Compilation: (Updated for Fedora 8) (the old howto is attached)

1. Reasons to recompile the kernel
2. Where to start
3. Configuring
4. Compiling
5. Installing


1. There are various reasons to recompile the kernel. For example:
- Include new drivers (that are not enabled by default)
- Just for fun
- Gain a performance boost
- And many more...
Recompiling the kernel is not for those who are regular Windows end-users. You need to know:
- Which hardware you have (and which drivers are required)
- What the system really needs
Things could go wrong, so always make a back-up of important data!


2. You start by preparing the system for the compilation. Your system needs several tools to build the kernel. Plus, you need the source of the kernel of course...
So, let's update the system to compile (you first become root (after opening a terminal of course), and you have to stay root during the entire howto):

su -
yum -y install yum-utils ncurses-devel gcc-c++ gcc binutils rpm-build m4 rpmdevtools make sparse e2fsprogs jfsutils reiserfs-utils xfsprogs pcmciautils quota ppp isdn4k-utils nfs-utils procps oprofile libglade

Some of these programs are really required (yum-utils ncurses-devel gcc-c++ gcc binutils rpm-build m4 rpmdevtools make). Some might not even be touched (e2fsprogs jfsutils reiserfs-utils xfsprogs pcmciautils quota ppp isdn4k-utils nfs-utils procps oprofile libglade). But I included them so you don't have to hunt them down in case they are needed :) .
Now, let's grab the source.

yumdownloader --source kernel

Now we only need to install the source so that it is ready for editing and compiling:

rpmdev-setuptree
rpm -Uvh /root/kernel-*src.rpm


3. Configuring (I will add patching later if I have time)

gedit /root/rpmbuild/SPECS/kernel.spec

These sections are important (look closely (plus they may vary in each kernel version)):

>>>
%define fedora_build %(R="$Revision: 1.294 $"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})
<<<
-----------------------------------------------------------------------^ Place any extra stuff after this (in our case 1.294...) to seperate this kernel from the stock kernel. You must do this, or you will overwrite your default kernel.


<<<
# The following build options are enabled by default.
# Use either --without <opt> in your rpmbuild command or force values
# to 0 in here to disable them.
#
# standard kernel
%define with_up %{?_without_up: 0} %{?!_without_up: 1}
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp %{?_without_smp: 0} %{?!_without_smp: 0} # %{?!_without_smp: 0} will mean no SMP kernel same as the others below.
# kernel-PAE (only valid for i686)
%define with_pae %{?_without_pae: 0} %{?!_without_pae: 0}
# kernel-xen
%define with_xen %{?_without_xen: 0} %{?!_without_xen: 0}
# kernel-kdump
%define with_kdump %{?_without_kdump: 0} %{?!_without_kdump: 0}
# kernel-debug
%define with_debug %{?_without_debug: 0} %{!?_without_debug: 0}
# kernel-doc
%define with_doc %{?_without_doc: 0} %{?!_without_doc: 0}
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 0} # Assuming you stay x86, you don't need new headers.
# kernel-debuginfo
%define with_debuginfo %{?_without_debuginfo: 0} %{!?_without_debuginfo: 0}
>>>


>>>
%define debugbuildsenabled 1 # Set this to 0 to disable the annoying debug kernel.
<<<

Now we can start building to generate a .config:

rpmbuild -bp --target=i686 /root/rpmbuild/SPECS/kernel.spec

Note, I use --target=i686. This is for the architecture of your computer. If you have a normal computer (PC) then you should always use i686. Unless you have a mac, then use 'ppc' (not tested). You can view your arch by typing:

arch

Now creat your config:

cd /root/rpmbuild/BUILD/*/linux*
make menuconfig

Now, create and save your .config inside menuconfig in your root directory: (save it as: /root/config)

AND, save your kernel.spec in your root directory (this is done below) and clean up the mess:

cp /root/rpmbuild/SPECS/kernel.spec /root/spec
rm -rf /root/rpmbuild/
cd /root/

Now we have to reinstall the source (we do this to keep the building environment in good condition):

rpmdev-setuptree
rpm -Uvh /root/kernel-*src.rpm

Copy back your spec file:

cp /root/spec /root/rpmbuild/SPECS/kernel.spec

Now your /root/config file, this one is a little more complicated:

dir /root/rpmbuild/SOURCES | grep "config-"

One of these configs are used for your kernel (defined by --target=i686). If you build an i686 (normal and SMP) kernel you need:

config-i686

So you copy your config over that config:

cp /root/config /root/rpmbuild/SOURCES/config-i686


4. Compiling

Finally you can start compiling (again replace i686 with your architecture):

rpmbuild -bb --target=i686 /root/rpmbuild/SPECS/kernel.spec


5. Installing

You can find the .rpms inside:

/root/rpmbuild/RPMS/`arch`/

This will install the newly build kernel on an i686 system:

rpm -i /root/rpmbuild/RPMS/i686/kernel-2.6.*.rpm

And the development package:

rpm -i /root/rpmbuild/RPMS/i686/kernel-devel-2.6.*.rpm

Your new kernel is now installed, reboot to test it :) . (Chose the new entry in grub during boot)

To remove (RPM requires and exact match (so no wildcards) before it will delete packages):

To see all installed kernels (and development and headers) do:

rpm -aq | grep kernel

The output will list the installed kernels. Yours has the same name as the packages in /root/rpmbuild/RPMS/`arch`/

The following example will delete the current stock kernel from Fedora (and devel): (So replace it with your kernel!)

rpm -e kernel-2.6.23.9-85.fc8
rpm -e kernel-devel-2.6.23.9-85.fc8

If there are any questions, feel free to ask them...

Thanks to the people who gave feedback and some really good tips :D

jim
2006-12-17, 03:19 PM CST
Change the following rules:

# I'm assuming you don't want to build the XEN or KDUMP kernels
%define buildxen 1 Change to: %define buildxen 1
%define builddoc 0 Change to: %define builddoc 0
%define buildkdump 1 Change to: %define buildkdump 1
%define buildheaders 1 Change to: %define buildheaders 1
you dont to appear to be changing anything...

leigh123@linux
2006-12-17, 03:51 PM CST
Well laid out and easy to follow , how about a howto for the kernel-devel. ;)

10/10

alpha645
2006-12-17, 11:54 PM CST
you dont to appear to be changing anything...

Whoops, I'll correct it :) .

Well laid out and easy to follow , how about a howto for the kernel-devel.

Kernel-devel package is included as well :D :D :D .

alpha645
2006-12-18, 09:03 AM CST
I changed the guide:

- Found a way to change kernelstring
- Removed some vague parts
- Improved explanation for architecture
- Some commands are combined (less commands needed)

jon3k
2006-12-21, 03:48 PM CST
I'd also recommend instructions on adding any additional patches that someone may want to add while they rebuild their kernel.

Excellent work, definitely a handy guide.

alpha645
2006-12-23, 12:49 PM CST
When I have time, I will add the following stuff:

- Much easier way to configure kernel (menuconfig REALLY :cool: )
- Disable debug-packages (reduces compile time)
- And finally, on many requests patches. But I will have to figure a way to bypass those who are not working...

Happy Xmas everyone :)

alpha645
2006-12-25, 03:49 AM CST
Okay, it's updated. Now, for the final part, the patches :rolleyes: :rolleyes: . I really appreciate some feedback.

alpha645
2006-12-29, 01:20 AM CST
4. Troubleshooting

- If you get a message during the compilation like that you need to collect more 'entropy'. Simply open up openoffice or firefox. This is needed for the module signing and encrypting (I think).

- If you kernel fails to boot and you get all sorts of errors, this means you configured your kernel the wrong way. try customizing your kernel step by step to prevent problems.

- To prevent problems with kmod's (kernel mods) like fglrx, make sure you compile the kernel in the way the kmod 'wants' it. (http://www.stanchina.net/~flavio/debian/fglrx-installer.html#requirements)

5. More info
I managed to create my own and fully functionable kernel package of just 4,5 MB :) . Here is some more information.

1: Once you installed your kernel, yum will popup for an update. You can bypass this by changing the kernel string to a higher value than the original kernel (in the guid I use 'custom'), for example:

- Version: 2.18-1.2868 (the standard one) will overwrite your current kernel
- Version: 2.18-1.custom (used in the manual) will be overwritten during update
- Version: 2.18-1.2869 (recommended) will not overwrite your current kernel and it will NOT be updated by yum

2: I also recommend you leave Code Maturity enabled for many more options

3: These were some conditions in my case:

- Leave the Network Packet Filtering untouched as it will colide with the firewall
- Sound doesn't work anymore when I tried to configure the sound part in menuconfig

koridor
2007-01-02, 05:55 AM CST
Hello,

First thank you for your procedure, it worked directly on my system, except for the configuration stuff that I haven't understood. Keeping the defaults gave me an operational system, so I'm happy.

Now I'd like to apply the patches from http://home-tj.org/files/libata-tj-stable/libata-tj-2.6.18.1-20061020.tar.bz2

I've extracted the patches to ../SOURCE/ and added a PatchXXXX and a %patchXXXX into the .spec file for each patch file.

When I try a rebuild, patches fail because they are recognised as 'already applied', in this case I comment out the patch in the .spec file, or because the patch command prompts me with the question 'File to patch :' like this :

|---
| drivers/ata/libata-core.c | 79 +++++++++++++++++++++++++++++
| drivers/ata/libata-eh.c | 123 ++++++++++++++++++++++++++++++++++++++++++++-
| drivers/ata/libata.h | 2 +
| include/linux/libata.h | 10 ++++
| 4 files changed, 211 insertions(+), 3 deletions(-)
|
|diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
|index f19e041..5c3d566 100644
|--- a/drivers/ata/libata-core.c
|+++ b/drivers/ata/libata-core.c
--------------------------
File to patch:

TIA for your help.

alpha645
2007-01-02, 12:29 PM CST
Hello,

First thank you for your procedure, it worked directly on my system, except for the configuration stuff that I haven't understood. Keeping the defaults gave me an operational system, so I'm happy.

Now I'd like to apply the patches from http://home-tj.org/files/libata-tj-stable/libata-tj-2.6.18.1-20061020.tar.bz2

I've extracted the patches to ../SOURCE/ and added a PatchXXXX and a %patchXXXX into the .spec file for each patch file.

When I try a rebuild, patches fail because they are recognised as 'already applied', in this case I comment out the patch in the .spec file, or because the patch command prompts me with the question 'File to patch :' like this :

|---
| drivers/ata/libata-core.c | 79 +++++++++++++++++++++++++++++
| drivers/ata/libata-eh.c | 123 ++++++++++++++++++++++++++++++++++++++++++++-
| drivers/ata/libata.h | 2 +
| include/linux/libata.h | 10 ++++
| 4 files changed, 211 insertions(+), 3 deletions(-)
|
|diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
|index f19e041..5c3d566 100644
|--- a/drivers/ata/libata-core.c
|+++ b/drivers/ata/libata-core.c
--------------------------
File to patch:

TIA for your help.

Commenting out patches in the specfile didn't help for me. If you could explain that a little more, I might be able to upgrade the manual for patches.

I already found out about the --short-circuit switch in rpmbuild. That could allow you to do %prep first (build source files) and do %build and %install after that. However, when performing %prep with a patched kernel, I get errors. You solve those errors by commenting them out, but that doesn't work here. I get the error: could not find patchXXXX.

koridor
2007-01-02, 12:44 PM CST
Commenting out patches in the specfile didn't help for me. If you could explain that a little more, I might be able to upgrade the manual for patches.
I already found out about the --short-circuit switch in rpmbuild. That could allow you to do %prep first (build source files) and do %build and %install after that. However, when performing %prep with a patched kernel, I get errors. You solve those errors by commenting them out, but that doesn't work here. I get the error: could not find patchXXXX.

Each patch takes 2 lines in the specfile. Did you comment out both ? I did.

WARNING : what I did is just a try to make the kernel (modules) build. YOU are the expert and I'm here to get help. What I did is probably wrong. Sorry to disappoint you.

alpha645
2007-01-03, 04:11 AM CST
Each patch takes 2 lines in the specfile. Did you comment out both ? I did.

WARNING : what I did is just a try to make the kernel (modules) build. YOU are the expert and I'm here to get help. What I did is probably wrong. Sorry to disappoint you.

I did not comment out both lines. I will give it a try your way. (thanks for the compliment but I'm not an expert, I use Fedora Core for just 4 months ;) )

koridor
2007-01-03, 05:49 AM CST
Commenting out patches in the specfile didn't help for me. If you could explain that a little more, I might be able to upgrade the manual for patches.

I already found out about the --short-circuit switch in rpmbuild. That could allow you to do %prep first (build source files) and do %build and %install after that. However, when performing %prep with a patched kernel, I get errors. You solve those errors by commenting them out, but that doesn't work here. I get the error: could not find patchXXXX.

What patches are you trying to apply ? If they are not Fedora or Red Hat specific, it will not succeed.

I've contacted the author of 'my' patches and he told me that the situation was hopeless for me (effort and required skills).

alpha645
2007-01-03, 08:20 AM CST
Don't know what you mean with that. I just want to apply Fedora specific patches. This can be done by downloading another kernel from kernel.org and perhaps replacing it with the kernel inside the SOURCE directory of rpmbuild.

Check this out: http://www.howtoforge.com/kernel_compilation_fedora

koridor
2007-01-03, 08:52 AM CST
Don't know what you mean with that. I just want to apply Fedora specific patches. This can be done by downloading another kernel from kernel.org and perhaps replacing it with the kernel inside the SOURCE directory of rpmbuild.

Check this out: http://www.howtoforge.com/kernel_compilation_fedora

OK. You want to upgrade to a more recent 'vanilla kernel', and then apply the Fedora patches. Right ?

My aim was different, I wanted to apply a non Fedora patch to the current kernel, in the hope it will solve a hardware problem.

I'm really uncomfortable because I don't fully understand what I'm doing. So excuse me, I prefer not to talk anymore about that. I hope that a real expert will jump into this thread to explain us. I'm now investigating a hardware solution to my problem. If that doesn't bring a solution, I'll start a new thread with my specific problem.

Good luck.

alpha645
2007-01-03, 10:00 AM CST
OK. You want to upgrade to a more recent 'vanilla kernel', and then apply the Fedora patches. Right ?

My aim was different, I wanted to apply a non Fedora patch to the current kernel, in the hope it will solve a hardware problem.

I'm really uncomfortable because I don't fully understand what I'm doing. So excuse me, I prefer not to talk anymore about that. I hope that a real expert will jump into this thread to explain us. I'm now investigating a hardware solution to my problem. If that doesn't bring a solution, I'll start a new thread with my specific problem.

Good luck.

Basically, both our 'aims' do the same. Patching a kernel and rebuild it. Patching a kernel is nothing more then replacing some code in the excisting kernel with other code. Nothing more, nothing less. If you look inside the patches you will notice that code is replaced with other code.

The kernel from www.kernel.org has a README, there is a diff (that's the program for patching) section in it. That will clearly explain to you what it exactly is.

alpha645
2007-01-03, 12:59 PM CST
I tried combining the Fedora Core specific patches with the latest stable kernel (19.1) from www.kernel.org. I tell you, IT'S MADNESS. I'm not doing it, I'm not going to write a manual for it. I mean, Fedora is bleeding edge, if you look in the source folder, you see it's at kernel 18.6. That ain't old :p . What you COULD do is only a kernel from kernel.org without Fedora patches (i don't recommend that).

alpha645
2007-01-04, 05:01 AM CST
CHECK this out:

http://download.fedora.redhat.com/pub/fedora/linux/core/development/source/SRPMS/kernel-2.6.19-1.2904.fc7.src.rpm

Wanna know which kernel?

kernel 2.6.20rc3 . The latest of the latest, no more patching needed :D :D

alpha645
2007-01-04, 07:22 AM CST
I managed to get the latest kernel working :) . You only need to update initrd:

yum --enablerepo=development install mkinitrd

I also needed to do an extra command before installing the kernel:

chcon -t sbin_t /sbin/mkinitrd

And that's it. I got the Fedora specific patches and the latest kernel from www.kernel.org :D

TylerDurdened
2007-02-14, 07:45 PM CST
Hi, I'm trying to follow this guide, but when trying to build the rpm, I get tons of this kind of error
kernel/sched.c:3968: warning: 'sleep_on_timeout' is deprecated (declared at kernel/sched.c:3954) How do I fix this?

Also, even though I have the kernel installed, I can't boot into it because it's not on the grub menu. I tried ls -l /boot but it doesn't have an initrd image for the kernel I just made..

alpha645
2007-02-14, 11:35 PM CST
Hi, I'm trying to follow this guide, but when trying to build the rpm, I get tons of this kind of error
kernel/sched.c:3968: warning: 'sleep_on_timeout' is deprecated (declared at kernel/sched.c:3954) How do I fix this?

Also, even though I have the kernel installed, I can't boot into it because it's not on the grub menu. I tried ls -l /boot but it doesn't have an initrd image for the kernel I just made..

I also get those errors, they don't seems to form a problem. Deprecated means it shouldn't be used anymore, that's all. Further, did you install the rpm as root? And do you use a development kernel or a 'normal' kernel-source?

TylerDurdened
2007-02-15, 11:00 AM CST
I also get those errors, they don't seems to form a problem. Deprecated means it shouldn't be used anymore, that's all. Further, did you install the rpm as root? And do you use a development kernel or a 'normal' kernel-source?
As root. I'm using a dev kernel (the 2.6.20 one).

If those errors don't mean anything, then I think I just need to update my menu.lst, but like I said, I don't have the initrd image to add to the grub menu (doesn't look like it has been created), and I've compiled it twice or three times

alpha645
2007-02-15, 11:20 AM CST
As root. I'm using a dev kernel (the 2.6.20 one).

If those errors don't mean anything, then I think I just need to update my menu.lst, but like I said, I don't have the initrd image to add to the grub menu (doesn't look like it has been created), and I've compiled it twice or three times

This is one of the downsides of creating an rpm. You don't know what happens down there. You are gonna have to go into the BUILD directory yourself and do the make commands yourself. It's a little more complicated, but might help:

Compiling and Installing

This step may take between 15min - 2hours depending on the speed of your system.

[root@charon linux]# make all

If that did not work, research the error and try to disable the troublesome module or feature in the Configure step above. If that worked correctly install it.

[root@charon linux]# make modules_install
[root@charon linux]# make install

Found this on mjmwired, good luck :)

TylerDurdened
2007-02-15, 03:36 PM CST
This is one of the downsides of creating an rpm. You don't know what happens down there. You are gonna have to go into the BUILD directory yourself and do the make commands yourself. It's a little more complicated, but might help:

Compiling and Installing

This step may take between 15min - 2hours depending on the speed of your system.

[root@charon linux]# make all

If that did not work, research the error and try to disable the troublesome module or feature in the Configure step above. If that worked correctly install it.

[root@charon linux]# make modules_install
[root@charon linux]# make install

Found this on mjmwired, good luck :)
Well it's going, not sure if it'll work or what, I'll update after it's done.
But for now, it's installing it into /arc/i386 for some reason.. how come? I've specified i686 for everything, and even the folder in build ends with i686..

Ok, Umm now I can't boot into anything anymore, once grub loads I only get it's command prompt :( anything I can do?

alpha645
2007-02-15, 10:47 PM CST
Command prompt? :confused: Seems like something broke grub. Try this:

http://chrismatchett.wordpress.com/2007/01/02/fedora-core-6-restore-mbr-with-grub/

TylerDurdened
2007-02-18, 12:03 AM CST
Sorry for bogging this thread down too much....
I reinstalled Fedora today (I fixed my previous problem, but came into another nonkernel related problem that I was too lazy to fix), and so I tried following this guide again. This time it worked step by step and I didn't use the devel one (just wanted to remove some stuff from the current kernel)... well now I can't boot into that kernel (though the older ones are still accessible). When I try I get mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill initHave you heard of this?

alpha645
2007-02-18, 01:44 AM CST
Sorry for bogging this thread down too much....
I reinstalled Fedora today (I fixed my previous problem, but came into another nonkernel related problem that I was too lazy to fix), and so I tried following this guide again. This time it worked step by step and I didn't use the devel one (just wanted to remove some stuff from the current kernel)... well now I can't boot into that kernel (though the older ones are still accessible). When I try I get mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill initHave you heard of this?

Those are common problems when upgrading to a newer kernel (it's kernel related). You can:

- Stick to the older one
- Recompile the current one
- Use a development kernel
- Reverse what you just did

TylerDurdened
2007-02-18, 09:31 AM CST
Those are common problems when upgrading to a newer kernel (it's kernel related). You can:

- Stick to the older one
- Recompile the current one
- Use a development kernel
- Reverse what you just did
THAT"S EXACTLY what I want to do as a matter of fact, so that I am also able to use livna stuff. I just want to take out that junk fedora puts into their kernels so it's compatible with almost any computer... without that I refuse using Linux, it takes away my "freedom". How could I go about doing that? The other sticky is very outdated and I get a bunch of errors on every step and I have to look around for 20 min to find an answer, so I don't think I want to follow that.
I'd love it if you can tell me how to do that or link me to another howto.
But if you mean just take the one from the fedora website, that's what I just used, hoping if I keep the name the same that's what it'll do. I just downloaded the same kernel and built it, but that's the error I get

alpha645
2007-02-18, 09:51 AM CST
THAT"S EXACTLY what I want to do as a matter of fact, so that I am also able to use livna stuff. I just want to take out that junk fedora puts into their kernels so it's compatible with almost any computer... without that I refuse using Linux, it takes away my "freedom". How could I go about doing that? The other sticky is very outdated and I get a bunch of errors on every step and I have to look around for 20 min to find an answer, so I don't think I want to follow that.
I'd love it if you can tell me how to do that or link me to another howto.
But if you mean just take the one from the fedora website, that's what I just used, hoping if I keep the name the same that's what it'll do. I just downloaded the same kernel and built it, but that's the error I get

Ow, if you get errors, send me PM. I'll correct it, note that development kernels don't work with this guide at the moment. Ncurses from updates is outdated for kernel-configuration-interface. Gimme all the errors you got :D

JustFly
2007-02-28, 12:13 PM CST
Greetings ppl

First i want to say that fedora is great :)

mb i can add something to this thread..

After i yumex-ed to the latest kernel (2.6.19xx-or so i think), i was surprised to find out that the sound from my saa7134 tv capture card was not working anymore, whatever i tried :( (it was working fine in older kernels).
Watching tv being essential for my desktop-experience, i needed to revert back to kernel 2.6.18.1.
I tried searching the fedora repo's & couldnt find the "old" kernel& matching nvidia driver (1.0-9631). So i decided to compile things my self like follows:

1)yum(ex) the gcc& development packages.
2)yum the needed qt-packages (yum install qt*)which are needed to run "xconfig" instead of "menuconfig" (this, for loading a .config file)
3)download the kernel of choice from kernel.org & extract it somewhere
4)become root & cd to extracted kernel-sourcedir you just dl-ed.

5.5) :rolleyes: if you want you can tweak the kernel/cpu "timeslice" in the "linux2.6.xx/kernel/sched.c" file to make the desktop somewhat more responsive:

#define MIN_TIMESLICE max(5 * HZ / 1000, 1)
#define DEF_TIMESLICE (100 * HZ / 1000)
#define ON_RUNQUEUE_WEIGHT 100

(the numbers 5, 100 & 100 can be tweaked (set lower) at your own risk..

5)type "make xconfig"

6)in the popping-up qt-window, click the load a config-menu-button.

7)as a config, just to make it easy, just load the config-file (.config) wich is standard provided in the "/boot" dir..for instance "config-2.6.18.xxx.config"

8)now tweak the standard fedora settings (i only adjust cpu-type * kernel timings & 1 or 2 other things to be sure i dont mess up things, like having no netfilter in kernel etc, im no guru)

9)press "save" in window-menu

10) -->type "make" & wait 30-60 min

11) "make modules_install install"

12)adjust /boot/grub.grub.conf to use this fantastic new creation.

voila..a custom kernel is born :cool: ..the lazy way


I salute you all!

JustFly
2007-02-28, 12:31 PM CST
ahh..you can even skip the "qt" steps if you use gconfig..
even easier..

greets

alpha645
2007-02-28, 01:38 PM CST
10) -->type "make" & wait 30-60 min

If you adjust the specs file to build only the devel and regular kernel. Time could take like 15 to 20 minutes :) . Good guide, didn't knew about that sched.c, but I ain't going to try it :D

JustFly
2007-03-11, 06:17 AM CDT
But then..loading in config files from different kernels (with different features) will sometimes mess things up..

alpha645
2007-03-11, 08:46 AM CDT
But then..loading in config files from different kernels (with different features) will sometimes mess things up..

Fout.

Features that are not in the i686 kernel will simply be ignored. The compilation program is really strict in these kind of things.

JustFly
2007-03-12, 06:04 AM CDT
ok..thnx for pointing that out..
its all good, after all!

ACCP-James
2007-03-27, 01:22 AM CDT
Might want to try it again to confirm it, but this might be an easier substituion and removes a ton of steps, worked for me anyway... In place of make menuconfig then rm rpmbuild and recreating it, do the following:



cd /root/rpmbuild/SOURCES
mv kernel-2.6.18.i686.config kernel-2.6.18.i686.config.old
cd /root/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.i686]
cp .config .config.old
make menuconfig
Select/deselect desired options...
Select save as alternate configuration, enter the following:
/root/rpmbuild/SOURCES/kernel-2.6.18.i686.config
exit menuconfig, don't bother saving changes but if you do save you've got your .config.old backup.
gedit /root/rpmbuild/SOURCES/kernel-2.16.18.i686.config
Add this two lines to the very top of the file so they become lines 1 & 2
# i386
#
Save and quit.
Proceed with editing specs file if that's not already done, then rpmbuild -bb...


This gave me the i686 build and, if I may say so, saves a handful of steps :P There's really nothing gained by copying the config file text to the other that I could discover, always wind up just missing options and the like and the only thing that prevents it from working is the fact that rpmbuild seems to look for a couple of things on specific line numbers. Omitting the # i386 and the second line with a # will cause the rpmbuild command to fail shortly in to the process... :)

alpha645
2007-03-27, 08:04 AM CDT
When a new kernel comes out, I'll give it a try and update the manual if it works. It's not severely outdated, but I was looking for an easier solution. THANKS :) .

ACCP-James
2007-03-29, 03:11 PM CDT
Some more information that should be useful to this post:

The .config file from the BUILD/ tree is actually derived from the relevant file in SOURCES/. For example, when going through the build process without modifying the kernel-2.6.spec file it goes through three iterations, one for 2.6.20.1-2933 (current Fedora update version), then another for 2.6.20.1-2933-debug and another for 2.6.20.1-2933-kdump... a fourth if you're doing xen support. For each of these builds there is a config file in the SOURCES folder named thusly:

kernel-2.6.20.1-2933-<arch>.config
kernel-2.6.20.1-2933-<arch>-debug.config
kernel-2.6.20.1-2933-<arch>-kdump.config
kernel-2.6.20.1-2933-<arch>-xen.config

When the rpmbuild process actually works on the kernel build (the 'make' stage) it copies the relevant .config file from the SOURCES folder to BUILD/kernel-2.6.20.1-2933/linux-2.6.20.1-2933/.config. What's in the actual .config file (generated by 'make menuconfig') actually means nothing when you do an rpmbuild because it just uses what's in the SOURCES folder.

Now, I'm no good with creating patches... but it wouldn't be too hard to create a script and patch set that takes a copy of a .config file generated with 'make menuconfig' (or xconfig, gconfig or even configure), copies it in to the SOURCES folder then recreates the kernel-2.6.20.1-2933*.config files with the proper settings that differ from build to build. (enabling debug features as appropriate, for example).

Finally, while on i686 platforms changing the various debug/kdump/pae settings in the .spec file seems to work, I can now validate that it causes issues with the build on x86_64, it apparently, more on that later.

I think, for my personal use, I will 'cheat'. I will simply run rpmbuild -bb <blah> out of the box and let it build the package, then, once it's done, simply do make menuconfig, make modules_install and manually cp and mkinitrd with the kernel :P That way I get the uninstall capability of yum and other package managers but don't spend that much time screwing with this :P

sideways
2007-03-29, 08:33 PM CDT
Thanks, alpha645 & ACCP-James, this works :)

Combining alpha645, ACCP-James and Fedora's official guide on kernel development (http://docs.fedoraproject.org/release-notes/fc6/en_US/sn-Kernel.html#id2840748) this is how to compile an i686 kernel rpm (and kernel-devel rpm) as a non-root user (For x86_64 replace i686 with x86_64 below)

EDIT. If previously you've been experimenting with compiling as root then you should clean out /var/tmp, so just type 'rm -fr /var/tmp/*' (as root)

1. Ensure you have development tools:
sudo yum groupinstall "Development Tools"
sudo yum install rpmdevtools


2. Login as your user (not root) in a terminal and type
rpmdev-setuptree

Get the required kernel source from, eg http://download.fedora.redhat.com/pub/fedora/linux/core/updates/6/SRPMS and install (I used kernel-2.6.20-1.2925.fc6.src.rpm)
rpm -Uhv kernel-<version>.src.rpm
(ignore warnings about 'user brewbuilder')

3. Edit the spec file ~/rpmbuild/SPECS/kernel-2.6.spec and apply alpha645's edits (This will ensure you get just a kernel rpm and a kernel-devel rpm)
Line numbers. are approx only, since they vary with kernel versions, you should be able to ocate the relevant ones.

(In more recent kernels these first two edits may be unnecessary)
~line 13: %define buildxen 0
~line 15: %define buildkdump 0

Now edit the version string, eg add .test, or .stk8 if compiling for 8K stacks. I used .stk8, and added it like this

~line 41: %define release %(R="$Revision: 1.2925.stk8 $"; RR="${R##: }"; echo ${RR%%?})%{?dist}


Finally, look for an arch specific line a little further down beginning '%ifarch i686', and edit the defines to

~line 81: %define builddebug 0
~line 108: %define buildpae 0

then add this line directly below line 108: %define _enable_debug_packages 0

NOTE. If you do not apply these edits then the compilation time will increase up to 4-fold, also you will need several gigs of free space available to /var/tmp. Obviously, if you specifically need a pae or xen kernel then leave those options at '1'.

4. Build the source tree (This and the following steps requires approx 1 gig free space in your home directory, much more if you enabled debug builds etc.)**
rpmbuild -bp --target=i686 ~/rpmbuild/SPECS/kernel-2.6.spec

5. Create a clean build environment
cd ~/rpmbuild/BUILD/kernel-<version>/linux-<version>/
make mrproper

6. Now copy a config file from a default one in ~/rpmbuild/BUILD/kernel-<version>/linux-<version>/configs/, and configure it for the compilation

cp configs/kernel-<version>-i686.config .config
make oldconfig
Press return to accept defaults to any questions if prompted (or chose suitable alternatives)

Now apply any custom settings using 'make menuconfig' (eg for 8K stacks, scroll down to the 'Kernel hacking' section, select that then scroll down to the bottom and deselect the option to use 4K stacks.) Make sure Kernel debugging is NOT selected in the 'Kernel hacking' section (Or at least deselect the option to 'Compile the kernel with debug info', otherwise the modules size will be huge)
make menuconfig
Ensure to save this config on exit from menuconfig if you made any changes. (You can use 'make xconfig' or 'make gconfig' if you want a nice gui interface)

7. Now the fiddly bit. As ACCP-James has told us, rpmbuild -bb will ignore this .config, so for an i686 build we have to copy it back to ~/rpmbuild/SOURCES/kernel-<version>-i686.config
cp .config ~/rpmbuild/SOURCES/kernel-<version>-i686.config
and then edit ~/rpmbuild/SOURCES/kernel-<version>-i686.config and add '# i386' ('x86_64' for 64 bit) to the top so the first 3 lines are
# i386
#
# Automatically generated make config: don't edit

8. Now you can build the kernel
rpmbuild -bb --target=i686 ~/rpmbuild/SPECS/kernel-2.6.spec
If you get a message about entropy being too low, just open any application temporarily and then close it. You can ignore the multitude of warnings generated.
And after an hour or so (depending on cpu/memory, it took 32mins on an AMD64 3500, 1GB ram) you'll have two rpms in ~/rpmbuild/RPMS/i686, a kernel rpm and a kernel-devel rpm

9. Install the kernel and kernel-devel sudo rpm -ihv ~/rpmbuild/RPMS/i686/kernel*.rpm
(You can use the '--force' option if this complains that a newer kernel is already installed, but you'll overwrite the current kernel if the revision name from step 3 matches the current one, so add something like .test at that step if you want to keep the current kernel as a boot option in grub (highly recommended))
This will also amend grub to make this kernel the default boot (it will also create the ram disk image in /boot, so no need to do a mkinitrd)

The ~/rpmbuild directory will now be a around 1 gig so once you've copied the two rpms somewhere safe you probably should delete all the files in it (unless you are building other rpms or want to do another kernel compile (then go back to step 5))

rpmdev-wipetree
(to just remove the files created during the build steps, use 'rm -fr ~/rpmbuild/BUILD/kernel-<buildversion>', you then have to go back to step 4 to do another build)


NOTE. An alternative method is to use 'make UTS_MACHINE=i686 rpm' in place of steps 7 & 8, however this does not produce a kernel-devel rpm which is really needed in Fedora (you do get a kernel src.rpm which you also get if you use rpmbuild -ba). Also, when you install the kernel rpm created this way you have to do the extra steps of editing grub.conf and mkinitrd to generate a ram disk yourself. Thus the rpmbuild -bb method is superior and is the recommended method in Fedora.

** After doing rpmdev-setuptree you can point the build directory to wherever you want by editing ~/.rpmmacros and changing the line which defines %_topdir., then copy the rpmbuild directory structure to that location with 'cp -a ~/rpmbuild <destination>', just make sure your user has full permissions on the directory you point to.

ACCP-James
2007-04-05, 10:15 PM CDT
As a sidenote if your'e compiling for a different architecture base... such as x86_64 or SPARC, you would specify that instead if i386 at the top of the kernel-2.6.x-x.config file. :) i686 and i386 are interchangeable for whatever reason when building a kernel. Who knew?

vratnica
2007-04-10, 12:11 AM CDT
Helllo!
I m just new to fedora and I ve tried to compile the kernel as it is shown in this howto, but i dont understand following lines:

To get the latest of the latest kernel with all Fedora specific patches working and all the patches from kernel.org, go here and grab the bleeding edge kernel (make sure you change all the directory names and stuff):

http://download.fedora.redhat.com/p...t/source/SRPMS/ (also read post 20 when doing this)

which direktory names? and to what?

to which folder to download the kernel? and where to extract the file (or should I do that anyway?)

thank you :)

alpha645
2007-04-10, 01:06 AM CDT
Helllo!
I m just new to fedora and I ve tried to compile the kernel as it is shown in this howto, but i dont understand following lines:



which direktory names? and to what?

to which folder to download the kernel? and where to extract the file (or should I do that anyway?)

thank you :)

In the howto, the example commands are done with a specific kernel(version). So you need to change those to this kernel's name in order to let them work.

vratnica
2007-04-10, 04:53 AM CDT
I downloaded the kernel and copied it into /root

after command

rpm -Uvh kernel-2.6.20-1.3045.fc7.src.rpm

I got:

1:kernel warning: user brewbuilder does not exist - using root
warning: group brewbuilder does not exist - using root
warning: user brewbuilder does not exist - using root
warning: group brewbuilder does not exist - using root
warning: user brewbuilder does not exist - using root

...and so on a lot of times..


then

########################################### [100%]
warning: user brewbuilder does not exist - using root
warning: group brewbuilder does not exist - using root
warning: user brewbuilder does not exist - using root

again..


then by command

rpmbuild -bp --target=i686 /root/rpmbuild/SPECS/kernel-2.6.spec

I got:

drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
.config:381:warning: trying to assign nonexistent symbol IDEDMA_AUTO
.config:1215:warning: trying to assign nonexistent symbol RT2400PCI_DEBUG
.config:1217:warning: trying to assign nonexistent symbol RT2500PCI_DEBUG
.config:1219:warning: trying to assign nonexistent symbol RT61PCI_DEBUG
.config:1221:warning: trying to assign nonexistent symbol RT2500USB_DEBUG
.config:1223:warning: trying to assign nonexistent symbol RT73USB_DEBUG
.config:1252:warning: trying to assign nonexistent symbol NET_WIRELESS
.config:1253:warning: trying to assign nonexistent symbol NET_WIRELESS_RTNETLINK
.config:2875:warning: trying to assign nonexistent symbol TUX
.config:2876:warning: trying to assign nonexistent symbol TUX_EXTCGI
.config:2877:warning: trying to assign nonexistent symbol TUX_EXTENDED_LOG
.config:2878:warning: trying to assign nonexistent symbol TUX_DEBUG
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-PAE-debug.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(...ant than like upthere..)
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-PAE.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(and than like upthere again...)
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-debug.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(and than like upthere again...)
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-xen.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
.config:381:warning: trying to assign nonexistent symbol IDEDMA_AUTO
.config:1215:warning: trying to assign nonexistent symbol RT2400PCI_DEBUG
.config:1217:warning: trying to assign nonexistent symbol RT2500PCI_DEBUG
.config:1219:warning: trying to assign nonexistent symbol RT61PCI_DEBUG
.config:1221:warning: trying to assign nonexistent symbol RT2500USB_DEBUG
.config:1223:warning: trying to assign nonexistent symbol RT73USB_DEBUG
.config:1252:warning: trying to assign nonexistent symbol NET_WIRELESS
.config:1253:warning: trying to assign nonexistent symbol NET_WIRELESS_RTNETLINK
.config:2875:warning: trying to assign nonexistent symbol TUX
.config:2876:warning: trying to assign nonexistent symbol TUX_EXTCGI
.config:2877:warning: trying to assign nonexistent symbol TUX_EXTENDED_LOG
.config:2878:warning: trying to assign nonexistent symbol TUX_DEBUG
.config:3343:warning: trying to assign nonexistent symbol XEN_PCIDEV_FRONTEND
.config:3344:warning: trying to assign nonexistent symbol XEN_PCIDEV_FE_DEBUG
.config:3345:warning: trying to assign nonexistent symbol XEN
.config:3346:warning: trying to assign nonexistent symbol XEN_INTERFACE_VERSION
.config:3347:warning: trying to assign nonexistent symbol XEN_PRIVILEGED_GUEST
.config:3348:warning: trying to assign nonexistent symbol XEN_UNPRIVILEGED_GUEST
.config:3349:warning: trying to assign nonexistent symbol XEN_PRIVCMD
.config:3350:warning: trying to assign nonexistent symbol XEN_XENBUS_DEV
.config:3351:warning: trying to assign nonexistent symbol XEN_BACKEND
.config:3352:warning: trying to assign nonexistent symbol XEN_BLKDEV_BACKEND
.config:3353:warning: trying to assign nonexistent symbol XEN_BLKDEV_TAP
.config:3354:warning: trying to assign nonexistent symbol XEN_NETDEV_BACKEND
.config:3355:warning: trying to assign nonexistent symbol XEN_NETDEV_PIPELINED_TRANSMITTER
.config:3356:warning: trying to assign nonexistent symbol XEN_NETDEV_LOOPBACK
.config:3357:warning: trying to assign nonexistent symbol XEN_PCIDEV_BACKEND
.config:3358:warning: trying to assign nonexistent symbol XEN_PCIDEV_BACKEND_VPCI
.config:3359:warning: trying to assign nonexistent symbol XEN_PCIDEV_BACKEND_PASS
.config:3360:warning: trying to assign nonexistent symbol XEN_PCIDEV_BE_DEBUG
.config:3361:warning: trying to assign nonexistent symbol XEN_TPMDEV_BACKEND
.config:3362:warning: trying to assign nonexistent symbol XEN_BLKDEV_FRONTEND
.config:3363:warning: trying to assign nonexistent symbol XEN_NETDEV_FRONTEND
.config:3364:warning: trying to assign nonexistent symbol XEN_FRAMEBUFFER
.config:3365:warning: trying to assign nonexistent symbol XEN_KEYBOARD
.config:3366:warning: trying to assign nonexistent symbol XEN_SCRUB_PAGES
.config:3367:warning: trying to assign nonexistent symbol XEN_DISABLE_SERIAL
.config:3368:warning: trying to assign nonexistent symbol XEN_SYSFS
.config:3369:warning: trying to assign nonexistent symbol XEN_COMPAT_030002_AND_LATER
.config:3370:warning: trying to assign nonexistent symbol XEN_COMPAT_LATEST_ONLY
.config:3371:warning: trying to assign nonexistent symbol XEN_COMPAT_030002
.config:3372:warning: trying to assign nonexistent symbol HAVE_ARCH_ALLOC_SKB
.config:3373:warning: trying to assign nonexistent symbol HAVE_ARCH_DEV_ALLOC_SKB
.config:3374:warning: trying to assign nonexistent symbol HAVE_IRQ_IGNORE_UNHANDLED
.config:3375:warning: trying to assign nonexistent symbol NO_IDLE_HZ
.config:3376:warning: trying to assign nonexistent symbol XEN_UTIL
.config:3377:warning: trying to assign nonexistent symbol XEN_BALLOON
.config:3378:warning: trying to assign nonexistent symbol XEN_DEVMEM
.config:3379:warning: trying to assign nonexistent symbol XEN_SKBUFF
.config:3380:warning: trying to assign nonexistent symbol XEN_REBOOT
.config:3381:warning: trying to assign nonexistent symbol XEN_SMPBOOT
.config:3383:warning: trying to assign nonexistent symbol X86_XEN
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(..and than like upthere again..)
+ echo '# i386'
+ cat .config
+ perl -p -i -e 's/^SUBLEVEL.*/SUBLEVEL = 20/' Makefile
+ perl -p -i -e 's/^EXTRAVERSION.*/EXTRAVERSION = -prep/' Makefile
+ find . '(' -name '*.orig' -o -name '*~' ')' -exec rm -f '{}' ';'
+ cd ..
+ '[' '!' -d sparse-0.2 ']'
+ cd /root/rpmbuild/BUILD
+ cd kernel-2.6.20
+ /usr/bin/bzip2 -dc /root/rpmbuild/SOURCES/sparse-0.2.tar.bz2
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0

I am not sure if I should go any further with it

alpha645
2007-04-10, 08:38 AM CDT
1:kernel warning: user brewbuilder does not exist - using root
warning: group brewbuilder does not exist - using root
warning: user brewbuilder does not exist - using root
warning: group brewbuilder does not exist - using root
warning: user brewbuilder does not exist - using root[/HTML]

This output is in the manual, it says you should ignore it. It has something to do with building the kernel in a secure environment with PGP keys and stuff. It's nothing to be worried about.

drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
.config:381:warning: trying to assign nonexistent symbol IDEDMA_AUTO
.config:1215:warning: trying to assign nonexistent symbol RT2400PCI_DEBUG
.config:1217:warning: trying to assign nonexistent symbol RT2500PCI_DEBUG
.config:1219:warning: trying to assign nonexistent symbol RT61PCI_DEBUG
.config:1221:warning: trying to assign nonexistent symbol RT2500USB_DEBUG
.config:1223:warning: trying to assign nonexistent symbol RT73USB_DEBUG
.config:1252:warning: trying to assign nonexistent symbol NET_WIRELESS
.config:1253:warning: trying to assign nonexistent symbol NET_WIRELESS_RTNETLINK
.config:2875:warning: trying to assign nonexistent symbol TUX
.config:2876:warning: trying to assign nonexistent symbol TUX_EXTCGI
.config:2877:warning: trying to assign nonexistent symbol TUX_EXTENDED_LOG
.config:2878:warning: trying to assign nonexistent symbol TUX_DEBUG
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-PAE-debug.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(...ant than like upthere..)
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-PAE.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(and than like upthere again...)
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-debug.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(and than like upthere again...)
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686-xen.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
.config:381:warning: trying to assign nonexistent symbol IDEDMA_AUTO
.config:1215:warning: trying to assign nonexistent symbol RT2400PCI_DEBUG
.config:1217:warning: trying to assign nonexistent symbol RT2500PCI_DEBUG
.config:1219:warning: trying to assign nonexistent symbol RT61PCI_DEBUG
.config:1221:warning: trying to assign nonexistent symbol RT2500USB_DEBUG
.config:1223:warning: trying to assign nonexistent symbol RT73USB_DEBUG
.config:1252:warning: trying to assign nonexistent symbol NET_WIRELESS
.config:1253:warning: trying to assign nonexistent symbol NET_WIRELESS_RTNETLINK
.config:2875:warning: trying to assign nonexistent symbol TUX
.config:2876:warning: trying to assign nonexistent symbol TUX_EXTCGI
.config:2877:warning: trying to assign nonexistent symbol TUX_EXTENDED_LOG
.config:2878:warning: trying to assign nonexistent symbol TUX_DEBUG
.config:3343:warning: trying to assign nonexistent symbol XEN_PCIDEV_FRONTEND
.config:3344:warning: trying to assign nonexistent symbol XEN_PCIDEV_FE_DEBUG
.config:3345:warning: trying to assign nonexistent symbol XEN
.config:3346:warning: trying to assign nonexistent symbol XEN_INTERFACE_VERSION
.config:3347:warning: trying to assign nonexistent symbol XEN_PRIVILEGED_GUEST
.config:3348:warning: trying to assign nonexistent symbol XEN_UNPRIVILEGED_GUEST
.config:3349:warning: trying to assign nonexistent symbol XEN_PRIVCMD
.config:3350:warning: trying to assign nonexistent symbol XEN_XENBUS_DEV
.config:3351:warning: trying to assign nonexistent symbol XEN_BACKEND
.config:3352:warning: trying to assign nonexistent symbol XEN_BLKDEV_BACKEND
.config:3353:warning: trying to assign nonexistent symbol XEN_BLKDEV_TAP
.config:3354:warning: trying to assign nonexistent symbol XEN_NETDEV_BACKEND
.config:3355:warning: trying to assign nonexistent symbol XEN_NETDEV_PIPELINED_TRANSMITTER
.config:3356:warning: trying to assign nonexistent symbol XEN_NETDEV_LOOPBACK
.config:3357:warning: trying to assign nonexistent symbol XEN_PCIDEV_BACKEND
.config:3358:warning: trying to assign nonexistent symbol XEN_PCIDEV_BACKEND_VPCI
.config:3359:warning: trying to assign nonexistent symbol XEN_PCIDEV_BACKEND_PASS
.config:3360:warning: trying to assign nonexistent symbol XEN_PCIDEV_BE_DEBUG
.config:3361:warning: trying to assign nonexistent symbol XEN_TPMDEV_BACKEND
.config:3362:warning: trying to assign nonexistent symbol XEN_BLKDEV_FRONTEND
.config:3363:warning: trying to assign nonexistent symbol XEN_NETDEV_FRONTEND
.config:3364:warning: trying to assign nonexistent symbol XEN_FRAMEBUFFER
.config:3365:warning: trying to assign nonexistent symbol XEN_KEYBOARD
.config:3366:warning: trying to assign nonexistent symbol XEN_SCRUB_PAGES
.config:3367:warning: trying to assign nonexistent symbol XEN_DISABLE_SERIAL
.config:3368:warning: trying to assign nonexistent symbol XEN_SYSFS
.config:3369:warning: trying to assign nonexistent symbol XEN_COMPAT_030002_AND_LATER
.config:3370:warning: trying to assign nonexistent symbol XEN_COMPAT_LATEST_ONLY
.config:3371:warning: trying to assign nonexistent symbol XEN_COMPAT_030002
.config:3372:warning: trying to assign nonexistent symbol HAVE_ARCH_ALLOC_SKB
.config:3373:warning: trying to assign nonexistent symbol HAVE_ARCH_DEV_ALLOC_SKB
.config:3374:warning: trying to assign nonexistent symbol HAVE_IRQ_IGNORE_UNHANDLED
.config:3375:warning: trying to assign nonexistent symbol NO_IDLE_HZ
.config:3376:warning: trying to assign nonexistent symbol XEN_UTIL
.config:3377:warning: trying to assign nonexistent symbol XEN_BALLOON
.config:3378:warning: trying to assign nonexistent symbol XEN_DEVMEM
.config:3379:warning: trying to assign nonexistent symbol XEN_SKBUFF
.config:3380:warning: trying to assign nonexistent symbol XEN_REBOOT
.config:3381:warning: trying to assign nonexistent symbol XEN_SMPBOOT
.config:3383:warning: trying to assign nonexistent symbol X86_XEN
+ echo '# i386'
+ cat .config
+ for i in '*.config'
+ mv kernel-2.6.20-i686.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=i386
+ make ARCH=i386 nonint_oldconfig
drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'
.config:350:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO
(..and than like upthere again..)
+ echo '# i386'
+ cat .config
+ perl -p -i -e 's/^SUBLEVEL.*/SUBLEVEL = 20/' Makefile
+ perl -p -i -e 's/^EXTRAVERSION.*/EXTRAVERSION = -prep/' Makefile
+ find . '(' -name '*.orig' -o -name '*~' ')' -exec rm -f '{}' ';'
+ cd ..
+ '[' '!' -d sparse-0.2 ']'
+ cd /root/rpmbuild/BUILD
+ cd kernel-2.6.20
+ /usr/bin/bzip2 -dc /root/rpmbuild/SOURCES/sparse-0.2.tar.bz2
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0

I am not sure if I should go any further with it[/QUOTE]

.config:3383:warning: trying to assign nonexistent symbol X86_XEN

means that the old .config has the symbol that is not recognized in newer/older versions of the kernelbuild. It is a WARNING which means it's not an error. It's just something irregular that can be left away.

And for this:

drivers/net/fec_mpc52xx/Kconfig:14:warning: leading whitespace ignored
drivers/net/fec_mpc52xx/Kconfig:7:warning: 'select' used by config symbol 'FEC_MPC52xx' refer to undefined symbol 'PPC_BESTCOMM'

Everyone has those. I have them too, never had a problem. Besides the program that builds the kernel is really strict. If an error is encountered it shuts down properly. If your kernel builds, then there are no errors.

In other words, if the build doesn't break, then your kernel is build properly.

vratnica
2007-04-10, 01:29 PM CDT
ok
thank you very much for your feedback :)

now

it went very well till command

rpmbuild -bb --target=i686 /root/rpmbuild/SPECS/kernel-2.6.spec

and than i got (among other lines):



mkdir: `/var/tmp/kernel-2.6.20-1.3045-root-i686/lib/modules/2.6.20-1.3045PAE/kernel/sound/core/oss': Not a directory
cp: accessing `/var/tmp/kernel-2.6.20-1.3045-root-i686/lib/modules/2.6.20-1.3045PAE/kernel/sound/core/oss': Not a directory
mkdir: `/var/tmp/kernel-2.6.20-1.3045-root-i686/lib/modules/2.6.20-1.3045PAE/kernel/sound/core/seq/instr': Not a directory

and similar

now i dont know if that was an error that I downloaded kernel to mkdir that
is in home folder, but i have copied it to /root/ and there used.

at the end I had:

/bin/sh: line 1: 21669 Segmentation fault /sbin/depmod -ae -F System.map -b /var/tmp/kernel-2.6.20-1.3045-root-i686 -r 2.6.20-1.3045PAE
make: *** [_modinst_post] Error 139
error: Bad exit status from /var/tmp/rpm-tmp.65342 (%build)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.65342 (%build)

vratnica
2007-04-10, 01:57 PM CDT
in second attempt I found also:

RPM build errors:RPM build errors:RPM build errors:
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/vmlinuz-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/System.map-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/config-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/vmlinuz-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/System.map-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/config-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/vmlinuz-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/System.map-2.6.20-1.3045
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/boot/config-2.6.20-1.3045

an so on

and

File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/usr/lib/debug/usr/src/kernels
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/usr/src/kernels/2.6.20-1.3045-i686
File not found: /var/tmp/kernel-2.6.20-1.3045-root-i686/lib/modules/2.6.20-1.3045PAE/extra

etc.

sideways
2007-04-10, 05:08 PM CDT
Follow all the steps here (http://forums.fedoraforum.org/showpost.php?p=769367&postcount=40)

It's basically a summary of this thread.

alpha645
2007-04-11, 07:30 AM CDT
Check this:

mkdir: cannot create directory `/var/tmp/kernel-2.6.20-1.3045-root-i686/lib/modules/2.6.20-1.3045PAE/kernel/net/wanrouter': No space left on device

Means you are probably running out of space. Depending on your kernelsize you need approx 500 to 1000 MB to compile it. It also seems that you did not disable PAE (unless you want that). There are more kernel-flavours, I recommend you turn those off (Like XEN, KDUMP, PAE, DBUG etc). It's all in the manual :) .

high
2007-04-16, 01:12 PM CDT
Was there a post on how to append custom patches such as 16K stacks or HDAPS?

RVF16
2007-08-12, 11:59 AM CDT
Hallo to all.

I attempted to build a 'kernel-2.6.20-1.2962.fc6.i686.rpm' configured for dazuko.
Dazuko needs Default Security Capabilities Module separately compiled so i named my kernel 'kernel-2.6.20-1.2962.SCDSCM.fc6.i686.rpm' and the only changes i did in .spec and .config files are :

in the 'kernel-2.6.20-i686.config' file :

#CONFIG_SMP is not set (instead of CONFIG_SMP=y)
#CONFIG_CRASH_DUMP is not set (instead of #CONFIG_CRASH_DUMP=y)
CONFIG_SECURITY_CAPABILITIES=m (instead of CONFIG_SECURITY_CAPABILITIES=y)

and in the 'kernel-2.6.spec' file :

# standard kernel
%define with_up 1
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp 0
# kernel-PAE (only valid for i686)
%define with_pae 0
# kernel-xen
%define with_xen 0
# kernel-kdump
%define with_kdump 0
# kernel-debug
%define with_debug 0
# kernel-doc
%define with_doc 0
# kernel-headers
%define with_headers 1

%define release %(R="$Revision: 1.2962.SCDSCM.fc6 $"; RR="${R##: }"; echo ${RR%%?})%{?dist}%{?buildid}

%ifarch i686
%define with_pae 0
%define _enable_debug_packages 0
# we build always xen i686 HV with pae
%define xen_flags verbose=y crash_debug=y pae=y
%endif

%changelog
* Tue Aug 7 2007 RVF16 <x@x.x> 1.2962.SCDSCM
- Seperately Compiled Default Security Capabilities Module

The kernel and kernel-devel were compiled with several warnings but no errors.
Neither 'kernel-2.6.20-1.2962.SCDSCM.fc6.src.rpm' nor 'kernel-headers-2.6.20-1.2962.SCDSCM.fc6.i686.rpm' were created.
How do i enable the creation of those?
I know that practically the src.rpm contains and creates the directories and files that i used to build my kernel but why wasn't it created? How do i transform those directories in a src.rpm file?
Under what circumstances are the headers needed since there can be many kernels installed in a system but only one kernel-header?

Two problems appeared at boot time :
avahi deamon failed
hal deamon failed

Does anyone know what could cause such errors?

Finally if, after booting with my new kernel, i install the nVidia drivers will this conflict with the installation of nVidia drivers for the standard kernel-2.6.20-1.2962.fc6.i686.rpm which of course has not been removed from the system?

Thank you in advance.

alpha645
2007-08-12, 12:58 PM CDT
Hallo to all.

I attempted to build a 'kernel-2.6.20-1.2962.fc6.i686.rpm' configured for dazuko.
Dazuko needs Default Security Capabilities Module separately compiled so i named my kernel 'kernel-2.6.20-1.2962.SCDSCM.fc6.i686.rpm' and the only changes i did in .spec and .config files are :

in the 'kernel-2.6.20-i686.config' file :

#CONFIG_SMP is not set (instead of CONFIG_SMP=y)
#CONFIG_CRASH_DUMP is not set (instead of #CONFIG_CRASH_DUMP=y)
CONFIG_SECURITY_CAPABILITIES=m (instead of CONFIG_SECURITY_CAPABILITIES=y)

and in the 'kernel-2.6.spec' file :

# standard kernel
%define with_up 1
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp 0
# kernel-PAE (only valid for i686)
%define with_pae 0
# kernel-xen
%define with_xen 0
# kernel-kdump
%define with_kdump 0
# kernel-debug
%define with_debug 0
# kernel-doc
%define with_doc 0
# kernel-headers
%define with_headers 1

%define release %(R="$Revision: 1.2962.SCDSCM.fc6 $"; RR="${R##: }"; echo ${RR%%?})%{?dist}%{?buildid}

%ifarch i686
%define with_pae 0
%define _enable_debug_packages 0
# we build always xen i686 HV with pae
%define xen_flags verbose=y crash_debug=y pae=y
%endif

%changelog
* Tue Aug 7 2007 RVF16 <x@x.x> 1.2962.SCDSCM
- Seperately Compiled Default Security Capabilities Module

The kernel and kernel-devel were compiled with several warnings but no errors.
Neither 'kernel-2.6.20-1.2962.SCDSCM.fc6.src.rpm' nor 'kernel-headers-2.6.20-1.2962.SCDSCM.fc6.i686.rpm' were created.
How do i enable the creation of those?
I know that practically the src.rpm contains and creates the directories and files that i used to build my kernel but why wasn't it created? How do i transform those directories in a src.rpm file?
Under what circumstances are the headers needed since there can be many kernels installed in a system but only one kernel-header?

Two problems appeared at boot time :
avahi deamon failed
hal deamon failed

Does anyone know what could cause such errors?

Finally if, after booting with my new kernel, i install the nVidia drivers will this conflict with the installation of nVidia drivers for the standard kernel-2.6.20-1.2962.fc6.i686.rpm which of course has not been removed from the system?

Thank you in advance.

I get the feeling you manually edited the .config file. I really recommend that you use a make menuconfig or whatever.

Can you please tell me why you want to build a source by compiling another source?

The output should be:

kernel-2.6.20-1.2962.SCDSCM.fc6.rpm
kernel-devel-2.6.20-1.2962.SCDSCM.fc6.rpm

That is the output what you want (because the first one is the actually kernel). And the other one is the development package (for building other modules (not required for nvidia I think)).

About your header question, that is a good one. You only need new headers if you upgrade or change architecture. The i386, i486, i586, i686 headers are identical (that is also stated in the .spec file if I remember correctly). So that should be no problem.

About the failing daemons, I can't help you (dmesg maybe ?)

For the nvidia, do not install the nvidia from livna (different kernel and all). The nvidia installer has an option to ONLY install the kernel module. And that is what you are looking for. Because you only have the driver but don't have the module since you have a new kernel. So you only need to build a new nvidia module (there is a switch for that in the installer).

Good questions, I'm going to update the howto right now anyway :D

RVF16
2007-08-12, 02:35 PM CDT
Thanks for that lightspeed fast reply alpha645.

I actually followed your directions to the letter except for the 'rpmbuild' directory. I used another one in the echo command :
echo '%_topdir /SRCtoRPM' >> .rpmmacros (instead of echo '%_topdir /root/rpmbuild' >> .rpmmacros)
I did use the make menuconfig in section '2.Configuration' of your directions and saved the configuration to an alternate file. Later in section 3'.Compilation' i mixed the two configs as directed. Well i'll do it once more just in case i did something i am not aware. I 'll soon post the 'dmesg' of the problematic boot.

For the src.rpm file matter i just thought in case i wanted to use the existing .config and .spec files in probable future changes of the kernel without changing the dazuko requirement why should i install the standard src.rpm file, make all the previously done changes for dazuko AGAIN and then do the new changes. Ok maybe i am exaggerating.

For the headers question what do you mean by saying 'You only need new headers if you upgrade or change architecture'?
Every time a new kernel comes out new headers come out too. Do you mean kernel upgrade? I know the headers are all .i386.rpm files so they should obviously work for all arch>=i386. Are the latest kernel headers valid for all previous kernels?

In the nVidia 'readme' file in the FAQ section i had spoted this one :
Q. I just upgraded my kernel, and now the NVIDIA kernel module will not load. What is wrong?
A. The kernel interface layer of the NVIDIA kernel module must be compiled specifically for the configuration and version of your kernel. If you upgrade your kernel, then the simplest solution is to reinstall the driver.
ADVANCED: You can install the NVIDIA kernel module for a non running kernel (for example: in the situation where you just built and installed a new kernel, but have not rebooted yet) with a command line such as this:
# sh NVIDIA-Linux-x86-1.0-9639-pkg1.run --kernel-name='KERNEL_NAME'
Where 'KERNEL_NAME' is what 'uname -r' would report if the target kernel were running.

I suppose this is what you mean. I just wasn't sure if this action would interfere with the standard kernel nVidia configuration.

Regards.

alpha645
2007-08-12, 02:56 PM CDT
Thanks for that lightspeed fast reply alpha645.

I actually followed your directions to the letter except for the 'rpmbuild' directory. I used another one in the echo command :
echo '%_topdir /SRCtoRPM' >> .rpmmacros (instead of echo '%_topdir /root/rpmbuild' >> .rpmmacros)
I did use the make menuconfig in section '2.Configuration' of your directions and saved the configuration to an alternate file. Later in section 3'.Compilation' i mixed the two configs as directed. Well i'll do it once more just in case i did something i am not aware. I 'll soon post the 'dmesg' of the problematic boot.


For the src.rpm file matter i just thought in case i wanted to use the existing .config and .spec files in probable future changes of the kernel without changing the dazuko requirement why should i install the standard src.rpm file, make all the previously done changes for dazuko AGAIN and then do the new changes. Ok maybe i am exaggerating.

I' m not really getting you. Using old .configs and old .specs for newer kernels is suicide :)

For the headers question what do you mean by saying 'You only need new headers if you upgrade or change architecture'?
Every time a new kernel comes out new headers come out too. Do you mean kernel upgrade? I know the headers are all .i386.rpm files so they should obviously work for all arch>=i386. Are the latest kernel headers valid for all previous kernels?

Yes, with an upgrade I mean an kernel upgrade. The i386 kernel headers work for i686. Even if you build new headers, they are exactly the same. So don' t worry about the headers, just let yum handle those.

In the nVidia 'readme' file in the FAQ section i had spoted this one :
Q. I just upgraded my kernel, and now the NVIDIA kernel module will not load. What is wrong?
A. The kernel interface layer of the NVIDIA kernel module must be compiled specifically for the configuration and version of your kernel. If you upgrade your kernel, then the simplest solution is to reinstall the driver.
ADVANCED: You can install the NVIDIA kernel module for a non running kernel (for example: in the situation where you just built and installed a new kernel, but have not rebooted yet) with a command line such as this:
# sh NVIDIA-Linux-x86-1.0-9639-pkg1.run --kernel-name='KERNEL_NAME'
Where 'KERNEL_NAME' is what 'uname -r' would report if the target kernel were running.

I suppose this is what you mean. I just wasn't sure if this action would interfere with the standard kernel nVidia configuration.

Regards.

No, that is not the option I meant. It should do the trick. But will still overwrite the driver. I think it's the best option you have got. You can view the installers option by doing:

NVIDIA-Linux-x86-1.0-9639-pkg1.run -h

And the option for KERNEL MODULE ONLY will be showed under advanced options. I thought that was

NVIDIA-Linux-x86-1.0-9639-pkg1.run -A

Good luck :)

RVF16
2007-08-12, 03:59 PM CDT
I understand your concern on using old .config and .spec files. I should have pointed out that i was referring to compilations done under same kernel. Its totally logical, if you upgrade or downgrade to a different standard kernel, standard configuration files will change and the personal ones created upon the old ones of the old kernel would be useless. Its just that some people stick with a stable system setup for sometime without changing kernels and for them i think this would speed things up a bit.

The command 'sh NVIDIA-Linux-x86-1.0-9639-pkg1.run --advanced-options' returns many options including these :
(everyone reading this notice the difference -K, -k)

-K, --kernel-module-only
Install a kernel module only, and do not uninstall the
existing driver. This is intended to be used to install
kernel modules for additional kernels (in cases where you
might boot between several different kernels). To use this
option, you must already have a driver installed, and the
version of the installed driver must match the version of
this kernel module.

-k, --kernel-name=KERNEL-NAME
Build and install the NVIDIA kernel module for the
non-running kernel specified by KERNEL-NAME (KERNEL-NAME
should be the output of `uname -r` when the target kernel
is actually running). This option implies
'--no-precompiled-interface'. If the options
'--kernel-install-path' and '--kernel-source-path' are not
given, then they will be inferred from KERNEL-NAME; eg:
'/lib/modules/KERNEL-NAME/kernel/drivers/video/' and
'/lib/modules/KERNEL-NAME/build/', respectively.

I suppose you mean the first one as :

-n, --no-precompiled-interface
Disable use of precompiled kernel interfaces.

is implied in -k option and from what i understand erases former kernel modules exactly as you have mentioned.

From what i understand i'll have to boot into the new kernel and then run :
NVIDIA-Linux-x86-1.0-9639-pkg1.run -K

alpha645
2007-08-12, 11:26 PM CDT
I understand your concern on using old .config and .spec files. I should have pointed out that i was referring to compilations done under same kernel. Its totally logical, if you upgrade or downgrade to a different standard kernel, standard configuration files will change and the personal ones created upon the old ones of the old kernel would be useless. Its just that some people stick with a stable system setup for sometime without changing kernels and for them i think this would speed things up a bit.

The command 'sh NVIDIA-Linux-x86-1.0-9639-pkg1.run --advanced-options' returns many options including these :
(everyone reading this notice the difference -K, -k)

-K, --kernel-module-only
Install a kernel module only, and do not uninstall the
existing driver. This is intended to be used to install
kernel modules for additional kernels (in cases where you
might boot between several different kernels). To use this
option, you must already have a driver installed, and the
version of the installed driver must match the version of
this kernel module.

-k, --kernel-name=KERNEL-NAME
Build and install the NVIDIA kernel module for the
non-running kernel specified by KERNEL-NAME (KERNEL-NAME
should be the output of `uname -r` when the target kernel
is actually running). This option implies
'--no-precompiled-interface'. If the options
'--kernel-install-path' and '--kernel-source-path' are not
given, then they will be inferred from KERNEL-NAME; eg:
'/lib/modules/KERNEL-NAME/kernel/drivers/video/' and
'/lib/modules/KERNEL-NAME/build/', respectively.

I suppose you mean the first one as :

-n, --no-precompiled-interface
Disable use of precompiled kernel interfaces.

is implied in -k option and from what i understand erases former kernel modules exactly as you have mentioned.

From what i understand i'll have to boot into the new kernel and then run :
NVIDIA-Linux-x86-1.0-9639-pkg1.run -K

Yes, you can run NVIDIA-Linux-x86-1.0-9639-pkg1.run -K in the new kernel. But you could also use the -k option. Because booting in the new kernel means switching to init 3, building the module and then switch back to init 5. If you do it now with a running kernel and compile it for another kernel. Then you can boot back into that kernel directly without the X-server crashing.

RVF16
2007-08-13, 12:51 PM CDT
Hallo alpha645.
As kernel-2.6.22.1-32 was released i installed it, removed previous one and attempted to compile my kernel.
I noticed your guide has changed a bit especially in the editing of the .config file. I followed the new directions.

Anyway for the first time i received errors :
mm/mprotect.c:206: error: implicit declaration of function 'arch_remove_exec_range'
make[1]: *** [mm/mprotect.o] Error 1
make: *** [mm] Error 2

Do you know what this is?
Thank you.

RVF16
2007-08-14, 07:00 PM CDT
I am posting the /var/log/messages part for kernel-2.6.20-1.2962.SCDSCM.fc6.rpm which has problems with 'avahi deamon' and ''hal deamon' :

Aug 15 02:57:39 localhost ntpd[2316]: cap_set_proc() failed to drop root privileges: Operation not permitted
Aug 15 02:57:41 localhost avahi-daemon[2440]: cap_set_proc() failed: Operation not permitted
Aug 15 02:58:01 localhost kernel: audit(1187135881.444:4): avc: denied { use } for pid=2450 comm="hald" name="0" dev=devpts ino=2 scontext=system_u:system_r:hald_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=fd
Aug 15 02:58:01 localhost kernel: audit(1187135881.444:5): avc: denied { use } for pid=2450 comm="hald" name="0" dev=devpts ino=2 scontext=system_u:system_r:hald_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=fd
Aug 15 02:58:01 localhost kernel: audit(1187135881.444:6): avc: denied { use } for pid=2450 comm="hald" name="0" dev=devpts ino=2 scontext=system_u:system_r:hald_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=fd

RVF16
2007-08-16, 01:57 PM CDT
Hi.

The problem posted before in post #57:
mm/mprotect.c:206: error: implicit declaration of function 'arch_remove_exec_range'
make[1]: *** [mm/mprotect.o] Error 1
make: *** [mm] Error 2
when compiling a custom kernel-2.6.22.1-32 keeps on appearing if i attempt to 'make menuconfig' and change something in kernel-2.6.22.1-i686.config.

This does not happen with kernel-2.6.20-1.2962.
For 2.6.22.1-32 if i execute :
rpmbuild --target i686 -bb ~/rpmbuild/SPECS/kernel-2.6.spec
without changing anything but the security_capabilities=m by hand with editor (which i know is wrong), no problems appear during the creation of the new kernel rpm.
I have tried all variations found in Fedora Forums and google for kernel compilation without success.
Does anyone know what could be the cause of this?

Thank you

alpha645
2007-08-16, 03:07 PM CDT
Hi.

The problem posted before in post #57:
mm/mprotect.c:206: error: implicit declaration of function 'arch_remove_exec_range'
make[1]: *** [mm/mprotect.o] Error 1
make: *** [mm] Error 2
when compiling a custom kernel-2.6.22.1-32 keeps on appearing if i attempt to 'make menuconfig' and change something in kernel-2.6.22.1-i686.config.

This does not happen with kernel-2.6.20-1.2962.
For 2.6.22.1-32 if i execute :
rpmbuild --target i686 -bb ~/rpmbuild/SPECS/kernel-2.6.spec
without changing anything but the security_capabilities=m by hand with editor (which i know is wrong), no problems appear during the creation of the new kernel rpm.
I have tried all variations found in Fedora Forums and google for kernel compilation without success.
Does anyone know what could be the cause of this?

Thank you

1. Disable key retention if you probably don't need it
2. Make NSA Selinux module as well
3.
- Remove NSA Selinux
- Remote Default Linux Capabilities (definitly not recommended)

If those doesn't work, cross your fingers and wait for improvements in kernel 2.6.23 or downgrade to an older kernel for the time being. I'm having problems with ACPI as well with the kernels in Fedora 7. But the rawhide kernel (2.6.23) is showing a huge improvement.

RVF16
2007-08-16, 04:38 PM CDT
Thanks, will try.

adrian_acosta
2007-08-17, 05:23 PM CDT
HI THERE, I SAW THAT MANY OF YOU ARE GOOD USERS OF FEDORA, HELP ME PLEASE WITH A STUPID PROBLEM!! , I POST IT HERE: http://forums.fedoraforum.org/showthread.php?t=141782&page=4&pp=15


THANKS

RVF16
2007-08-19, 01:04 PM CDT
adrian_acosta i don't seem to be able to locate your post.
Is that address correct?

eliashickman
2007-12-29, 07:57 PM CST
I looked through the main post and the Fedora Wiki and read post #42 (very helpful) but still get the warning that the rpm version that I am trying to install (my custom) is older than the one installed.
I am using Fedora 8 and here is the line in the kernel.conf that I edited
%define fedora_build %(R="$Revision: 1.294.test $"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})

The .test part above was added so as not to confuse the two kernels. I am going to try rpm --force only AFTER I have another stable version downloaded to a safe place.
Any suggestions on what I am doing wrong??

alpha645
2007-12-30, 04:04 AM CST
I don't know the versioning system quite well, but it seems that a kernel with something behind it is treated as older. You could try to make it one small version higher:

%define fedora_build %(R="$Revision: 1.295 $"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})

eliashickman
2007-12-31, 11:28 PM CST
Thanks. I am now actually having trouble with it mounting my root partition. I manually configured my partitions in HAL because I have so many and now I think I need to replace (temporarily) my /etc/fstab file with one that has absolute paths. Advise......

alpha645
2008-01-01, 01:31 AM CST
What kind of problems? Do you get kernel panics?

eliashickman
2008-01-01, 09:43 AM CST
No I didn't get any kernel panics...I got ...switchroot: mount failed: No such file or directory, booting has failed...setuproot. Basically I edited grub.conf to look like this:

title Fedora (2.6.23.9-.custom.fc8)
root (hd0,2)
kernel /boot/vmlinuz-2.6.23.9-.custom.fc8
# kernel /boot/vmlinuz-2.6.23.9-.custom.fc8 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.23.9-.custom.fc8.img


I am a little worried though. I wasn't sure of the implications of such but I should, I think, just define the root partition as being /dev/sda3 (which it is)
I'm a little tired right now. I'm in Seoul, Korea and it's 2 a.m. I will change the line to

title Fedora (2.6.23.9-.custom.fc8)
root (hd0,2)
kernel /boot/vmlinuz-2.6.23.9-.custom.fc8 ro root=/dev/hda3 rhgb quiet

Thanks for helping out. As a gift, and really everyone should know about this site, you should check out www.ted.com, if you haven't already. Really deep thinkers speak on various issues (esp. technology).

********************************

Here is what my kernel.spec line will look like when I start to compile

%define fedora_build %(R="$Revision: 1.295 $"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})


Can I add %define fedora_build %(R="$Revision: 1.295.kexec $"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})
or would this come up as still an older kernel?

eliashickman
2008-01-01, 09:48 AM CST
Ohhh! Now I understand what you meant in the penultimate reply. You know I wiped that tree but thankfully (those nerons still rubbing together) I save my .config. I am going to quickly to and install everything and recompile my kernel. Hey I should ask additionally.
If say for instance I compile "kdump" with "kexec" support Can I truly have two kernels running parallel? For instance one in a vt or even xterm window?? Do you think it would be even possible to try and boot some of the osx86 images that I have?? Just to test them out. That would be incredible.

alpha645
2008-01-01, 11:01 AM CST
Ohhh! Now I understand what you meant in the penultimate reply. You know I wiped that tree but thankfully (those nerons still rubbing together) I save my .config. I am going to quickly to and install everything and recompile my kernel. Hey I should ask additionally.
If say for instance I compile "kdump" with "kexec" support Can I truly have two kernels running parallel? For instance one in a vt or even xterm window?? Do you think it would be even possible to try and boot some of the osx86 images that I have?? Just to test them out. That would be incredible.

*Could* be possible for as far as I understand kexec (could be not). However, I do not know anything about this. For quick virtualisation, use qemu :) . And btw, that kernel error could be caused by:

- By leaving out: ro root=LABEL=/ rhgb quiet
- If you have sata disks you should enable SCSI disk support (don't ask me why)

Good luck

gregfjohnson
2008-01-12, 10:28 PM CST
The Custom Build fedora wiki was very helpful. I was able to follow the instructions
and successfully build an i586 kernel. Thanks!

I am running on an AMD Geode LX, and would like to build a kernel specific to that,
in particular with the CONFIG_FB_GEODE and/or CONFIG_FB_GEODE_LX
frame buffer driver.

There are a few tantalizing things, such as config-geode files. It looks like work has
been done in this area.

But, it wasn't obvious to me how to build the Fedora Core 8 kernel using config-geode.

I don't see 'geode' anywhere in the kernel.spec file, and I don't see it in the
Makefile.config in SOURCES.

I tried doing the rpmbuild with target=geode, but that didn't seem to work. Do I just
need to edit the .config file and put '# geode' as the first line? Then, what would the
rpmbuild line look like? This?

rpmbuild -bb --with baseonly --without debuginfo --target=geode kernel.spec

It seems like that didn't work, but I might have done something else wrong.

Do I need to add a line "Source 93 config-geode" to kernel.spec? Add anything else?

Thanks,

Greg

alpha645
2008-01-13, 01:36 AM CST
I checked the packages and there are no config-geode files. I think you mean CONFIG_GEODE. Assuming you build the kernel using make menuconfig right? Then you need to enable certain options for your Geode motherboard. The options I found for Geode are:

AMD Geode HW Random Number Generator support: (already enabled by stock driver)
CONFIG_HW_RANDOM_GEODE: Randomisation support (Device drivers -> Character devices)

AMD Geode family framebuffer support (EXPERIMENTAL): (not enabled by default)
CONFIG_FB_GEODE: Framebuffer for Geode mobo family (Device drivers -> Graphics support)
These appear if you enable the one above:
CONFIG_FB_GEODE_LX
CONFIG_FB_GEODE_GX
CONFIG_FB_GEODE_GX1

Geode ACCESS.bus support: (not enabled by default)
CONFIG_SCx200_ACB: I-square-c support for CERTAIN Geode motherboards..

Enable these options and you have a kernel with support for Geode motherboard. However, for the framebuffer to work. You sometimes have to use kernel-parameters to use it.

gregfjohnson
2008-01-13, 09:51 AM CST
Thanks - blew everything away, followed the instructions in http://fedoraproject.org/wiki/Docs/CustomKernel again,
and redid everything, and there were no config-geode files. They may have been created as a side effect of the
way I tried to do it previously.

I made the changes to .config to enable CONFIG_MGEODE_LX and the other changes, and followed the
recipe from CustomKernel again, but found that somehow the build process over-wrote the .config file and
CONFIG_MGEODE_LX was no longer enabled in the .config file.

I will try again, using the post at the beginning of this thread as a guideline.

Greg

gregfjohnson
2008-01-13, 04:18 PM CST
Not sure where else to ask this - the kernel make uses the '-j3' option, running three parallel compiles at a time.
This appears to come from 'smp_mflags' in kernel.spec. Is there a clean/sanctioned way to get rid of this option
and only do one make at a time? I'm doing the kernel build on a small 500mhz uniprocessor AMD Geode box,
and it seems to be thrashing somewhat. I'd like to try timing a kernel build with and without the -j3 option.

Thanks in advance,

Greg

alpha645
2008-01-13, 11:25 PM CST
Not sure where else to ask this - the kernel make uses the '-j3' option, running three parallel compiles at a time.
This appears to come from 'smp_mflags' in kernel.spec. Is there a clean/sanctioned way to get rid of this option
and only do one make at a time? I'm doing the kernel build on a small 500mhz uniprocessor AMD Geode box,
and it seems to be thrashing somewhat. I'd like to try timing a kernel build with and without the -j3 option.

Thanks in advance,

Greg

Yes, I think that it's possible. Open rpmbuild/SPECS/kernel.spec and search for:

%{?_smp_mflags}

Delete those :) .

sideways
2008-01-30, 08:39 AM CST
The "official" instructions at http://fedoraproject.org/wiki/Docs/CustomKernel now work fine (finally!) (ignore the bit about patches if you're just doing a regular recompile)

To get a kernel*.rpm and kernel-devel*.rpm you just type (as the final step):

rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` kernel.spec

(also, note that for a i686 build you add '# i386' to the top of the .config file NOT 'i686')

FriedChips
2008-01-30, 08:47 AM CST
Good info, thanks sideways!

alpha645
2008-01-30, 08:52 AM CST
The "official" instructions at http://fedoraproject.org/wiki/Docs/CustomKernel now work fine (finally!) (ignore the bit about patches if you're just doing a regular recompile)

To get a kernel*.rpm and kernel-devel*.rpm you just type (as the final step):

rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` kernel.spec

(also, note that for a i686 build you add '# i386' to the top of the .config file NOT 'i686')

Using the command line is also an option. In this guide people define what they want through the kernel.spec file. But I was wondering which kernel you are building (and which guide you use). I don't need to add # i386 anymore to the top of my config file.

Good info, thanks sideways!

I get the feeling that this guide is missing something :p . Is that right? (Can u help me improve it?)

sideways
2008-01-30, 09:12 AM CST
I'm compiling for i686 mostly.

It's a great guide alpha645, but I think we all agree that kernel compiling shouldn't be as convoluted as it has seemed with Fedora. After a lengthy bugzilla discussion the "official" page was updated and the kernel.spec file modified to add macros to help the build process.

:)

alpha645
2008-01-30, 09:16 AM CST
It's a great guide alpha645

Thanks :D .

but I think we all agree that kernel compiling shouldn't be as convoluted as it has seemed with Fedora. After a lengthy bugzilla discussion the "official" page was updated and the kernel.spec file modified to add macros to help the build process.

Agree, I think it should be easier. However, if you build the vanilla kernel then you have to:

- Manually manage the development files
- Manually manage the header files
- Make init image yourself
- And no optimisations (as far as I know)

RVF16
2008-01-31, 12:16 PM CST
Hello to all.

I have spent many hours trying to figure out the best way to load the dazuko module which is essential for real time (on access) virus scanning.

Dazuko module can be compiled normally or with --enable-syscalls option.

When compiled normally it needs a kernel with "security capabilities" compiled as module (M). Dazuko in this case compiles and runs errorless but during system boot "avahi" and "hal" fail as if they depend on the "security capabilities" not to be compiled as module but in the kernel.

With the syscalls option dazuko compiles errorless but fails to be loaded :
modprobe dazuko
access denied
I think the fedora kernel for security reasons doesn't allow modules to be run via syscalls.

So i usually compile from Linux.org the latest kernel with "security capabilities" compiled in the kernel (y) and dazuko with syscalls option. This way everything works but now i am missing many drivers (mainly for wireless devices) the fedora kernel includes and the linux.org doesn't, not to say extra security features.

Is there a way of compiling fedora kernel with "security capabilities" as a module and not mess "avahi" and "hal"?
Can anyone think of any other approach to this matter?

Thank you in advance.
Regards.

alpha645
2008-01-31, 12:24 PM CST
I think that you could use the linux kernel. You need to remove the patch that blocks dazuko. My first guess would be:

ApplyPatch linux-2.6-unexport-symbols.patch

Remove it, and then recompile the dazuko kernel module with syscalls (I think you wanted that right?) and the security capabilities as module :D .

FriedChips
2008-01-31, 12:34 PM CST
I get the feeling that this guide is missing something :p . Is that right? (Can u help me improve it?)

Actually your guide works great for me. I have tried that other guide before and ran into problems, still having problems with it. I don't need to do any patching.... Yet :cool:

I compiled my first Fedora kernel with your guide, and there will be many more to come. Just looking to strip down the unecessary stuff, and this guide works perfectly for that. The spec file part could use a bit more explanation and maybe I can make some suggestions after I get a little more comfortable with it myself. THANKS FOR THE GREAT GUIDE!!!

RVF16
2008-01-31, 12:40 PM CST
Thanks for the reply alpha645.

As stated before i do use the linux.org kernel and compile dazuko with syscalls. Everything works but the linux.org lacks of drivers and security features the fedora one includes.

Is there a way of creating a mix of linux.org and fedora kernels. Can i somehow insert the fedora one drivers on the linux.org one?

alpha645
2008-01-31, 01:01 PM CST
Thanks for the reply alpha645.

As stated before i do use the linux.org kernel and compile dazuko with syscalls. Everything works but the linux.org lacks of drivers and security features the fedora one includes.

Is there a way of creating a mix of linux.org and fedora kernels. Can i somehow insert the fedora one drivers on the linux.org one?

Well, I gave you the option to remove the limitation of the Fedora kernel because patching the stock kernel with Fedora is a lot more work. You could try it though. The wireless patches are in

%buildroot%/BUILD/*.patch

The function of the patches are described at:

%buildroot%SPECS/kernel.spec

Rip out the patches u want and apply them to the linux.org kernel. Remember to use the EXACT SAME KERNEL VERSION!!!

RVF16
2008-01-31, 01:14 PM CST
Ok i will try both and see.
Thank you very much.

alpha645
2008-01-31, 01:21 PM CST
Ok i will try both and see.
Thank you very much.

Start with mine. It's faster to remove a single patch from the kernel.spec rather than grabbing the wireless patches and apply them to the vanilla kernel. Ow btw, did you know that you can disable all patches in kernel.spec with the vanilla option?

RVF16
2008-02-01, 09:33 AM CST
Hello alpha645

I compiled the latest fedora f8 kernel (kernel-2.6.23.14-107.fc8.i686.src.rpm) after editing the kernel.spec file accordingly :

# Remove kernel-internal functionality that nothing external should use.
#ApplyPatch linux-2.6-unexport-symbols.patch

(i commented the second line above as seen so that it wouldn't be executed)

Unfortunately the system still doesn't allow dazuko to be loaded via syscalls :
FATAL: Error inserting dazuko (/lib/modules/2.6.23.14-107.RVF16.f8.i686/extra/dazuko.ko): Operation not permitted

Is there any other patch line in the kernel.spec that could be responsible for the denial of loading modules via syscalls?

Thank you.

alpha645
2008-02-01, 01:53 PM CST
Yes, you will find the source inside the buildstructure. That is the exact same source from kernel.org (I think). You could check it by downloading the vanilla source + patch and compore that with the source + patch from the Fedora srpm with md5sum. You could also try to remove ALL the patches to see whether it works or not.

RVF16
2008-02-01, 03:19 PM CST
I am sorry i am lost a bit.

When unziped the linux.org kernel "linux-2.6.23.14.tar.bz2" provides the folllowing directory :
linux-2.6.23.14 (source directory)
When installed the fedora f8 "kernel-2.6.23.14-107.fc8.i686.src.rpm" provides the following directories :
BUILD
--kernel-2.6.23
----linux-2.6.23.i686 (source directory)
----vanilla (source directory identical to the one from the linux.org kernel)
RPMS
SOURCES
SPECS
SRPMS

Which files in which directories should i compare?

RVF16
2008-02-02, 02:41 AM CST
I have found in the dazuko -Support a relevant post :

"i guess there's somewhat changed with syscalls in kernel 2.6.22 , so it's no longer allowed or possible to do these syscall hooks"
"somewhere i read syscalls are somewhat different protected in 2.6.22 than in kernels before (or at least since 2.6.22.x if not already in 2.6.22 vanilla kernel)"
"2.6.21 "worked" with syscall-hooking"

If so does anyone know what was changed in 2.6.22 kernel security that could be the reason for this limitation?

alpha645
2008-02-02, 10:35 AM CST
I have found in the dazuko -Support a relevant post :

"i guess there's somewhat changed with syscalls in kernel 2.6.22 , so it's no longer allowed or possible to do these syscall hooks"
"somewhere i read syscalls are somewhat different protected in 2.6.22 than in kernels before (or at least since 2.6.22.x if not already in 2.6.22 vanilla kernel)"
"2.6.21 "worked" with syscall-hooking"

If so does anyone know what was changed in 2.6.22 kernel security that could be the reason for this limitation?

All the files that rpmbuild uses to create the rpms are located in:

%buildroot%/SOURCES/

This includes the kernel and patches.

All the spec file is included in

%buildroot%/SPECS/

I already checked the stock kernel and the vanilla kernel and they are an exact match :D . Want to know how?

Download current stock kernel and compress all files (without structure):

mkdir test
cd test
yum -y install yum-utils # If you didn't do so
yumdownloader --source kernel && rpm2cpio * | cpio -idmv

Create a seperate dir and remove kernel+patch into that dir

mkdir fedora-kernel
mv *bz2 fedora-kernel
rm -f *

Download the same version vanilla kernel:

mkdir vanilla-kernel
cd vanilla-kernel
wget ftp://ftp.eu.kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2 && wget ftp://ftp.eu.kernel.org/pub/linux/kernel/v2.6/patch-2.6.23.14.bz2
cd ..

Now time for a comparison :D :

# kernel
md5sum fedora-kernel/linux* stock-kernel/linux*

(You should see that the hashes are an exact match)

# patches
md5sum fedora-kernel/patches* stock-kernel/patches*

(You should see that the hashes are an exact match)

Clean up the mess

cd ..
rm -rf test

If you want to build the fedora kernel without patches, then you should edit kernel.spec:

%define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 0}

set to:

%define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 1}

What you also could do, is just remove all the patches except for the driver patches you wanted. Those are listed below, search for the ApplyPatch function and that should guide for itself.

RVF16
2008-02-02, 10:40 AM CST
Thanks a lot.
I'll give it a try.

RVF16
2008-02-10, 04:39 AM CST
Well i tried building the vanilla kernel (fedora without patches) by editing in the fedora kernel.spec file the line :
%define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 1}

That didn't work either. System forbids loading dazuko.ko module via syscalls so it must be something hardcored to the fedora kernel.

So i'll have to try applying fedora patches to the linux.org kernel.

One thing i don't understand though is that in linux.org patches are compressed bz2 files and are applied with the command :
bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1

while in the ../rpmbuild/SOURCES directory of the fedora kernel there are e.g:
linux-2.6-wireless.patch
linux-2.6-wireless-pending.patch
linux-2.6-wireless-pending-too.patch

How do i apply them to the linux.org kernel source?

Also would it be possible to build, for my compiled kernel (2.6.23.12.RVF16.fc8) from Kernel.org source, the kmod-fglrx-2.6.23.12.RVF16.fc8-8.452.1-2.8.01.lvn8.i686.rpm using livna source and use it with:
xorg-x11-drv-fglrx-8.452.1-3.8.01.lvn8.i686.rpm (10/02/08 latest package)
xorg-x11-drv-fglrx-libs-8.452.1-3.8.01.lvn8.i686.rpm (10/02/08 latest package)

Thanks.

alpha645
2008-02-10, 06:01 AM CST
Well i tried building the vanilla kernel (fedora without patches) by editing in the fedora kernel.spec file the line :
%define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 1}

That didn't work either. System forbids loading dazuko.ko module via syscalls so it must be something hardcored to the fedora kernel.

So i'll have to try applying fedora patches to the linux.org kernel.

One thing i don't understand though is that in linux.org patches are compressed bz2 files and are applied with the command :
bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1

while in the ../rpmbuild/SOURCES directory of the fedora kernel there are e.g:
linux-2.6-wireless.patch
linux-2.6-wireless-pending.patch
linux-2.6-wireless-pending-too.patch

How do i apply them to the linux.org kernel source?

Also would it be possible to build, for my compiled kernel (2.6.23.12.RVF16.fc8) from Kernel.org source, the kmod-fglrx-2.6.23.12.RVF16.fc8-8.452.1-2.8.01.lvn8.i686.rpm using livna source and use it with:
xorg-x11-drv-fglrx-8.452.1-3.8.01.lvn8.i686.rpm (10/02/08 latest package)
xorg-x11-drv-fglrx-libs-8.452.1-3.8.01.lvn8.i686.rpm (10/02/08 latest package)

Thanks.

patch -p1 < linux-2.6-wireless.patch
patch -p1 < linux-2.6-wireless-pending.patch
patch -p1 < linux-2.6-wireless-pending-too.patch

Good luck :D

pepe123
2008-05-18, 04:51 PM CDT
hey, this is a very helpful guide.

I used it to insert my custom DSDT table in the kernel, because the original one was broken. this happens on acer aspire 5051 awxmi.

anyway, after recompiling the 2.6.24.7-92.fc8 (and other other from the fc9 branch) i got
[you@localhost~]$ uname -ipm
[you@localhost~]$ i686 athlon i386

with the default kernel i got
i686 athlon i686
here are the mods of the kernel.spec file:

# The following build options are enabled by default.
# Use either --without <opt> in your rpmbuild command or force values
# to 0 in here to disable them.
#
# standard kernel
%define with_up 1
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp 0
# kernel-PAE (only valid for i686)
%define with_pae 0
# kernel-xen
%define with_xen 0
# kernel-kdump
%define with_kdump 0
# kernel-debug
%define with_debug 0
# kernel-doc
%define with_doc 0
# kernel-headers
%define with_headers 0
# kernel-debuginfo
%define with_debuginfo 0

# Additional options for user-friendly one-off kernel building:
#
# Only build the base kernel (--with baseonly):
%define with_baseonly 1
# Only b