You are not logged in.

#1 2010-08-06 16:20:05

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

[SOLVED] Customized kernel problems

I've decided to try to edit a stock kernel found here so it has only the necessary stuff for my laptop. First I gathered a system info from lspci -n, pasted it in a Debian HCL, and got my hardware list.
Then I extracted the kernel, cd'ed to it, and did a 'make menuconfig', which produced my custom config file (according on what I've chosen). I saved that file and created a PKGBUILD.
Then I issued a makepkg and it built the package without warnings (except the une about that $srcdir is being used or something, but I've seen that on kernel26-ice too, so...).
When I installed it with pacman -U it had some errors, but I tried to boot it and it, sure, gave those errors:

Root device '/dev/sda1' doesn't exist. Attempting to create it.
ERROR: Unable to determine major/minor of root device
You are being dropped to a recovery shell
    Type 'exit' to try and continue booting
/bin/sh: can't access tty; job control turned off
[ramfs /]#

Can it be cause of the pacman -U errors? I've tried asking on some irc channels, and they told that maybe there's some file system drivers missing (although I have all the modules chosen in a config file which are in lsmod atm (like ata_piix)). Here are also the sdparm and lspci -vv outputs.

If anyone has any experience with this stuff or just an idea, please reply. Thank you. smile

Last edited by archman-cro (2010-08-07 23:54:03)

Offline

#2 2010-08-06 18:18:44

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: [SOLVED] Customized kernel problems

I don't use PKGBUILD for kernel as it is useless and does nothing except one script over another, however your problem in my opinion lies in these errors:
#
FATAL: Could not load /lib/modules/2.6.34-nx6310/modules.dep: No such file or directory
#
find: `/lib/modules/2.6.34-nx6310': No such file or directory

this leads to disk and fs modules not being loaded.

on the side note do you have RAID on your laptop?

Offline

#3 2010-08-06 19:12:21

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

broch, I went through BIOS settings and the only suspicious thing I see there is: 'SATA Native Mode - Disabled'.
Also, I went through official laptop specs (nx6310 ey588es) and there was nothing about RAID.

Offline

#4 2010-08-06 20:17:49

thn81
Member
Registered: 2009-08-27
Posts: 88

Re: [SOLVED] Customized kernel problems

CONFIG_LOCALVERSION must be set to "-nx6310" in your .config file, otherwise mkinitcpio won't find the modules for the initrd. You'll have to recompile the kernel with the correct CONFIG_LOCALVERSION set.

Offline

#5 2010-08-06 22:46:14

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: [SOLVED] Customized kernel problems

I've been compiling kernels like mad over the past few days (due to ACPI problems), and I've been using PKGBUILD without a problem. The steps are laid out here http://goo.gl/gD5E

I've used the PKGBUILD and kernel26.install written there and it works without a problem.

But I think thn81 is right about correctly setting CONFIG_LOCALVERSION. It must match the name of the kernel in PKGBUILD/kernel26.install

Offline

#6 2010-08-07 01:00:22

combuster
Member
From: Serbia
Registered: 2008-09-30
Posts: 711
Website

Re: [SOLVED] Customized kernel problems

Strangely enough when I compile kernel from the default config and start customizing it - I get the same error. When I use .config from my previous kernel build (2.6.34) and do make oldconfig and then compile 2.6.35 then it works without a glitch. Havent found a reason for this behaviour yet sad

Offline

#7 2010-08-07 01:03:53

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

thn81, thanks for this! But it didn't solve the problem, unfortunately.

kcirick, thanks for LOCALVERSION, too, but the pkgbuild from that wiki is outdated [edit: my wrong interpretation, it is NOT outdated!] and doesn't serve my needs [again...].

broch, there's definitely a problem in that one. I should just rewrite my PKGBUILD, cause I might've screwed some variables, as I've used both stock and kernel26-ice PKGBUILDs as examples. I'll report back here when I get it done.

If anyone has any further ideas, please tell! big_smile

combuster, I'll try the recent kernel. smile

Last edited by archman-cro (2010-08-07 15:53:32)

Offline

#8 2010-08-07 01:40:39

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: [SOLVED] Customized kernel problems

Um, I've used pkgbuild from the wiki to compile 2.6.34.2 and it worked for me. As far as I know, the wiki information isn't really outdated aside from the versions they use for examples. Why doesn't it serve your needs? what's special about your kernel?

Offline

#9 2010-08-07 03:25:41

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: [SOLVED] Customized kernel problems

CONFIG_LOCALVERSION suggestion is wrong

you don't need to get latest kernel as your problem is related to PKGBUILD, however latest is.. latest

your config needs more work but this will come in time. I would suggest to build at least once config from scratch. If it will be specific for your hardware you will get less problems when re-using it between kernel versions

Because you are setting up kernel on laptop, I would suggest to enable NO_HZ, this will prevent overheating and keep battery longer.

Sorry that I cant help with PKGBUILD, as I mentioned I don't it at all for custom kernels, but most users do so hopefully someone will help.

good luck

Offline

#10 2010-08-07 09:42:21

combuster
Member
From: Serbia
Registered: 2008-09-30
Posts: 711
Website

Re: [SOLVED] Customized kernel problems

Ok, watch out for this:

ls /lib/modules
2.6.34.2-DELL  2.6.35-DELL

Maybe you need to do mkinitcpio -k 2.6.34.2-nx6310 -g /boot/kernel26-whatever.img

What is the contents of your /lib/modules directory ?

Offline

#11 2010-08-07 11:37:40

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

broch, I have built this config I provided from scratch (with make menuconfig in 2.6.34.2), and yes, there's NO_HZ enabled already.

combuster, ls /lib/modules doesn't give the -nx6310 one, which is normal, cause it's not installed. I guess I should create it by putting some code in the PKGBUILD. I think that the whole this problem lies exactly here. The strange thing in -ice (using -ice as an example for my setup) is that it DOES create that folder (/lib/modules/$icever, icever being 2.6.34-ice) but under the scope of " if [ "$keep_source_code" = "1" ];" AND when I built it, the 'keep_source_code' was 0! Means it ignores that part from 'if' to 'fi'. Am I wrong here?

I should definitely try to include this mkdir command somewhere.

kcirick, actually I didn't really mean to say that "it doesn't serve my needs", but it looks too slim when compared to the generic 2.6.34.2 pkgbuild. I know the size isn't important (lines, in this case big_smile) but it's, imo, better to use a generic or -ice pkgbuild and edit them with my info. I should also try looking at your advice, anyway, cause that's writing from the scratch, actually. I'll get to it at some point. Thanks! smile

Offline

#12 2010-08-07 14:10:29

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

I've tried adding

cd $startdir
mkdir -p $pkgdir/usr/src || return 1
cp -a ${srcdir}/linux-$pkgver $pkgdir/usr/src/linux-$nxver || return 1

#Add a link from the modules directory
mkdir -p $pkgdir/lib/modules/$nxver || return 1
cd $pkgdir/lib/modules/$nxver || return 1
rm -f source
ln -s ../../../usr/src/linux-$nxver source || return 1

and then the 'FATAL: Could not load /lib/modules/2.6.34-nx6310/modules.dep: No such file or directory' disappears and builds ok, but then when installing I get:

==> Building image "default"
==> Running command: /sbin/mkinitcpio -k 2.6.34-nx6310 -c /etc/mkinitcpio.conf -g /boot/kernel26-nx6310.img
:: Begin build
ERROR: module 'lzo' not found
:: Parsing hook [base]
:: Parsing hook [udev]
:: Parsing hook [autodetect]
:: Parsing hook [pata]
:: Parsing hook [scsi]
:: Parsing hook [sata]
:: Parsing hook [resume]
:: Parsing hook [filesystems]
:: Generating image '/boot/kernel26-nx6310.img'...SUCCESS
==> SUCCESS
==> Building image "fallback"
==> Running command: /sbin/mkinitcpio -k 2.6.34-nx6310 -c /etc/mkinitcpio.d/kernel26-nx6310-fallback.conf -g /boot/kernel26-nx6310-fallback.img -S autodetect
:: Begin build
ERROR: module 'ata_generic' not found
ERROR: module 'ata_piix' not found
ERROR: module 'uvesafb' not found
:: Parsing hook [base]
:: Parsing hook [udev]
:: Parsing hook [pata]
:: Parsing hook [scsi]
:: Parsing hook [sata]
:: Parsing hook [usbinput]
:: Parsing hook [filesystems]
:: Generating image '/boot/kernel26-nx6310-fallback.img'...SUCCESS
==> SUCCESS
Optional dependencies for kernel26-nx6310
    crda: to set the correct wireless channels of your country

I guess I can ignore the fallback part (but it's strange why I get those errors, cause ata_generic and ata_piix is enabled as a module in make menuconfig), but when I boot in it, I get the same error as before. ('/dev/sda1' not found)

Offline

#13 2010-08-07 15:19:32

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

kcirick, I've tested your advice and everything went well! It found my disk, but it failed later, cause it couldn't find the KMS stuff, so I guess I need to reconfigure and add something. Thanks for your advice!
The battle continues. big_smile I need to find that logs to see where it exactly failed...

Last edited by archman-cro (2010-08-07 15:27:13)

Offline

#14 2010-08-07 15:39:07

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: [SOLVED] Customized kernel problems

Good luck! Let me know if you find anything fishy...

Offline

#15 2010-08-07 16:11:22

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

I'm here in my new kernel. smile Fast boot it was. BUT! When it read some modules, my screen went black, and i needed to login blindly. After startx, the screen was fine, I could see everything properly. Any ideas?

Offline

#16 2010-08-07 19:23:34

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

Btw, anyone feels that localmodconfig picks too much unnecessary stuff? It has picked radeon stuff for my system, although I use i945...some radio stuff (?) and many others...

Last edited by archman-cro (2010-08-07 19:25:02)

Offline

#17 2010-08-07 23:53:32

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [SOLVED] Customized kernel problems

I did it! It runs good! I have used localmodconfig (pretty much the safe option). Still, I need to learn how to patch the kernel with tuxonice and official patches.
Cheers, and thanks everyone for the help!
I will mark the thread as solved, but I will post other questions here, so I don't have to make multiple useless threads.

Offline

#18 2010-08-08 00:12:41

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: [SOLVED] Customized kernel problems

I'm glad your custom kernel works (almost?) perfectly! Have fun

Offline

Board footer

Powered by FluxBB