LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Newbie Guide To Compiling A Kernel! (https://www.linuxquestions.org/questions/linux-general-1/newbie-guide-to-compiling-a-kernel-73436/)

DrOzz 01-22-2004 07:04 PM

all that stuff is in the config file which you'll see the path to it below ... if it has =y then that means you enabled it ... and if it anything as =m then that means you compiled as a module ..
so with that said, whats the output of :
cat /usr/src/linux/.config | grep CONFIG_FB

linx win 01-24-2004 06:04 AM

DrOzz

:cry: Unfortunately, I did recompile my Mandrake 9.2 (2.6.1) system to enable some attributes required by my DVB card and returned with the same old problems again. Therefore, I removed Mandrake, re-installed Red Hat, upgraded it to Fedora 1 and compiled the kernel 2.6.0 per the procedure you provided but I got the same results; no cdrom, no modem and no windows partitions. I compiled kernel 2.4.22-8 without any problems. I think the problem is with the configuration that I do before compiling 2.6.0. Is there a way to make the new kernel to find out what equipment I have? By the way, I did make oldconfig first to get the info from my current system, then I did make xconfig to check if there is anything else I need to do. :scratch:

Thanks

thrix 01-24-2004 11:01 AM

Ok, i've got enabled the framebuffering, but how can i run it? Hhave i to boot with somekind of parameter to start booting with framebuffering? I did'nt find anything at man bootparams! help please!

sirpelidor 01-24-2004 11:43 AM

if you enabled framebuffering, look at /dev, you should see /dev/fb or /dev/fb0 or /dev/fb1

linx win 01-24-2004 12:09 PM

DrOzz

:D Ok I recompiled the kernel and I got the modem, sound and windows partitions working. My problem is with the cdrom (DVD-RW). System says:

mount: /dev/cdrom is not a valid block device

I checked the list of block devices and could not see it in the list.
:mad:
Also, I noticed that at the startup, the USB did not start saying that USB_uhci did not start and it was saying something about /proc/bus/usb/drivers. Can you help here. :Pengy:

Thanks

sirpelidor 01-24-2004 01:05 PM

what does it says in /etc/fstab ?

stevoman098 01-24-2004 03:47 PM

when i got to "make xconfig" it said it wasnt a valid comand, running fedora core 1.. what should i do?

also i couldnt find any .config file to use my old settings. im upgrading my current 2.4.22 kernel to 2.6.1

sirpelidor 01-24-2004 05:30 PM

where were u when u try to do make xconfig?
u must be under /usr/src/linux in order to do make (whatever config u chose)

also if u wanna run make xconfig, u must have X installed, or else u have to choose other config option, just as menuconfig

stevoman098 01-24-2004 06:17 PM

i was logged in as root, with kde, using the terminal.. i was in that directory, but still didnt work

what other options do you mean?

DrOzz 01-24-2004 08:54 PM

he's referring to the make config options ..
go back to the first page as it shows the different config options and what makes each different ..
make config, make xconfig, make menuconfig, etc, etc.....

thrix 01-25-2004 04:57 AM

Ok, i'll look at that dev/fb. If i don't have it, so the framebuffering doesn't work? How should I run it, where the hell should I put that /dev/fb to boot with framebuffering?

rberry88 01-25-2004 10:08 AM

Quote:

Originally posted by stevoman098
when i got to "make xconfig" it said it wasnt a valid comand, running fedora core 1.. what should i do?

also i couldnt find any .config file to use my old settings. im upgrading my current 2.4.22 kernel to 2.6.1

Going from kernel 2.4.22 to 2.6.x you should use "make menuconfig" and not use your old config as it will be much more cumbersome to go through all the little changes than if you start a new .config file for the new kernel, IMHO.

rberry88

Echs Bochs 01-26-2004 06:02 PM

Okay, I'm at the part where I need to type /sbin/grub-install. It says I need to pick an install directory... where should I install to?

rberry88 01-26-2004 06:32 PM

Quote:

Originally posted by Echs Bochs
Okay, I'm at the part where I need to type /sbin/grub-install. It says I need to pick an install directory... where should I install to?
Good question but with the information you gave us we can only give you a guess.

If your setup is just Linux on your primary drive and no other OS's installed then you would install it to your MBR of your primary drive. If you have a windows OS on your machine and this linux install then you can still install it to the MBR and use Grub to boot to either windows or linux. If you have more than one linux install on your machine then you need to decide if this grub will be the bootloader that shows at boot up or are you already using a grub from another install that comes up when you boot, if so then this one should be installed to the boot ***partition/directory of this installation and then you need to change the /boot/grub/menu.lst file in the distro of the grub file you do use at startup.

***If you partitioned your drive for this install with a /boot /(root) /home etc format then you would install it to the boot partition but if you setup your partitions with just a /(root) /home etc format then your boot directory would be located on the /(root) partition so this is where you would install grub.

Follow?

rberry88

Echs Bochs 01-26-2004 06:35 PM

Here is all the info I have:

Red Hat 9.0
Only OS on my drive.

ReefShark 01-27-2004 08:38 AM

Re: Newbie Guide To Compiling A Kernel!
 
Quote:

Originally posted by DrOzz
ln -s /usr/src/linux-x.x.x /usr/src/linux
**"make a new link to the new kernel"**

cd linux
**"type this to change to the directory"**

Just a suggestion (not sure if anyone already mentioned this in this thread, if so; sorry for mentioning it once more), but you shouldn't create the /usr/src/linux symlink.

A quote from the Linux From Scratch version 5.0 documentation:
Quote:

In the past it was common practice to symlink the /usr/include/{linux,asm} directories to /usr/src/linux/include/{linux,asm}. This was a bad practice, as the following extract from a post by Linus Torvalds to the Linux Kernel Mailing List points out:

"I would suggest that people who compile new kernels should:

- not have a single symbolic link in sight (except the one that the
kernel build itself sets up, namely the "linux/include/asm" symlink
that is only used for the internal kernel compile itself)

And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
header files, even though I haven't run a 2.2.13 kernel in a _loong_
time. But those headers were what Glibc was compiled against, so those
headers are what matches the library object files.

And this is actually what has been the suggested environment for at
least the last five years. I don't know why the symlink business keeps
on living on, like a bad zombie. Pretty much every distribution still
has that broken symlink, and people still remember that the linux
sources should go into "/usr/src/linux" even though that hasn't been
true in a _loong_ time."
I would say that creating the /usr/src/linux symlink is a definative *DON'T* according to Linus, so you might consider adjusting your guide to that...

Just my 2 cents ;)

Echs Bochs 01-27-2004 10:27 AM


linx win 01-27-2004 11:15 AM

I reinstalled Fedora Core 1 and reinstalled the new kernel 2.6.0. :D Luckly, everything went ok except the cdrom. I can not mount it. System says:

mount: /dev/cdrom is not a valid block device

Some one suggested installing the edev and I did but do not know what I should to get my cdrom working. Anybody know?

linx win 01-27-2004 12:51 PM

Problem solved. I found the solution by trial and error. I just deleted the hdc=ide-scsi from my grub file and it did work fine. I came to this idea after knowing that kernel 2.6.0 does not need the scsi emulation to write to the cd. My DVD rom is mounting correctly.

stevoman098 01-27-2004 07:19 PM

about how long would it take for a newbie to compile the 2.6.1 kernel? i only have about 2 hours a day i can be on the computer, except on weekends, and i dont want to get to the middle of comiling it and then have to wait till the next day to finish it..

sirpelidor 01-27-2004 07:56 PM

the actual compile time depends on ur CPU, and such. also u have to consider how much time u gonna need to go over "make xconfig"...

make modules takes a lot of time, in my opinion. if you are short in time, i advise you -not- to touch ur kernel. unless you write down every steps you did in the pervious day...

DrOzz 01-27-2004 09:31 PM

well, basically yes like mentioned the speed of your machine obviously plays a factor, but the most time consuming step(s) for a first timer would be the make config and obviously make bzImage takes it fair share of time, but that will all depend on what you choose ... cause you have to sort through everything that you want / dont' want, and that could take time especially when you have no idea what something is, and then you click the help button to read what it is and then choose weather or not to compile it ...
as of make modules, that only takes a lot of time, obviously if you choose alot of modules, cause personally when i type make modules and make modules_install, it takes a combined total of about 25 seconds ... so it just all depends on how you go about everything ....
but on an overall note, i would say that if you stuck with it and payed attention to what you are doing, and focused, you could definetly get it done in 2 hours no problem ...

Echs Bochs 01-27-2004 09:52 PM

Crap crap crap crap.....

Okay, so I did everything else I needed to do with compiling 2.6.1. I go to make the new initrd, but when I append 2.6.1 to the end of the command, it says /lib/modules/2.6.1 isn't a directory... I did every thing i had to do in the right order too

stevoman098 01-27-2004 09:56 PM

alright, thank you both for the info. i think i will wait and try it on a weekend, just in case i run into some problems

most of my computer specs are listed in my signature too

DrOzz 01-27-2004 10:06 PM

skip that step and see if you get it working without doing it ...
you may not need it (depending on your system), but more so you probably don't
and you may not even compiled support for it ..

Echs Bochs 01-28-2004 07:26 AM

Forget ALL other questions I've asked in this topic...

Alright. 2.6.1 apparently compiled succesfully. However, I boot up, choose my kernel from GRUB, and the loading begins. Then I get a kernel panic after the system frees unused memory. To "quote" it:
Code:

Kernel panic: No init found. Try passing init= to the kernel
How would I go about fixing this?

jtshaw 01-28-2004 09:33 AM

I have talked to a few people that have used this guide to compile there 2.6 kernel so I wanted to post something to clear up a few things.

They made an attempt to make compiling 2.6 kernels easier. There are now three basic steps:

1. configure your kernel (make menuconfig, make xconfig, you have a few choices here)
2. make - This builds everything, modules, bzImage's, everything.
3. make modules_install - This sets up the /lib/modules/<insert kernel version here> directory

Then of course you have to copy over your arch/<your architecture, probably i386>/boot/bzImage file to /boot and update your boot loader. If you use a system that
needs initrd (read: RedHat), you have to make that stuff as well.

There is no need for make dep, make modules, or make bzImage. They have all been combined into the make command.

The biggest misunderstand seams to be with the make mrproper command. From the Makefile iself:

###
# Cleaning is done on three levels.
# make clean Delete all automatically generated files, including
# tools and firmware.
# make mrproper Delete the current configuration, and related files
# Any core files spread around are deleted as well
# make distclean Remove editor backup files, patch leftover files and the like

DON'T run make mrproper after you have configured your kernel because it is going to remove your .config file which you just spend all that time creating. If you want to ensure you have a clean kernel source before you start, doing these commands is ok, but that is the only reason you would do this.

Also, you MUST make sure to include your root file system type in the kernel or it will never be about to mount the root partition:)

DrOzz 01-28-2004 11:15 AM

there is nothing in your post that i don't agree with, cause its all legit, but one thing i am having a hard time coming to terms is, is if you are writing this to respond to someone or if your writing this to correct something in the guide ....
cause there is a couple things i noticed that you wrote that your points (although correct) kinda don't apply
first you say just type "make" but i specify to type "make bzImage" and "make modules", so something like that is irrelevant in the correcting kinda way but is still useful for the lazy people (i guess) ...
secondly, you stress not to type mrproper after configuring (which is obvious) but the thing is, is that i have it at the beginning of the guide before the end user does anything, so nothing is getting deleted (basically) ... but then again if you are just stating this fact for knowledge then so be it ...
and last you stress there is no need to do steps such as make dep and the such, but if you notice i split the guide for 2.4 and 2.6 kernels (cause some people do still use 2.4) ..
so don't get me wrong, your correct in all aspects, but i just didn't see how it applied to anything .... it just seems like you wrote the guide in 3 sentences as opposed to what it is ..... but the point of the guide is to explain while showing what to do ....


as for you echs, read jtsaw's last sentence and make sure thats not what you did ...

jtshaw 01-28-2004 01:17 PM

I wasn't posting that to correct anything in your guide, but I have talked to at least 4 people this week that seamed to not really understand what things like make mrproper actually did. I was in particular trying to clarify because they were confused into thinking it might fix there problem if they got a module symbol error or something like that.

Echs Bochs 01-28-2004 03:31 PM

I'm pretty sure I have ext3 set... I saw ext3 journaling selected when i ran make xconfig. Plus, it appears to mount correctly, since I get the panic after the system frees unused memory.

DrOzz 01-28-2004 09:15 PM

ok but all you showed in your error was the last line of the error which is simply the kernel panic line ... lets say the important part to correcting this error lies in something that was outputted before hand ...
for example ... you could have got something like the below ...

mounting root filesystem
mount: error 19 mounting EXT3
pivot: pivot_root (/sysroot, /sysroot/initrd) failed:2
unmount /init/proc failed:2
Freeing unused kernel memory: 220k freed
Kernel panic: no INIT found. Try passing init= option to kernel.

i just seen another thread with a guy on the board with this error, and as you can see, the errors show above the panic, giving us more of an idea ...
is there anyway you could post more of the problem ?

Quote:

I wasn't posting that to correct anything in your guide, but I have talked to at least 4 people this week that seamed to not really understand what things like make mrproper actually did. I was in particular trying to clarify because they were confused into thinking it might fix there problem if they got a module symbol error or something like that.
ok cool man, and like i said there was no arguements in what you said, its just that i thought you were seeing something in the guide that was incorrect, and maybe i was overlooking it ...

Echs Bochs 01-29-2004 03:49 PM

Okay... I was talking to jtshaw last night on trying to get it to boot. He told me to try deleting the initrd line in GRUB, and sure enough, it worked. However, the system will not recognize input from my keyboard or mouse. It apprently can't find usb-ohci or something like that. I don't get why it won't automatically install the most widely used bus in the world, but.... so what can I do to fix this?

jtshaw 01-29-2004 04:04 PM

Go back into your kernel configuration and add USB support. Make sure you also have USB HID support.

Echs Bochs 01-29-2004 04:20 PM

Ugh... recompile it yet again?

jtshaw 01-29-2004 04:25 PM

Well all you have to do is run the configure thing again, add the new stuff, type make, and make modules_install, and it'll take a hell of a lot less time this time. Just don't do a make clean first:)

Echs Bochs 01-29-2004 04:28 PM

I hope linux rescue has the make stuff... *will do it later*. And do I need to do all that cp bzImage and cp vmlinuz crap again?

jtshaw 01-29-2004 04:33 PM

Sure do... Why can't you just boot your old kernel?

heister 01-30-2004 03:55 AM

i have did all that in the guide, but when i boot up the system it showed that i didn't append the /root path correctly.

according to my grub.conf, there are 3 kernel entries.
1. vmlinuz-2.4.20-28.9custom01
2. vmlinuz-2.4.20-28.9
3. vmlinuz-2.4.20-8

3 of em use root=LABEL=/ hdb=ide-scsi

but why only vmlinuz-2.4.20-28.9custom01 can't boot up while the rest work just fine ??

linx win 01-30-2004 09:40 AM

heister

Don't worry. your problem is very easy one. Just do the following:

instead of: ............ root=LABEL=/ hdb=ide-scsi
Put : ............ root=/dev/hdax hdb=ide-scsi

