Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is a newbie question because I have no clue how to do this. It may belong in the Slackware section, but I'll see how this goes.
I just want to upgrade my Slackware 13.1 kernel (2.6.33.4) to the latest stable kernel from kernel.org (2.6.38.2). I have never done anything like this and I am a Linux newbie, so I would appreciate a "Kernel Patching for Dummies" version if possible.
I did do a search on this forum and most of what I read was over my head.
I found an FAQ on kernelnewbies.org on "How To Apply A Patch" but when I attempted what they suggested, it said it couldn't find the file to patch at line 5 and asked me which file to patch. So I CTRL-Z'd out of there and came here.
Here's what I tried:
Code:
cd usr/src/linux
bzip2 -dc /usr/src/patch-2.6.38.2.bz2 | patch -p1 --dry-run
If you can point me in the right direction, that would be great.
Thanks,
Equinn
Click here to see the post LQ members have rated as the most helpful post in this thread.
I'd suppose that the patch you downloaded will only update the kernel-sources from 2.6.38.1 to 2.6.38.2.
If you want to update from 2.6.33 to 2.6.38, you'll have to download the full kernelsources.
I'd recommend to unpack it in the /tmp directory as a normal user, then copy your .config (of the old kernel) file into the kerneldirectory (/tmp/linux-2.6.38.2/) and apply the
Code:
make oldconfig
command. this will copy the configuration of the old to the new kernel and ask you for the additional features (which are not yet present in 2.6.33).
Afterwards you may run make and then (as root) copy the whole kernelsource to /usr/src.
Then apply (as root) make modules_install and copy the kernelimage (arch/x86/boot/bzimage) into your /boot directory. Don't forget to edit lilo.conf and run lilo.
There is a README in the top level of your source tree - read it.
In the Documentation directory there is a "applying-patches.txt" - it has more specific/expansive info. Reading that would also be a good use of your time.
What (extra) patches Pat has incorporated I have no idea. That would preclude directly applying the intervening consolidated patch levels to upgrade the kernel you now have.
You will need to compile the kernel by yourself in order to upgrade your kernel . Have a look at this page : http://www.howtoforge.com/kernel_com...debian_etch_p2 and your patch has to be patched inside the kernel sources . Good luck !
If you are going to all the trouble of compiling a custom kernel then look at gentoo and LFS for how to select more options to be exact for your use and system.
Thank you for your help. I was able to follow you (sort of) up until the part about 'make modules_install'. I tried it from the source directory and the root and it didn't work on either. I looked in the src directory and found three modules.* files.
Code:
Module.sysvers
modules.builtin
modules.order
I don't know what they mean or if I'm supposed to do anything with them.
BTW - when I did the 'make oldconfig', I thought I was going to be there all day answering questions. Also, I had no idea what to answer. It seemed to be giving me the suggested answer by capitalizing the letter. So I just went with the captial letter as my answers. It seems to have worked. Was that the right thing to do?
Quote:
Originally Posted by markush
Then apply (as root) make modules_install and copy the kernelimage (arch/x86/boot/bzimage) into your /boot directory. Don't forget to edit lilo.conf and run lilo.
Well, what I meant was to build the kernel in /tmp, then copy the sourcetree to /usr/src and install the kernel
Code:
cp -r /tmp/linux-2.6.38.2 /usr/src
cd /usr/src/linux-2.6.38.2
make modules_install
cp arch/x86/boot/bzimage /boot/vmlinuz-2.6.38.2
cp .config /boot/config-2.6.38.2
cp System.map /boot/System.map-2.6.38.2
afterwards you'll have to edit the lilo.conf file and run lilo.
If "make modules_install" does nothing, either you forgot to build the kernel with make or you didn't configure any modules. Check /lib/modules if there is a directory for the 2.6.38.2 kernel.
These are the permissions that I had to use to build cs-46xx driver. Maybe someone can help you with setting the right permissions as I'm not sure thee are exactly the ones you need, but you do need some.
$ sudo chgrp -R src /usr/src
$ sudo chmod -R g+w /usr/src
I recommended to build the kernel in the /tmp directory as a normal user and afterwards as root copy the complete sources with the new built kernel into the /usr/src directory.
How are you Markush?
Thank you for the information, I'm glad you pointed that out, as it gives me a better understanding of purpose or use of tmp.
Also it appears to be safer and tmp can be removed.
Is this what I've been reading about as far as out-of-tree kernel?
Well, there is one additional point to consider. Here we have Slackware, it is no problem to build the kernel in the /tmp directory. But there are other distributions which whipe the whole /tmp directory when the systems starts. In such a case it would be better to build the kernel within the /home directory of the user.
Do I have to do the build in /tmp as a normal user? I have been logged in as 'root' all this time. And I just installed the system and there are no other users configured.
as far as I remember "the Slackware way" is to build the kernel in /tmp as a normal user. I'd strongly recommend to add a normal useraccount for your computer. You may use the command "adduser".
Quote:
Originally Posted by Equinn
...I have been logged in as 'root' all this time...
Installation can only be done by root, but the first thing I do on a new installed System is adding a user and log in as the new user. Beeing always root is very dangerous.
OK - I have been trying this all day (as root). I will try again with adding a user. At this point, I have royally messed things up. Now the system won't boot at all. I'm getting the error:
Code:
No filesystem could mount root, tried: romfs
Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(8,1)
Pid: 1, comm: swapper Not tainted 2.6.38.2-smp #1
Call Trace:
[######] blah blah blah
[######] and so on and so forth
So anyway, I will be starting over with reinstalling Slackware 13.1 from the CD and trying again.
BTW - when I ran 'make modules', I got some messages like the below. Can you tell me if this is a problem or not? Judging from the fact I can't boot, I'm guessing yes. So what do I do about it?
Code:
CHK include/linus/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 2468 modules
WARNING: modpost: Found 19 section mismatch(es).
To see full details build your kernel with
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
After that, I ran 'make modules_install', which seems to have completed without error. Then I copied all the files you suggested and edited lilo.conf. I wasn't sure what I should do there. I just changed the line that said 'image = /boot/vmlinuz' to 'image = /boot/vmlinuz-2.6.38.2'. Is that what you meant?
And then I just typed 'lilo' from the command prompt to run it.
You've forgotten to configure the SATA-driver in the kernel, so the kernel cannot recognize the harddrive. You should boot with the original-Slackware-kernel. You must not build the SATA-driver as a module. Also be sure to configure the kernel for the filesystems you have on your computer.
The command "make modules" is not yet needed, this is a command from the old times with the 2.4-kernel.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.