Click to See Complete Forum and Search --> : questions on compiling yer own kernel
MDesigner
07-06-2004, 12:14 PM
I've decided that compiling my own is the way to go. The 2.6.7 kernel that comes with Slackware 10.0 wasn't compiled with ACPI I don't think..and if it was compiled as a module, I'm not really sure how to enable that option.
I have a few questions about compiling the kernel..
In the menuconfig, you can choose modules as built-ins, or regular modules. I assume that with built-in, you just boot normally and you get that module immediately. What about if you just choose it as "M" (module) in menuconfig? How do you: a) know what the module is called so you can load it later, and b) how do you actually load the module up??
But let's assume that the 2.6.7 kernel on Slackware 10 CD2 was compiled with ACPI as an optional module.. and to turn it on, you would do "linux acpi=on" at the startup prompt. What if I just wanted to modify my lilo.conf to have acpi automatically..how would I do that?
Thanks for any help!
ph34r
07-06-2004, 12:35 PM
A simple "modprobe acpi" should work... Or you could add a line in lilo.conf like
append="acpi=on"
Or you could add a call to load the module in /etc/rc.d/rc.modules...
Or in rc.local...
Or....
MDesigner
07-06-2004, 01:09 PM
opus:/home/samh# modprobe acpi
WARNING: Error inserting processor (/lib/modules/2.6.7/kernel/drivers/acpi/processor.ko): No such device
FATAL: Error inserting acpi (/lib/modules/2.6.7/kernel/arch/i386/kernel/cpu/cpufreq/acpi.ko): Unknown symbol in module, or unknown parameter (see dmesg)
Which is weird, because the .config file for the Slackware 10 2.6.7 kernel has values of "y" for all the CONFIG_ACPI_ options.
But if it's "y", then that means I should probably use acpi=on during boot.. right? If the value were "m" then I would use modprobe to load it, correct? But as an example, CONFIG_ACPI_BUTTON is "m".. and this fails:
opus:/home/samh# modprobe button
FATAL: Error inserting button (/lib/modules/2.6.7/kernel/drivers/acpi/button.ko): No such device
Any ideas?
rbrimhall
07-06-2004, 02:22 PM
You're modprobing as root, right? I built all of my acpi stuff into the kernel rather than as modules. If I remember correctly, the toshiba and asus stuff would often cause problems with other acpi modules if you weren't using a computer that needed them. Also, I would compile without apm entirely.
MDesigner
07-06-2004, 02:56 PM
thanks for the tips. I'll post here the results of booting on my compiled kernel.
Side note: With the 2.6.7 kernel included in Slackware 10, ACPI does not seem to work. I booted with acpi=on, and I dmesg shows a bunch of errors:
shpchp: acpi_shpchprm:get_device PCI ROOT HID fail=0x1001
pciehp: acpi_pciehprm:get_device PCI ROOT HID fail=0x1001
shpchp: acpi_shpchprm:get_device PCI ROOT HID fail=0x1001
pciehp: acpi_pciehprm:get_device PCI ROOT HID fail=0x1001
shpchp: acpi_shpchprm:get_device PCI ROOT HID fail=0x1001
pciehp: acpi_pciehprm:get_device PCI ROOT HID fail=0x1001
shpchp: acpi_shpchprm:get_device PCI ROOT HID fail=0x1001
pciehp: acpi_pciehprm:get_device PCI ROOT HID fail=0x1001
[etc. etc. blah blah]
Gonna try my own brew now.. :)
MDesigner
07-06-2004, 03:17 PM
Well, my own kernel failed...
Kernel panic: VFS: Unable to mount root fs on hda1
I'll have to research this & figure out what I did wrong.
Pafnoutios
07-06-2004, 03:25 PM
Did you compile in support for your root filysystem? A lot of distributions compile filesystems as modules and use an initial ramdisk to load the modules before mounting the root partition. If you're compiling your own kernel, you should compile directly into the kernel all of the filesystems you mount on boot and will probably want to compile in the ones you use regularly (like ISO).
goon12
07-06-2004, 03:36 PM
Originally posted by MDesigner
Well, my own kernel failed...
Kernel panic: VFS: Unable to mount root fs on hda1
I'll have to research this & figure out what I did wrong.
Check this out..
http://slackware.osuosl.org/slackware-current/testing/packages/linux-2.6.7/README.initrd
-goon12
MDesigner
07-06-2004, 03:43 PM
Ahhh, yeah.. the initrd. That worked fine.
Woops.. yeah, ReiserFS was "M" in my .config.. instead of "Y".
MDesigner
07-06-2004, 03:43 PM
ARGH. Why did the kernel upgrade destroy my /etc/motd file?
rbrimhall
07-06-2004, 03:46 PM
Remember to uncomment in the Makefile the export kernel install path=/boot option or the kernel won't get installed... just in case you didn't do this... it's killed me a couple of times when I couldn't figure out why my brand new mm-1 kernel still said 2.6.7 with uname -r... duuhhh...
MDesigner
07-06-2004, 03:47 PM
Originally posted by lupin_the_3rd
Remember to uncomment in the Makefile the export kernel install path=/boot option or the kernel won't get installed... just in case you didn't do this... it's killed me a couple of times when I couldn't figure out why me brand new mm-1 kernel still said 2.6.7 with uname -r... duuhhh...
Thanks lupin :) yeah, I did uncomment that line out. And I double-checked the modification date of /boot/vmlinuz, and it was right after I did "make install."
The problem was, I forgot to compile reiserfs into my kernel.
OK so let me see if I got this down:
- compile stuff into your kernel if you're sure you always want it there 24/7
- compile stuff as modules if you want the ability to disable/enable them (using mkinitrd's -m option, then pointing the lilo entry to initrd.gz)
- use modprobe to invoke modules on-demand at any time
rbrimhall
07-06-2004, 04:00 PM
The above is what I do... I ususually compile in some of the device drivers because I'm not sure exactly which one my hardware uses (My cd-rom for instance)... always compile alsa as modules so you can update the modules wiithout a kernel recompile.
MDesigner
07-06-2004, 04:07 PM
Damn, I still see these acpi errors in dmesg:
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
i8xx TCO timer: initialized (0x0460). heartbeat=30 sec (nowayout=0)
shpchp: acpi_shpchprm:get_device PCI ROOT HID fail=0x1001
pciehp: acpi_pciehprm:get_device PCI ROOT HID fail=0x1001
hw_random hardware driver 1.0.0 loaded
shpchp: acpi_shpchprm:get_device PCI ROOT HID fail=0x1001
pciehp: acpi_pciehprm:get_device PCI ROOT HID fail=0x1001
And I didn't compile APM into the kernel this time. Hmm, maybe this computer doesn't support ACPI.. it's a Dell Dimension 4100, around 800MHz, 64MB RAM. I didn't see any APM/ACPI options in the BIOS at all, so I don't know.. maybe I'll try this at home on a laptop that has ACPI for sure.
MDesigner
07-06-2004, 04:08 PM
Originally posted by lupin_the_3rd
The above is what I do... I ususually compile in some of the device drivers because I'm not sure exactly which one my hardware uses (My cd-rom for instance)... always compile alsa as modules so you can update the modules wiithout a kernel recompile.
How do you compile certain modules into the kernel, besides using "make menuconfig"? Is there a different and/or better way?
rbrimhall
07-06-2004, 04:26 PM
make xconfig
make gconfig
If that's what you mean...
I always just use make menuconfig though...
MDesigner
07-06-2004, 04:41 PM
OK. And if when I boot, I do something like:
boot> linux acpi=on
Where is it looking for acpi support? In initrd.gz? Or in the kernel? Or in /lib/modules? What if I compile ACPI into the kernel...then do I need the acpi=on or not?
bwkaz
07-06-2004, 06:58 PM
ACPI is newer than APM. ACPI is required to get power management support for a lot of new notebook computers, and it's just generally better (IN 2.6 ONLY -- 2.4's ACPI support is pretty bad) than APM.
The unresolved symbols are because your ACPI processor.ko module failed to load (because it says you don't have either any ACPI capable processors, or any processors that support frequency scaling via ACPI). The <stuff>/kernel/arch/i386/kernel/cpu/cpufreq/acpi.ko module looks like it's exclusively for processor related ACPI stuff (specifically, scaling back the processor speed at runtime, a la Intel's XScale (at least I think that's what it's called)).
Basically, you're loading the wrong module. To see if you even need to load anything, look for a /proc/acpi directory. If it's there, then you have basic ACPI support already. If not, then your kernel was not compiled with ACPI support turned on (it is impossible to make it a module, at least in kernel 2.6.6 from kernel.org).
MDesigner
07-06-2004, 06:59 PM
Another question.. I have a laptop at home that's got a Lucent Orinoco PCMCIA 802.11b card in it. How do I compile the 2.6.7 kernel so those drivers (or heck, all 802.11b drivers, just to be safe) are in the kernel? I didn't see the Orinoco in the menuconfig, but I did see it in the module list (orinoco and orinoco_cs, not sure what the difference is).
And once that's compiled into the kernel, do I just boot up with no options and it's ready to go right away? (after a netconfig of course)
bwkaz
07-06-2004, 07:02 PM
Please do not double post messages. I am moving my reply to your other post on this issue into this thread, then removing that other post (since nobody else responded).
Basically, the kernel config won't let you compile ACPI as a module.
rbrimhall
07-06-2004, 07:16 PM
Originally posted by MDesigner
Another question.. I have a laptop at home that's got a Lucent Orinoco PCMCIA 802.11b card in it. How do I compile the 2.6.7 kernel so those drivers (or heck, all 802.11b drivers, just to be safe) are in the kernel? I didn't see the Orinoco in the menuconfig, but I did see it in the module list (orinoco and orinoco_cs, not sure what the difference is).
And once that's compiled into the kernel, do I just boot up with no options and it's ready to go right away? (after a netconfig of course)
I think it's the prism2 or the lucent categories.... I just put all in to be safe ;)
MDesigner
07-06-2004, 07:56 PM
Originally posted by bwkaz
Basically, the kernel config won't let you compile ACPI as a module.
What do you mean exactly? I was able to choose ACPI options from the menuconfig.
bwkaz
07-06-2004, 09:36 PM
I mean that menuconfig looks like this, under Power management options (ACPI, APM) -> ACPI (Advanced Configuration and Power Interface) Support (it's configured the way my kernel is set up):
ACPI Support
[ ] Sleep States (EXPERIMENTAL)
< > AC Adapter
< > Battery
<M> Button
<M> Fan
< > Processor
< > ASUS/Medion Laptop Extras
< > Toshiba Laptop Extras
[ ] Debug Statements
[ ] Power Management Timer Support The ACPI Support option (at the top) cannot be selected as a module; it only supports Y or N. That's why it's surrounded by square brackets instead of angled ones. At least in kernel 2.6.6 from kernel.org (maybe your distro patched your sources to support ACPI as a module? or maybe newer kernels have the option of making it a module?).
On the other hand, the APM setting (Power management options (ACPI, APM) -> APM (Advanced Power Management) BIOS support) looks like:
< > APM (Advanced Power Management) BIOS support which can be selected as a module (apm.ko).
Likely this is because ACPI is used to power on the machine, so it's needed before modules can be loaded. Though I'm not 100% sure on that.
I misspoke earlier, also. I was talking about "specifically, scaling back the processor speed at runtime, a la Intel's XScale (at least I think that's what it's called)" -- it's not called XScale (that's Intel's ARM compatible CPU for handheld devices). It's called SpeedStep. :o
MDesigner
07-08-2004, 07:56 AM
I'm done with this business of compiling the kernel. :) It takes toooo long, and isn't worth the time. I'll just use the 2.6.7 kernel on the Slackware CD2, and use an initrd to add in extra modules I want. Much easier that way.
I'm still not clear on a couple things regarding modules: if I put a module into the initrd.gz, then obviously there's no reason for it to be in /etc/rc.d/rc.modules. Do I have to check for it there and remove it myself? Say I move all the PCMCIA stuff into the initrd.. how do I locate all/any scripts that might be using modprobe to load PCMCIA support?