LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-14-2003, 06:27 PM   #1
Faeroon
Member
 
Registered: Jan 2003
Location: Germany
Distribution: right now: Vector Linux4
Posts: 96

Rep: Reputation: 15
Talking Building my own kernel - first probs


I did warn you moses / masterc / grim
I'm back with new exciting problems

I've built a kernel with the 2.4.20 source and the tutorial that
Grim posted in the last thread. http://www.tldp.org/HOWTO/Kernel-HOWTO.html

The problem now is:
I can boot the new bzImage but I can see (also it's gone very fast)
that there're MANY problems while the kernel is loaded and my first
task would be to analyse the log...but... i don't now where or how to get it *G*
I've looked in /var/log but there several textfiles and I've no clue which one is the right one.
 
Old 01-14-2003, 06:38 PM   #2
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
/var/log/messages OR
dmesg

What kind of problems? How's it goin?

Cool
 
Old 01-14-2003, 07:05 PM   #3
Faeroon
Member
 
Registered: Jan 2003
Location: Germany
Distribution: right now: Vector Linux4
Posts: 96

Original Poster
Rep: Reputation: 15
Hm... I can't find those errors in /var/log/messages
and dmesg isn't telling me any errors , but I think that's because right
now I'm running /boot/vmlinuz again

Gonna test more in a few hours ...right now I'm dead tired.

I remember seen that many modules where not loaded.
eth0 and all the stuff could be initialized 'cause all the modules where not loaded.
Do I have to write some custom file to include all this stuff?
I thought if I use xconfig , save & exit + do all the other stuff , it would work?
Or did I miss something - i definitely haven't writen anything like "include this and this and this module"


Ok...have to get some sleep... damn headaches are killing me
 
Old 01-14-2003, 10:07 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Read this post, I explain the easy way to compile the kernel in Slack: http://www.linuxquestions.org/questi...522#post196522
 
Old 01-15-2003, 03:51 AM   #5
Faeroon
Member
 
Registered: Jan 2003
Location: Germany
Distribution: right now: Vector Linux4
Posts: 96

Original Poster
Rep: Reputation: 15
Thanks for the link tricky, but I don't seem to understand the last post:

"well, guess what my problem was... I had no problem! The reason I kept seeing 'unable to load module' was because it was still booting with the old 'rc.modules' file where I had uncommented alot of lines to load modules. The new kernel had these things loaded into it, so the 'make modules/modules_install' didn't copy the modules over, resulting in modprobe not being able to find the modules in '/lib/modules/...'"

I've recompiled the kernel again, my way to do it is the exact same way
ixion did it and I get the same problems :-/
"Nothing to do" etc @ make modules_install
I too had uncommented some stuff in rc.modules (f.ex. the emu stuff for my soundblaster etc.)
and now I've no idea what I'm doing wrong?
There don't seem to be any modules loaded?
Code:
bash-2.05a# modprobe uhci
modprobe: Can't locate module uhci
bash-2.05a# modprobe ohci
modprobe: Can't locate module ohci
bash-2.05a# modprobe usb-ohci
modprobe: Can't locate module usb-ohci
bash-2.05a# modprobe usb-uhci
modprobe: Can't locate module usb-uhci
bash-2.05a# modprobe hid
modprobe: Can't locate module hid
bash-2.05a# modprobe usbmouse
modprobe: Can't locate module usbmouse
Another strange thing is this:
Code:
Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 816M
agpgart: Unsupported SiS chipset (device id: 0648), you might want to try agp_tr
y_unsupported=1.
agpgart: no supported devices found.
[drm] Initialized tdfx 1.0.0 20010216 on minor 0
[drm] Initialized radeon 1.1.1 20010405 on minor 1
[drm:drm_init] *ERROR* Cannot initialize the agpgart module.
 
Old 01-15-2003, 05:11 AM   #6
Grim Reaper
Member
 
Registered: Apr 2002
Distribution: Gentoo 2006.0 AMD64
Posts: 399

Rep: Reputation: 30
I'd just like to jump in here and ask a question, both to you Faeroon, and the others...

When you compile a kernel, aren't you meant to copy the System.map file from the kernel source directory to the /boot dir also? Yet the guide in TLDP didn't mention it...maybe i mistaken, maybe you don't have to do this?

If so, it could possibly be whats causing your problems, Faeroon?

Just a thought...
 
Old 01-15-2003, 09:48 AM   #7
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
When you recompile the kernel and you know you selected those modules, are you selecting them as builtin or as a module ?

It will create a new modules file called rc.modules.new or something along the lines like that. Make sure you don't have any uncommented modules that you don't want to load.

If your getting that error at make modules_install, its either a way your configuring the kernel in either make xconfig or make menuconfig most likely.

If you want, when you configure your kernel, save the configuration before exiting and saving, then try to pull it back up and see if your configurations stayed how you wanted. Then move on to recompile.

And Grim Reaper, when compiling a kernel in Linux and you edit your Lilo.conf file ahead, you can use the make install command and it copies and updates Lilo for you.. quite nice really, so there is no need to manually copy whatever necessary to their new destinations.
 
Old 01-16-2003, 01:14 AM   #8
Grim Reaper
Member
 
Registered: Apr 2002
Distribution: Gentoo 2006.0 AMD64
Posts: 399

Rep: Reputation: 30
But does System.map have anything to do with lilo? I never thought it did...

What exactly does System.map do, seeings as it sounds like it isn't needed, but is still there on most distro's?
 
Old 01-16-2003, 08:41 AM   #9
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally posted by Grim Reaper
But does System.map have anything to do with lilo? I never thought it did...

What exactly does System.map do, seeings as it sounds like it isn't needed, but is still there on most distro's?
What I also meant to say is the make install command not only updates lilo but also moves the System.map.. and anything else for your kernel to boot properly.. sort of say. The System.map is somewhat needed though, my search on google came up with this page that explains it: http://www.dirac.org/linux/systemmap.html
 
Old 01-19-2003, 07:08 PM   #10
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
Hi all, I'm new to the forum but having broken a few installs of Slackware, RedHat, SUSE, etc by screwing up kernel rebuilds so I'll throw in my learned the hard way method for rebuilding kernels.

* cd /usr/src/linux
* make mrproper (cleans out old build temp files, may not be needed. also note this deletes any previous .config file, see below)
* can copy previous config from /boot as a base template... cp /boot/config-2.4.xx-new .config
* make menuconfig (or make config or make xconfig)
* pick all the appropriate options, but take note:
-remember which of your system drivers you are adding into the kernel and which ones you are modularizing; A good trick is to open /etc/rc.d/rc.modules in a different terminal window and remark/unremark appropriate modules as you go through the config. ie I modularize my sound card driver so uncomment it in rc.modules but build my scsi driver into the kernel so comment out the line for it in rc.modules.
* make dep
* make clean (can do these together, they are fairly short... root@scoob:/usr/src/linux# make dep ; make clean)
* make bzImage (Usually the longest part of the process)
* make zImage instead of bzImage if you can pull off a small kernel
* make modules
-note: can do any command below except make modules_install in a second terminal while make modules is running
* mv /lib/modules/2.4.xx /lib/modules/2.4.xx-old (this moves the old modules out of the way so make modules_install doesn't overwrite them)
* make modules_install (this basically copies the new modules to /lib/modules/2.4.xx)
* cp arch/i386/boot/zImage /boot/vmlinuz-2.2.xx-new
* edit /etc/lilo.conf (it's a good idea to copy your original image= section and rename it to something like original so you can boot the old kernel)
*mv System.map /boot/System.map-2.4.xx-new
*delete or rename the symbolic link System.map and make a new one ln -s /boot/System.map-2.4.xx-new /boot/System.map
*cp .config /boot/config-2.4.xx-new
*delete or rename the symbolic link config and make a new one ln -s /boot/config-2.4.xx-new /boot/config
* /sbin/lilo
* reboot (no need to do it immediately but the new kernel won't be loaded until you reboot)

This does a few things, first off the System.map from the new build is now in /boot where the kernel can find it rather than the old one. Second, you have a saved copy of your .config as /boot/config-2.4.xx-new and can copy it back as a template if you need to modify your kernel build, see the third step above. By moving the old modules out of the way, you can trim your system by deleting these once you are satisfied with the new kernel.

Things to look out for:
-This isn't the definitive guide to compiling your kernel! Do reference any appropriate man pages, HOWTOs, etc while doing this.
-on Slackware, your network card module may be loaded in /etc/rc.d/rc.netdevice instead of /etc/rc.d/rc.modules
-by moving your old modules out of the way you can hose your system if you forgot an important module like your hard drive driver in the new kernel.
-editing the rc. startup files can really mess up your system if you don't CAREFULLY follow syntax.

I've also had problems where errors fly by on screen during boot and you can't find them in system logs and there is probably a proper way to get the sysytem to log them but a dirty trick that I use is to open up the startup files like rc.M and add some pauses like this:

echo "press ENTER to continue -myname"
read junk;

This way, during boot I will see the message and have to hit enter to continue booting. When I'm done I open up the files again and use a search for myname to delete these pauses.
 
Old 01-20-2003, 08:14 AM   #11
flashingcurser
Member
 
Registered: Jan 2003
Distribution: many win/nix/mac
Posts: 259

Rep: Reputation: 31
Oops, answer already given

Last edited by flashingcurser; 01-20-2003 at 08:16 AM.
 
  


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
Building kernel module from multiple source file in 2.6 kernel yogeshwar_s Programming 1 12-20-2004 09:31 AM
Problems building a simple kernel module for kernel 2.6.7 atticman Linux - Software 2 12-13-2004 03:35 PM
building rpms as non-root user - temp probs frogman Linux - Software 2 11-23-2003 04:41 PM
Building kernel 2.6 test 7 on Fedora (RedHat) probs Jefklak Linux - Software 1 10-20-2003 04:55 PM
Mandrake 9 - Building and Misc Probs ambian307 Linux - Software 1 08-11-2003 09:55 AM


All times are GMT -5. The time now is 09:31 PM.

Main Menu
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