www.centos.org Forum Index CentOS 5 - General Support Please help on patching & compiling Kernel...
|
Bottom Previous Topic Next Topic |
| |
|
|
|---|
| Poster | Thread | Rated: 2 Votes |
|---|
|
Please help on patching & compiling Kernel... | #1 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2009/12/5
From
Posts: 3
|
Hi everyone, I have been trying for few days on patching and compiling a Kernel, but got no success. I have been searching the web for pointers, but those I have found are very confusing. I did try them, yet same result.
![]() I am trying to patch and compile with the following: -------------------------- Kernel: linux-2.6.31.6.tar.gz (http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.6.tar.gz) Patch: patch-2.6.31.6-rt19.gz (http://www.kernel.org/pub/linux/kernel/projects/rt/patch-2.6.31.6-rt19.gz) -------------------------- After modifying the Kernel options, I compile it by doing: -------------------------- make clean make bzImage make modules make modules_install make install -------------------------- And when booting with the Kernel, I get this issue: -------------------------- insmod: error inserting '/lib/dm-region-hash.ko' : -1 File exists mount: could not find filesystem '/dev'root' x83 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 init! -------------------------- Any help would be appreciated. |
||
Posted on: 2009/12/5 13:22
|
|||
|
Re: Please help on patching & compiling Kernel... | #2 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 6110
|
Have you read the introduction to the CentOS wiki Custom Kernel article?
I should really say that you are on your own, as there is no support for kernels not built from the CentOS sources. However . . . Please try the following: (1) Set up your own rpm build environment / tree using your own ID. Do not use the /usr/src/ directory structure or root's ID. See: Setup an RPM Build Environment. (2) Extract the sources from the tarball in an appropriate location. (3) Extract the patches from the tarball in an appropriate location. (4) Patch the sources. (5) Copy the configuration file of the CentOS kernel that you are currently running to the top directory of the source tree. i.e. cd ~/linux-2.6.31.6; cp /boot/config-$(uname -r) .config (6) Execute "make oldconfig" and accept the defaults to all the new questions. (7) Execute "make menuconfig" and configure as you wish. (8) Change directory to ~/linux-2.6.31.6/scripts/package/ and append the following lines to the mkspec file -- (9) Change directory to ~/linux-2.6.31.6/ and build the kernel as an rpm package -- (10) Assuming a successful build (check the log files), you will then find your new kernel-2.6.31.6-1.*.rpm package in your ~/rpmbuild/RPMS/{i386|x86_64}/ directory. (11) (Optionally) Sign the package. (i.e. rpm --addsign kernel-2.6.31.6-1.*.rpm). (12) Install the package -- rpm -ivh kernel-2.6.31.6-1.*.rpm (13) Reboot, specifying the new kernel -- to single user mode, for the initial test. (14) If the initial test proves to be satisfactory . . . . . . just exit the single-user shell to go to your normal multi-user run-level and continue to test. If the initial test fails . . . . . . you're on your own. |
||
Posted on: 2009/12/5 14:38
|
|||
|
Re: Please help on patching & compiling Kernel... | #4 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 6110
|
Quote:
Thank you. Please be aware that everything I wrote in post #2, above, is not CentOS. I suspect your problem originates in applying steps (3) & (4) because I have recently performed steps (1), (2) & (5) to (14) with a perfectly satisfactory result for the mainline kernel-2.6.32.1 sources. However I must stress, once again, that no support is available for self-built kernels using the mainline kernel sources and that there is only limited support available for self-built kernels using the latest CentOS kernel sources, as detailed in the Custom Kernel article. (Kernel 2.6.18-164.9.1.el5 as of the date of this posting.) |
||
Posted on: 2009/12/19 14:03
|
|||
|
Re: Please help on patching & compiling Kernel... | #5 |
|
|---|---|---|---|
|
Jr Board Member
![]()
Joined: 2008/12/10
From
Posts: 37
|
Hi there guys,
i'm in exactly same boat - same problem during boot as in the first post. Trying to compile 2.6.32.2 kernel for my centos 5.4. reason: laptop installation, would like to get support for my wifi card. i went along this howto: http://www.howtoforge.com/kernel_compilation_centos I already used this howto couple of times successfully (basicly same steps like the post alan described) in post above. My last success was 2.6.31 kernel on x86 (old P4 machine) with root fs on lvm. However, I can't get it working on my laptop. Somehow i simply doesn't read the / (root) on lvm. I suspect (wild guess) perhaps version mkinitrd could be involved - or even the lvm (like placement of lvm binaries)?? Damn i spent last 4 days on it, no success so far... Just letting you know, you're not alone in this ... |
||
Posted on: 2010/1/10 14:40
|
|||
|
Re: Please help on patching & compiling Kernel... | #6 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 6110
|
Quote:
Please start a new thread for your WiFi card support and post the output returned by the following -- To go to the trouble of building your own kernel just to provide a driver module is somewhat analogous to using a sledgehammer to crack a peanut (using an English analogy). The failure to build a working version the current stable mainline kernel (2.6.32.3, as of the date of this posting) seems to be rather common. A certain NedSlider can also attest to the disk driver / not finding the root partition issue. Although there is no support for custom kernels built from the mainline sources and only limited support for custom kernels built from the latest CentOS sources (2.6.18-164.10.1.el5, as of the date of this posting), I can confirm that I am unable to reproduce the failure. ![]() Invoking rpm -qa kernel\* | sort and uname -a on my workstation results in the following output -- |
||
Posted on: 2010/1/10 15:17
|
|||
|
Re: Please help on patching & compiling Kernel... | #7 |
|
|---|---|---|---|
|
Jr Board Member
![]()
Joined: 2008/6/4
From nj
Posts: 47
|
I haven't been able to compile the latest kernel either. I get the same errors - cannot find /. I tried it in a vm, in my workstation and on my laptop but it was a no go.
If anyone has any details how to work around this issue I would really appreciate it. -Adam |
||
Posted on: 2010/1/22 23:40
|
|||
|
Re: Please help on patching & compiling Kernel... | #8 |
|
|---|---|---|---|
|
Professional Board Member
![]()
Joined: 2006/5/29
From San Francisco, CA
Posts: 1483
|
Quote:
The analogy I prefer is "swatting flies with a grand piano", but either one makes the point. |
||
Posted on: 2010/1/23 0:51
|
|||
|
Re: Please help on patching & compiling Kernel... | #9 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2010/1/28
From University of the Free State - South Africa
Posts: 2
|
Had the same problem with CentOS 5.4 and Kernel 2.6.32.5.
Seemed that the SAS or SCSI hard drive modules weren't initializing. Fix: Enable CONFIG_SYSFS_DEPRECATED_V2 in the kernel source configuration. If you run "make menuconfig", browse to: General Setup ---> enable deprecated sysfs features which may confuse old usersp, and enable this option. Exit the menu configurator and save your changes. Continue with kernel compiling as per usual eg: make && make modules && make modules_install && make install ---OR--- Edit your .config file with a text editor and add/modify entry: CONFIG_SYSFS_DEPRECATED_V2=y Save the .config file Continue with kernel compiling as per usual eg: make && make modules && make modules_install && make install Hope this helps |
||
Posted on: 2010/1/28 22:16
|
|||
|
Re: Please help on patching & compiling Kernel... | #10 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/9/3
From California, US
Posts: 5172
|
Quote:
Thank you. You are a genius. It immensely helped. ![]() I was able to build and boot kernel 2.6.32-4 with that change applied. |
||
Posted on: 2010/1/28 23:52
|
|||
|
Re: Please help on patching & compiling Kernel... | #11 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 6110
|
vanecka,
You are due a gold star for that observation. ![]() As I mentioned to toracat in a private communication, you posted at just the right time -- as I was just about to have a concerted effort in resolving the issue this afternoon. It was a case of "not seeing the wood for the trees" -- I just could not understand why I have (highly modified from the CentOS configuration) kernels that boot but others failed when maintaining the EL5 configuration. |
||
Posted on: 2010/1/29 14:39
|
|||
|
Re: Please help on patching & compiling Kernel... | #12 |
|
|---|---|---|---|
|
Jr Board Member
![]()
Joined: 2008/12/10
From
Posts: 37
|
Good job well done!!!
Thank You vanecka, thanks to you all helpful people, you saved my gnass While being totally frustrated i found relief in reading linux haters blog here: http://linuxhaters.blogspot.com/ which is really funny stuff )I also found, through the pain and suffering, i love centos (and of course my wife) ![]() |
||
Posted on: 2010/1/29 18:43
|
|||
|
Re: Please help on patching & compiling Kernel... | #13 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2010/3/9
From
Posts: 3
|
Hi,
I had the same problem with CentOS 5.4 and standard kernel 2.6.32.7, which I need for realtime extensions. With the solution from vanecka I could boot the new standard kernel ., thanks.There are still two error messages during the boot process: "insmod: error inserting /lib/dm-region-hash.ko -1 fikle exists" and a problem with ip-tables "could not restore ip-tables line 20" or so Has someone an idea how to solve these error messages? thanks Michael |
||
Posted on: 2010/3/9 11:13
|
|||
Top Previous Topic Next Topic |
|



Topic options
Print Topic
Threaded
Newest First
2 Votes
Farnsworth




. . . just exit the single-user shell to go to your normal multi-user run-level and continue to test. If the initial test fails . . .
. . . you're on your own.




You cannot start a new topic.
You can view topic.