LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-10-2006, 03:09 AM   #1
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Rep: Reputation: 62
How Do You "Drop In New Kernel" For Slack?


Hi all,

Well I've come to the point in my slackware experience now that I can really screw things up, so here it goes LOL.

I thought I read somewhere on the internet, that with Slackware you can just "boom" drop in a kernel patch and zip zip your updated to the latest greatest.

But for the life of me I cannot recall or find the web-site that I saw this at.

I figured it would be a great way to kill some time Hhahahah.

Does anyway have a link to a nice how to?

Thank you in advance.
 
Old 05-10-2006, 03:28 AM   #2
newio
Member
 
Registered: May 2006
Location: Sydney
Distribution: Slackware 11.0
Posts: 39

Rep: Reputation: 15
stick with the old but gold:

http://www.linuxquestions.org/questi...d.php?t=127095
 
Old 05-10-2006, 06:06 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,379

Rep: Reputation: Disabled
Quote:
Originally Posted by newio
Old and gold, but it will take you hours to extract the correct information from that thread... it staggers from left to right all the time.

This is a short recap of how I build my 2.6 kernels.
====================================================

*** Update: ***
I copied this guide to my Wiki page at http://alien.slackbook.org/dokuwiki/...kernelbuilding so that is does not drown in this forum after a couple of days.
***