I mean change LABEL=/ to /dev/hdax after substituting for the X with right number. Where /dev/hdax is your root partition. It will work. I had the same when I upgraded to kernel 2.6.0 and this resolved the problem.

Echs Bochs

You probably have the same problem. If you still have the problem with the USB devices you just need to copy the content of your /etc/modutil.conf content to /etc/modprob.conf and save it. I recommend that you install fresh copy of Fedora Core 1 and upgrade it to kernel 2.6.1 and you will not see any of these problems except the the one I explained above to heister. moreover, to upgrade to kernel 2.6.0 just follow the insallation procedure mentioned in the install file which says after installing the modules just do make install and it will do the rest and do not bother your self with the steps mentioned at the beginning of this thread(with my apologies for DrOzz).

Look here for more info:

http://www.linuxquestions.org/questi...3&goto=newpost

Wish you good luck

Echs Bochs 01-30-2004 04:19 PM

I've heard Fedora is the better alternative to RHx... *begins download*

sirpelidor 02-01-2004 08:43 PM

if i'm happy with the current kernel version, and i just wanna make a few changes. will only doing: make xconfig, make dep, make modules, make modules_install enough?

or i will have to do the whole rm -rf System.map, rm -rf vmlinuz....

ln -s new links, etc etc??

(and all those after work)?

linx win 02-03-2004 04:01 AM

Last night, I recompiled my old kernel 2.4.22 to enable some moudles. I did all steps up to make install. The system was installed correctly without the need to do extra steps mentioned at the beginning of this thread. The answer to your question if you are using FC1 (Fedora Core 1), is no need just do make install after doing make modules_install.

Look, I am a newbie also, so please take my recommendations considering this fact.

G24 02-06-2004 04:44 PM

2.6.2 came out and right now I'm running 2.6.1 but i don't want to download the 33mb kernel all over again how can I get a hold of the patches like wise install them.

djbokkeman 02-06-2004 05:55 PM

Im runing suse 9.x . but i can't find the /usr/src/linux
Only thing the directory /usr/src/ lists is packages. so im stuck in the start of the tutorial. Thnx!

sirpelidor 02-06-2004 08:08 PM

go to your installation disc , look for kernel source. install it, and then you will see /usr/src/linux ....

rberry88 02-06-2004 09:02 PM

Actually if you look in /lib/modules/ you will see your linux-2.x.x kernel in Suse. I don't know why they decided to put them there by default on a new install but thats where I found mine. Makes for a pretty big headache if you ask me.


rberry88

G24 02-06-2004 09:08 PM

Can someone help me?
My mouse won't work under 2.6.2 but it works in 2.6.1

heister 02-07-2004 02:50 AM

hello guys !
sorry for the late reply because i've been busy with my work lately.

anyway, the problem i was facing last time was solved.
it didn't concern the grub.conf setting actually.
before i went into the xconfig menu, just copied the config-<kernel-ver> file from the /boot directory into the kernel source directory, and then load it when i was in xconfig menu. it showed the latest and stable setting for my kernel..in there, i enabled all my usb support and scsi adapter. the rest leave unchanged.

after that, recompile and install it...the automated program "make install" will take care of the grub.conf....i got a clean boot up for my custom compiled kernel.

so the idea here is remember to load ur most current stable kernel config in the xconfig menu, everything should be fine. (at least it worked for me =P)

Regards.

benjaminrtz 02-07-2004 04:18 AM

Very helpful!!!
Since I am lazy, I just do make install !!
I heard even make will do make bzImage!

adamjaskie 02-08-2004 12:43 AM

Has anyone gotten 2.6.2 working with the newest ATI binary drivers? (3.7 iirc)

I cannot get it to work, and am wondering what steps you took. When I type startx, I just get a blank black screen. It worked fine under 2.4 (and still does.) I did indeed compile the kernel modules for the ATI driver for 2.6.


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