View Full Version : Kernel configuration file ignored?
Hello all,
I've just tried to compile and install a new kernel in FBSD 7.0.
However, the /boot/kernel.old/kernel and boot/kernel/kernel files are exactly the same size: 9219468 bytes.
This is what I did:
I edited a copy of the GENERIC kernel configuration file and named it P200MMX. It is in /usr/src/sys/i386/conf . (BTW, are numbers allowed in the configuration file name?)
Then I used the following commands:
cd /usr/src
make buildkernel KERNCONF=P200MMX
make installkernel KERNCONF=P200MMX
I rebooted and the GENERIC kernel appeared to be used, not P200MMX.
uname -i ...shows: GENERIC.
I didn't notice any error messages in the whole process. The pc boots normally, but apparently not using P200MMX.
Any help is appreciated.
Thanks,
Frits
cajunman4life
06-24-2008, 10:09 PM
It appears you made a copy of GENERIC without changing anything. You need to open the file P200MMX in your favorite editor, and change the "ident" line to whatever you want your kernel to identify itself as. As far as the kernel and kernel.old being the same size, that's expected as you haven't change any configuration at all.
I suspect that if you type "uname -a", you'll see generic, but you'll also see towards the end something like:
root@<your hostname here>:/usr/obj/usr/src/sys/P200MMX
Carpetsmoker
06-24-2008, 10:26 PM
You might also want to post the kernel config you used...
Hi,
Thanks for your swift reply.
It appears you made a copy of GENERIC without changing anything. You need to open the file P200MMX in your favorite editor, and change the "ident" line to whatever you want your kernel to identify itself as. [/CODE]
I've done exactly what you describe above. I did copy GENERIC to P200MMX, and then edited a lot in P200MMX. (I also changed the ident line to P200MMX, and finally I didn't forget to save the file P200MMX.)
I suspect that if you type "uname -a", you'll see generic, but you'll also see towards the end something like:
root@your hostname:/usr/obj/usr/src/sys/P200MMX
uname -a shows:
root@<my hostname here>:/usr/obj/usr/src/sys/GENERIC i386
At the moment I'm unable to show you the kernel configuration file, because I don't know yet how to transfer it to my Win PC, which I'm using now. However I used the directions in 8.5 The Configuration File (http://www.freebsd.org/doc/en/books/handbook/kernelconfig-config.html) only. (I used conservative settings intended for a simple workstation, not a server or anything fancy). As said, there were no error warnings during the whole process.
(I don't know whether it is of any importance, but I just noticed that I forgot to add the "machine i386" line to P200MMX. It wasn't in GENERIC either though.)
Thanks again for your suggestions.
Hello,
Just a thought: did I have to move P200MMX from /usr/src/sys/i386/conf to another directory before using the commands "make buildkernel KERNCONF=P200MMX" and "make installkernel KERNCONF=P200MMX"?
Cheers
Carpetsmoker
06-24-2008, 11:49 PM
No, /usr/src/sys/i386/conf is where the file should be.
In any case, if you specify a kernel config that does not exist the build process will halt:
[/usr/src]# make kernel KERNCONF=adasda
ERROR: Missing kernel configuration file(s) (adasda).
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.
Exit 1
[/usr/src]#
Is the KERNCONF argument actually being passed correctly? What is the output of:
make -V KERNCONF kernel KERNCONF=P200MMX
Carpetsmoker
06-24-2008, 11:57 PM
Hm, should work fine ... Maybe you accidently types KERNCONf or something?
If you build the kernel, you can immediatly see which config file it's using, just press CTRL+C after ~1-2 seconds:
[/usr/src]# make buildkernel KERNCONF=PHONG
--------------------------------------------------------------
>>> Kernel build for PHONG started on Wed Jun 25 00:58:47 CEST 2008
--------------------------------------------------------------
===> PHONG
mkdir -p /usr/obj/usr/src/sys
--------------------------------------------------------------
>>> stage 1: configuring the kernel
--------------------------------------------------------------
cd /usr/src/sys/i386/conf; PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin config -d /usr/obj/usr/src/sys/PHONG /usr/src/sys/i386/conf/PHONG
Kernel build directory is /usr/obj/usr/src/sys/PHONG
Don't forget to do ``make cleandepend && make depend''
--------------------------------------------------------------
>>> stage 2.1: cleaning up the object tree
--------------------------------------------------------------
^C
[/usr/src]#
I started "make buildkernel KERNCONF=P200MMX" again. And stopped it using Ctrl-C.
It is showing : "Kernel build directory is /usr/obj/usr/src/sys/P200MMX"
And also: "Kernel build for P2000MMX started on Wed Jun 25 01:04:48 CEST 2008"
Well, it is compiling again. Maybe it works this time. Previously, the compiling process took about 9 hours on this machine... I've also added the "machine i386" line to P200MMX, BTW.
Currently I see a lot of references to P200MMX passing over the screen. This wasn't the case the previous time. Looks promising :-)
Thank you for your help,
Frits
Carpetsmoker
06-25-2008, 12:30 AM
9 hours O.o
You know you can build the kernel on a faster i386 machine and then transfer it to this machine?
cajunman4life
06-25-2008, 12:35 AM
Also, IIRC the MMX was i586-class, so you should be able to remove i386 and i486 from your config file. I have a P-MMX 200MHz myself, unfortunately it's disconnected from KVM/network/etc, and I don't have the energy to connect it right now (read: I'm being lazy). However, I didn't build a custom kernel on this machine (as it would take forever to build). I used freebsd-update to make sure I had the latest security patches, and left it at that.
9 hours O.o
You know you can build the kernel on a faster i386 machine and then transfer it to this machine?
Yes, I read about it, but I don't have a faster PC running FreeBSD available at the moment. Anyway, it is bedtime for me here in Europe. The compiling will be ready in the morning.
Cheers,
Frits
Carpetsmoker
06-25-2008, 12:46 AM
Also, IIRC the MMX was i586-class, so you should be able to remove i386 and i486 from your config file.
MMX is a CPU instruction set, it can be implemeted on any CPU and says nothing about the CPU class.
But his machine is indeed probably a i586.
You can check with:
% dmesg | grep CPU
CPU: AMD Athlon(tm) XP (1252.85-MHz 686-class CPU)
cajunman4life
06-25-2008, 01:16 AM
MMX is a CPU instruction set, it can be implemeted on any CPU and says nothing about the CPU class.
You are correct, but given my assumption that by his naming the config "P200MMX" he had a Pentium MMX 200MHz, which is exactly the same as I have on one of my machines.
I should have worded better I guess ;)
When making my above comment, I was referring to what I imagine is the CPU he was using (see my previous statement).
phoenix
06-25-2008, 05:10 AM
(I don't know whether it is of any importance, but I just noticed that I forgot to add the "machine i386" line to P200MMX. It wasn't in GENERIC either though.)
This line is not needed, and the build system really should have complained about it being included twice. The FreeBSD 7.0 kernel build system automatically includes the contents of /usr/src/sys/<arch>/conf/DEFAULTS into the kernel config file. "machine i386" is in the DEFAULTS file. Anything in that file, does not need to (and should not) be in the kernel config file.
Also, with any CPU newer than an i386, you should remove the cpu i386 line. For any CPU newer than an i486, you should remove the cpu i386 and cpu i486 lines.
But, for all other x86 CPUs (Pentium, PPro, P2, P3, P4, Athlons, etc), you should keep the cpu i586 line (and add cpu i686 if appropriate). There are a bunch of memory operations that are included by the i586 option that speed things up on everything since the Pentium.
Hello,
The P200MMX kernel is installed successfully now. The kernel has shrunk to 3464821 bytes, which is nice compared to GENERIC's original 9219468 bytes. The PC is running fine. I still don't know what went wrong at the first try though.
Cheers,
Frits
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.