I run the commands from a X terminal, and at some point start the X based kernel configurator. I run my desktop as "myself" but I build my kernels as root. In order to let root use my X display, I do the following in my X terminal: get root rights; merge my own (alien's) Xauthority file with the one from the root user, and set the DISPLAY variable. After doing that, I can run X applications from the "su" terminal.

Code:
echo $DISPLAY                     # you'll be needing this value 3 lines below
sudo -i                           # or "su -" on older Slackwares
xauth merge ~alien/.Xauthority    # use your own username here instead of "alien"
export DISPLAY=:0.0               # use the value of DISPLAY you've seen 3 lines before
Now that the build environment is set up, continue with the sources.

Download a new kernel, unpack it into /usr/src and create the "linux" link so that the commands are a little more generic. I will take a kernel version of "2.6.16.15" as an example. If yours is a different version, you'll know where to change the version strings in the rest of the story below.
Code:
wget http://www.us.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.15.tar.bz2
tar -C /usr/src -jxvf linux-2.6.16.15.tar.bz2
cd /usr/src
rm linux
ln -s linux-2.6.16.15 linux
You will probably notice more linux-* directories in /usr/src but it is common to let the "linux" link point to the kernel you are working with.

Now, get a Slackware kernel config file for a headstart during your own configuring. Pat's config files are pretty generic. By the time you read this, there might be a config for a newer 2.6 release available:
Quote:
wget http://slackware.mirrors.tds.net/pub...onfig-2.6.16.9
cp config-2.6.16.9 /usr/src/linux/.config
Run "make oldconfig" in the kernel source directory so that the defaults are used from the .config file you just installed. Because your kernel sources are probably newer than the .config, there will be new options to choose from. You will only have to answer these (press ENTER for the default answers which are mostly fine, or "m" to build new drivers as modules).
Code:
cd /usr/src/linux
make oldconfig
You now have configured a pretty generic kernel (that is the reason why Pat calls them "kernel-generic" probably :-) but you will want to change some of the defaults to suit your needs. Run the X based configurator (if you do not run X but are at a text console, just run "make menuconfig" to get the curses-based dialog program instead)
Code:
make xconfig
Walk through the forest of options. What I change is:

* build the ext3 and reiser fileystem drivers into the kernel instead of compiling them as modules - I do not need to create an additional "initrd" then (see under "Filesystems" in the configurator).

* enable support for dual procesessors and hypertreading (under "Processor type and features" > "Symmetric multi-processing support").

* enable 4GB of RAM. The Slackware default setting is to only support ~800 MB of your RAM, so any additional installed RAM is never used! (under "Processor type and features" > "High Memory Support (4GB)").

* enable the "low-latency" kernel if you run a desktop/laptop computer (under "Processor type and features" > "Preemption model" > "Preemptible kernel").

* set a 1000Hz timer (under "Processor type and features" > "Preemption model" > "Timer frequency").

* ... and more I can't think of right now. You can decide to disable a lot of the modules that the default config will build, to cut down on time, if you don't have the hardware in your computer. You could also looka at software suspend and CPU frequency scaling (under "Processor type and features") if you own a laptop.

And finally save your configuration if you're satsfied.
Now, start the build of kernel and modules, and install them to the proper places.

Code:
make bzImage modules          # compile the kernel and the modules
make modules_install          # installs the modules to /lib/modules/<kernelversion>
cp arch/i386/boot/bzImage /boot/vmlinuz-custom-2.6.16.15  # copy the new kernel file
cp System.map /boot/System.map-custom-2.6.16.15           # copy the System.map (optional)
cp .config /boot/config-custom-2.6.16.15                  # backup copy of your kernel config
cd /boot
rm System.map                                             # delete the old link
ln -s System.map-custom-2.6.16.15 System.map              # create a new link
Edit /etc/lilo.conf and add a new section for your new kernel. Remember, your new kernel may not even boot if you made a mistake somewhere, so you will want to leave the sections for your current kernel(s) intact. Your current /etc/lilo.conf will have a section somewhat like this, near the bottom of the file:
Code:
image = /boot/vmlinuz
  root = /dev/hda1
  label = linux
  read-only # Non-UMSDOS filesystems should be mounted read-only for checking
Add another section just below (adding it below will guarantee that your current kernel will remain the default to start):
Code:
image = /boot/vmlinuz-custom-2.6.16.15
  root = /dev/hda1
  label = newkernel
  read-only # Non-UMSDOS filesystems should be mounted read-only for checking
After adding a stanza for your new kernel to /etc/lilo.conf and saving the file, run lilo to activate your changes:
Code:
lilo
Now is the time for a reboot, to test the results! In the lilo boot screen, select the "newkernel" option instead of the default "linux" option.
If the new kernel boots fine, you can add this line to the top of /etc/lilo.conf and re-run "lilo":
Code:
default = newkernel

Other packages that contain kernel modules

Most certainly you will have packages installed that contain kernel modules that are not part of the default kernel. Slackware has "alsa-driver" for instance, and if you installed any wireless driver, these are basically kernel modules too.
Now, with the installation of your new kernel, you will lose these modules, and you have to recompile the sources so that the binary modules match the new kernel.
You can get an overview of all packages that have installed a kernel module for your current kernel by running this command (i.e. you must run this command while still running your old kernel):
Code:
cd /var/log/packages
grep -l "lib/modules/`uname -r`" *
All the mentioned packages will need a recompile.

For ALSA you have a choice: either enable the ALSA driver that is part of the kernel you've just downloaded, or leave the kernel configuration like Slackware's: disable all ALSA support in the kernel and instead re-build the alsa-driver package.

Good luck with it all!

Eric

Last edited by Alien Bob; 05-16-2006 at 07:49 AM.
 
Old 05-10-2006, 01:07 PM   #4
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 66
Very good guide, Bob, but...
Quote:
Originally Posted by Old_Fogie
I thought I read somewhere on the internet, that with Slackware you can just "boom" drop in a kernel patch and zip zip your updated to the latest greatest.
Patches are a little different. For example, I just did a patch last night.
You need:
  • The kernel patch (right now, latest/greatest is 2.6.17-rc3
  • The next lowest 3 number kernel (in this case, 2.6.16)
  • Beer, Whiskey, or 'relaxant' of your choice
Unpack/untar kernel source and patch. I put them in separate directories in /usr/src.

cd to your source directory, and type
Code:
patch -p1 < path/to/your/patch
After patch is complete, continue as usual.

What is the 'relaxant' for? Something, somewhere, may go haywire. Patch won't work right. You didn't use a 3 number kernel. Your dog pees on the keyboard. Whatever. Just keep trying. I had to do mine 3 times last night to get the driver I need for my wireless to show. (That's what I get for doing it the first time a few weeks ago after getting home from driving 1100 miles that day, being totally tired, and patching/compiling. Woke up the next day, and everything worked....Too bad I didn't write down what I did)

Patching does get you the 'bleeding edge', but can be a hassle

BTW, Bob, EXCELLENT tip on the merge idea. THAT has been driving me bonkers for awhile.
 
Old 05-10-2006, 01:32 PM   #5
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Rep: Reputation: 31
I wrote a little How-To on it. Hope it works if you decide to use it.

Guide
 
Old 05-10-2006, 01:44 PM   #6
drlouis
Member
 
Registered: Aug 2004
Location: Ne
Distribution: slackware 12 on Dell XPS m1710
Posts: 90

Rep: Reputation: 15
Alien Bob: wow! Thanks for taking the time to type all that out for us newbs trying to work up the courage to compile a 2.6 Kernel. This will save me TONS of time.
 
Old 05-10-2006, 03:08 PM   #7
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Original Poster
Rep: Reputation: 62
Thank you for the help guys. I've been able to compile kernels as cwwilson walked me thru a few weeks back, however there are so many things in that long thread and Eric's post that I did not know. The "merge" for root using a users window for one, and finding out which modules are needed too..very nice.

cwwilson, how long does it take for the patching to run assuming that the patch worked the first time? when I compile a kernel it takes about 10 minutes on my pc to do "make". does that save alot of time?

and I guess lastly, could you simply tar/archive your current kernel before you do the patch and if it didnt take just restore/overwrite by untar and try again?
 
Old 05-10-2006, 03:10 PM   #8
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 66
You could do the 'tar' thing, It can help.

Patching took me about 1 minute. It modifies the kernel rather quick
 
Old 05-10-2006, 04:02 PM   #9
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by cwwilson721
You could do the 'tar' thing, It can help.

Patching took me about 1 minute. It modifies the kernel rather quick
Very nice. Thanks.
 
Old 05-10-2006, 11:20 PM   #10
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Original Poster
Rep: Reputation: 62
Yeah for sure this is really good.

Anyone use any "optimization flags" when they run make? I heard it can make the "make" go faster.
 
Old 05-11-2006, 01:47 AM   #11
MannyNix
Member
 
Registered: Dec 2005
Location: ~
Distribution: Slackware -current, OpenBSD
Posts: 449

Rep: Reputation: 41
What a great post Alien Bob! Slackers are amazing, no doubt
 
Old 05-11-2006, 08:03 AM   #12
adityavpratap
Member
 
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 431

Rep: Reputation: 32
great write up on kernel compiling!
Hope you include more options you choose during xconfig for the benefit of newbies like me.
 
Old 05-12-2006, 02:03 AM   #13
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Original Poster
Rep: Reputation: 62
Yeah truly a great write up. My only problem with kernels now is finding out Should I or shouldn't I include the IPV6 at all in my kernel compiles? If I put the ipv6 in, now I could be doing it wrong, but I get a ton of errors. Maybe my guard-dog is too old? DOesnt' support it? or I'm not supposed to have ipv4 and ipv6. I gotta read into it to be honest.

I saw cwwilson posted his kernel config I'm gonna go check that out and see.
 
Old 05-12-2006, 05:34 AM   #14
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,379

Rep: Reputation: Disabled
Quote:
Originally Posted by adityavpratap
great write up on kernel compiling!
Hope you include more options you choose during xconfig for the benefit of newbies like me.
I can expand that post of mine, if people are interested. What I'd like to know, if my story added more insight after having processed DaOne's "kernel compile guide for 2.6"? What did you miss in either threads that you feel is missing from the "newbie" point of view?

I'm thinking of copying the instructions into my Wiki so that I can polish it further and make it more "sticky" - like the two posts up here in the Slackware forum.

Eric
 
Old 05-12-2006, 10:10 PM   #15
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by Alien Bob
I can expand that post of mine, if people are interested. What I'd like to know, if my story added more insight after having processed DaOne's "kernel compile guide for 2.6"? What did you miss in either threads that you feel is missing from the "newbie" point of view?

I'm thinking of copying the instructions into my Wiki so that I can polish it further and make it more "sticky" - like the two posts up here in the Slackware forum.

Eric

I believe what was "new" news to me, tho it might have been in that thread and I really dont have the time to double-check was:

"make bzImage modules" I didnt know you could do that at once. I liked Shilo's thread but he uses gnome. To me gnome is like mac. I dont like mac. So I dont use gnome. sorry gnome writers. so i used the slackers bible to learn how to compile and it was not written there that way.

giving root the user's console view was definitely new to me. this will stop me from having to pull the network cable when i load then install everything and set it up while running as root to do so in the beginning, altho now that i've gotten further i just drop out of X and go. this saves time. was totally new to me.

the wget was nice as I didnt know how to do that for kernels. i've used it on other distro's when i first started out.

i think you may want to add about the gpg import key feature of the kernel archives and gpg verify.

the tips you added were dead on, short and sweet. the only issue of concern for some of those items from what i read is if the user wants to use ndiswrapper. you may want to caution on 4k v 8k stax.

the listing of modules was only new to me even now.

Eric, I think the beauty of your post compared to many web-sites or other wiki's was that it just listed the commands in a row. The user can see that it's only about 10-15 steps to do it and get done. You get the impression that "hey i can do this". Whereas web-sites go in to explaining, spread out over many pages, etc which is good, but tends to leave you with the feeling of "oh my god what am I about to get myself into."

I think if you do a wiki you keep it short...put a quick link like this {1} which points to a different page if they want a description of what that all means, but just keep it running down like a quick cheet sheet. Not inundated with words. Just here's what you do, boom boom go get pizza boom boom done.

You may want to touch on compiling on one pc and copying it over to another.

Hope that the above gives you the feel for someone like me, just 2 months or so just into linux thinks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ivman broke, "couldn't drop root privileges" hedpe Linux - Software 1 04-18-2006 09:23 AM
Common problems explained: "kernel panic - not syncing", "unable to mount..." sundialsvcs Linux - Newbie 2 03-01-2006 01:17 PM
"SFW2-INext-DROP-DEFLT" messages - can anyone explain? MassDosage Linux - Networking 3 01-23-2006 04:48 PM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 01:07 PM
What does "SFW2-INext-DROP-DEFLT" in my messages log file mean? TrulyTessa Linux - Networking 11 12-22-2004 10:28 AM


All times are GMT -5. The time now is 06:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration