Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
building kernel won't create modules [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Sun Jun 05, 2005 2:27 am    Post subject: building kernel won't create modules [SOLVED] Reply with quote

I followed the Gentoo handbook for building a new kernel, but despite the fact that everything seems to work, I don't get any kernel modules???

emerge kernel-source (2.6.11-gentoo-r9)
created soft link for /usr/src/linux
cd /usr/src/linux
make menuconfig (several items marked as Module)
make && make modules_install

Code:
 
CHK     include/linux/version.h
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
  CHK     include/linux/compile.h
  CHK     usr/initramfs_list
Kernel: arch/i386/boot/bzImage is ready
  Building modules, stage 2.
  MODPOST
if [ -r System.map ]; then /sbin/depmod -ae -F System.map  2.6.11-gentoo-r9; fi


make looked to complete without any errors and I can see a kernel image at arch/i386/boot/bzImage, but /lib/modules/2.6.11-gentoo-r9/kernel/ is empty.

Any ideas what's happening?
Thanks.


Last edited by eatmore on Tue Jun 07, 2005 3:26 am; edited 1 time in total
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Sun Jun 05, 2005 2:41 am    Post subject: Reply with quote

Quote:
make looked to complete without any errors and I can see a kernel image at arch/i386/boot/bzImage, but /lib/modules/2.6.11-gentoo-r9/kernel/ is empty.

Empty? As in completely? Do you have any other kernels in /lib/modules/ ? What's the output of " ls -l /lib/modules/ " and " ls -l /lib/modules/2.6.11-gentoo-r9/ "?
Back to top
View user's profile Send private message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Sun Jun 05, 2005 3:03 am    Post subject: Reply with quote

/lib/modules/2.6.11-gentoo-r9/kernel/ is completely empty.
I do have a plain kernel (2.6.8.1) that I got seperately (no emerge) and it did work properly. /lib/modules/2.6.8.1/kernel/ has lots of directories and .ko files. I wanted a more recent kernel so I tried to emerge one. Could there be some conflict between the two?

Code:
ls -l /usr/src/linux
lrwxrwxrwx  1 root root 22 Jun  4 18:35 /usr/src/linux -> linux-2.6.11-gentoo-r9/

ls -l /lib/modules/
total 0
drwxr-xr-x  3 root root 424 Jun  4 19:22 2.6.11-gentoo-r9/
drwxr-xr-x  3 root root 424 Jun  3 23:17 2.6.8.1/

ls -l /lib/modules/2.6.11-gentoo-r9/
total 32
lrwxrwxrwx  1 root root  31 Jun  4 18:06 build -> /usr/src/linux-2.6.11-gentoo-r9/
drwxr-xr-x  2 root root  48 Jun  4 19:22 kernel/
-rw-r--r--  1 root root  45 Jun  4 19:22 modules.alias
-rw-r--r--  1 root root  69 Jun  4 19:22 modules.ccwmap
-rw-r--r--  1 root root   0 Jun  4 19:22 modules.dep
-rw-r--r--  1 root root  73 Jun  4 19:22 modules.ieee1394map
-rw-r--r--  1 root root 132 Jun  4 19:22 modules.inputmap
-rw-r--r--  1 root root  81 Jun  4 19:22 modules.isapnpmap
-rw-r--r--  1 root root  99 Jun  4 19:22 modules.pcimap
-rw-r--r--  1 root root  49 Jun  4 19:22 modules.symbols
-rw-r--r--  1 root root 189 Jun  4 19:22 modules.usbmap
lrwxrwxrwx  1 root root  31 Jun  4 19:22 source -> /usr/src/linux-2.6.11-gentoo-r9/

ls -l /lib/modules/2.6.11-gentoo-r9/kernel/
total 0
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Sun Jun 05, 2005 3:07 am    Post subject: Reply with quote

Bizarre! What's ls -l /usr/src/ give ya?

EDIT:
Try
mount /boot # if it's not already
cd /usr/src/linux
# backup your config file
cp .config /boot/kernel-2.6.11-gentoo-r9-backup
make mrproper
make menuconfig # check settings and adjust accordingly if needed
make && make menuconfig

Do you have the modules dir now?
Back to top
View user's profile Send private message
jmbsvicetto
Moderator
Moderator


Joined: 27 Apr 2005
Posts: 4734
Location: Angra do Heroísmo (PT)

PostPosted: Sun Jun 05, 2005 3:37 am    Post subject: Reply with quote

Hi.

If you want to try overkill suggestion without having to manually select all options in the kernel, you can copy your config file back to .config after doing the mrproper and then do the usual make && make modules_install.
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Sun Jun 05, 2005 3:45 am    Post subject: Reply with quote

Thanks jmbsvicetto! It must be past my bedtime!
Back to top
View user's profile Send private message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Sun Jun 05, 2005 5:57 pm    Post subject: Reply with quote

Thanks for the advice but I'm still not getting anything - even running make mrproper first didn't help.
There are no .ko files created during the build.
Here's the tail end of the build if it helps.

Code:
make && make modules_install
...
  CC      lib/string.o
  CC      lib/vsprintf.o
  AR      lib/lib.a
  CC [M]  lib/crc-ccitt.o
  CC [M]  lib/libcrc32c.o
  LD      arch/i386/lib/built-in.o
  CC      arch/i386/lib/bitops.o
  AS      arch/i386/lib/checksum.o
  CC      arch/i386/lib/dec_and_lock.o
  CC      arch/i386/lib/delay.o
  AS      arch/i386/lib/getuser.o
  CC      arch/i386/lib/memcpy.o
  CC      arch/i386/lib/strstr.o
  CC      arch/i386/lib/usercopy.o
  AR      arch/i386/lib/lib.a
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  AS      arch/i386/boot/bootsect.o
  LD      arch/i386/boot/bootsect
  AS      arch/i386/boot/setup.o
  LD      arch/i386/boot/setup
  AS      arch/i386/boot/compressed/head.o
  CC      arch/i386/boot/compressed/misc.o
  OBJCOPY arch/i386/boot/compressed/vmlinux.bin
  GZIP    arch/i386/boot/compressed/vmlinux.bin.gz
  LD      arch/i386/boot/compressed/piggy.o
  LD      arch/i386/boot/compressed/vmlinux
  OBJCOPY arch/i386/boot/vmlinux.bin
  HOSTCC  arch/i386/boot/tools/build
  BUILD   arch/i386/boot/bzImage
Root device is (3, 3)
Boot sector 512 bytes.
Setup is 4798 bytes.
System is 1432 kB
Kernel: arch/i386/boot/bzImage is ready
  Building modules, stage 2.
  MODPOST
if [ -r System.map ]; then /sbin/depmod -ae -F System.map  2.6.11-gentoo-r9; fi



No .ko files at all.
Code:

/usr/src/linux# find . -iname '*.ko'
< nothing >

/usr/src/linux# ls -l /lib/modules/2.6.11-gentoo-r9/kernel/
total 0


I'm starting to think that something is messed up and I may need to do a full reinstall. Not being able to ever upgrade your kernel is kind of a problem. :(
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Sun Jun 05, 2005 6:20 pm    Post subject: Reply with quote

[quote]I'm starting to think that somethin
Quote:
g is messed up and I may need to do a full reinstall. Not being able to ever upgrade your kernel is kind of a problem. :(

Yeah, that is a problem. But I wouldn't resort to a full reinstall yet.

I'm grasping at straws here, but have you tried unmerging the kernel source, deleting the kernel source tarball from /usr/portage/distfiles/, then removing any remnants of the kernel source in /usr/src/ including the symlink, remerging the kernel, recreating the link, and trying the compile again?

Maybe even recreating the .config file from scratch using menuconfig and not using your existing .config?
Back to top
View user's profile Send private message
jmbsvicetto
Moderator
Moderator


Joined: 27 Apr 2005
Posts: 4734
Location: Angra do Heroísmo (PT)

PostPosted: Sun Jun 05, 2005 6:37 pm    Post subject: Reply with quote

Before opting for more drastic measures please try
Code:

cd /usr/src/linux
make && make modules && make modules_install

If this works, there must be a problem with the Makefile for your kernel. The modules_install target is supposed to call the modules target.
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Sun Jun 05, 2005 8:53 pm    Post subject: Reply with quote

Good advice to avoid drastic measures.
Also perhaps what is the output of:
Code:
grep '=m' .config

?
Back to top
View user's profile Send private message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Sun Jun 05, 2005 11:50 pm    Post subject: Reply with quote

I unmerged gentoo-sources. Deleted any remaining traces, then emerged it again. Created a new .config from scratch.

make && make modules_install
- did the same thing as before (or rather didn't do it)
make && make modules && make modules_install
- no better

Code:
/usr/src/linux# find . -iname '*.ko'
< nothing >

/usr/src/linux# grep "=m" .config
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_VIDEO=m
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_YENTA=m
CONFIG_PCCARD_NONSTATIC=m
CONFIG_PARPORT=m
CONFIG_PARPORT_PC=m
CONFIG_PARPORT_PC_CML1=m
CONFIG_BLK_DEV_FD=m
CONFIG_CDROM_PKTCDVD=m
CONFIG_IOSCHED_DEADLINE=m
CONFIG_IOSCHED_CFQ=m
CONFIG_IEEE1394=m
CONFIG_IEEE1394_OHCI1394=m
CONFIG_IEEE1394_VIDEO1394=m
CONFIG_IEEE1394_SBP2=m
CONFIG_IEEE1394_ETH1394=m
CONFIG_IEEE1394_DV1394=m
CONFIG_IEEE1394_RAWIO=m
CONFIG_IEEE1394_CMP=m
CONFIG_IRDA=m
CONFIG_VIA_FIR=m
CONFIG_INPUT_PCSPKR=m
CONFIG_PRINTER=m
CONFIG_HW_RANDOM=m
CONFIG_RTC=m
CONFIG_AGP_VIA=m
CONFIG_DRM=m
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_RTCTIMER=m
CONFIG_SND_MPU401_UART=m
CONFIG_SND_AC97_CODEC=m
CONFIG_SND_VIA82XX=m
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_PRINTER=m
CONFIG_USB_STORAGE=m
CONFIG_USB_HID=m
CONFIG_UDF_FS=m
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_NTFS_FS=m
CONFIG_SMB_FS=m
CONFIG_CIFS=m
CONFIG_CRYPTO_DEV_PADLOCK=m
CONFIG_CRC_CCITT=m
CONFIG_LIBCRC32C=m


I set the main modules (network, ATA, etc) as builtin so I was able to install and boot this kernel. :)
But no loadable modules :(

I've either missed an important step earlier on or somthing is very messed up.
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Sun Jun 05, 2005 11:56 pm    Post subject: Reply with quote

Did you delete the kernel source from /usr/portage/distifles/ before remerging? This would have caused portage to fetch/download the kernel source again.

Just for giggles, have you tried a different kernel like ck-sources?

Other than that, I'm stumped. Anyone else?

FYI, back around 2.6.8 or 9, I had troubles with the gentoo kernel, albeit not like this! It just wouldn't compile successfully. I tried ck-sources and haven't gone back to the gentoo kernel since!
Back to top
View user's profile Send private message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Mon Jun 06, 2005 12:18 am    Post subject: Reply with quote

When I cleaned everything out I also deleted the files from /usr/portage/distfiles/. For kicks I also downloaded the latest kernel from kernel.org (2.6.11.11). I got the exact same problem. Which leads me to beleive that my emerge of gentoo-sources is fine and the problem is something else.
Either I'm not following the correct process for building a kernel (I don't think so, since I followed the gentoo manual and it's pretty simple) or somthing is messed up on my box.
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Mon Jun 06, 2005 12:23 am    Post subject: Reply with quote

Yes, but you stated earlier that you got another kernel to build....what was it?......2.6.8.1 or something. Why would that build and not the others. Did your system experience some sort of trauma between the 2.6.8.1 kernel and the troubles you have now?
Back to top
View user's profile Send private message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Mon Jun 06, 2005 1:38 am    Post subject: Reply with quote

Yes 2.6.8.1. I originally installed gentoo from a 2004.2 CD I got. I installed a 2.6 system even though 2.4 was the default.
I then installed (a non-gentoo) 2.6.8.1 kernel. A few months of emerges and I finally got around to upgrading the kernel. And that's where I am now.

As a test I tried recompiling that old 2.6.8.1 kernel.
It works correctly 8O. I can see it building all the ko modules.
Code:
...
  CC      drivers/ieee1394/amdtp.mod.o
  LD [M]  drivers/ieee1394/amdtp.ko
...

Now I'm even more confused.
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Mon Jun 06, 2005 2:43 am    Post subject: Reply with quote

Humor me.... what's the output of:
Code:
ls -l /usr/src/

I asked before, but I don't think you answered it.
Back to top
View user's profile Send private message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Mon Jun 06, 2005 5:22 am    Post subject: Reply with quote

Code:

# ls -l /usr/src
total 70623
-rw-r--r--   1 root root        0 Jan 29 23:42 .keep
lrwxrwxrwx   1 root root       22 Jun  5 11:46 linux -> linux-2.6.11-gentoo-r9/
drwxr-xr-x  19 root root     1312 Jun  5 20:33 linux-2.6.11-gentoo-r9/
-rw-r--r--   1 root root 36612112 Jun  5 07:33 linux-2.6.11.11.tar.bz2
drwxrwxr-x  19  500  500     1248 Jun  5 17:51 linux-2.6.8.1/
-rw-r--r--   1 root root 35628066 Aug 14  2004 linux-2.6.8.1.tar.bz2



Appriciate all the help. There's got to be a logical reason in there somewhere. It's just driving me crazy trying to figure it out. :?
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Mon Jun 06, 2005 6:53 am    Post subject: Reply with quote

No problem, but I think I'm stumped. It's driving me crazy too!

Just for fun, try ck-sources kernel.

You might want to file a bug report. Maybe they'll have a solution.
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Mon Jun 06, 2005 2:20 pm    Post subject: Reply with quote

Is there a linux-2.6.11-gentoo-r9/.tmp_versions directory? If so, please post the contents of the directory and the output of cat on one of them. These files are used by scripts/Makefile.modpost to determine what kernel object files to create.

The way scripts/Makefile.modpost creates the list of object files from those files changed between the kernel releases you are compiling. You might try renaming linux-2.6.11-gentoo-r9/scripts/Makefile.modpost and replacing it with linux-2.6.8.1/scripts/Makefile.modpost and running make modules.
Back to top
View user's profile Send private message
eatmore
n00b
n00b


Joined: 05 Jun 2005
Posts: 8

PostPosted: Tue Jun 07, 2005 3:26 am    Post subject: Reply with quote

Finally figured it out. :D
After comparing the Makefile from 2.6.8.1 (that worked) to the one from 2.6.11-gentoo (that didn't) I noticed this:

44c44
< __modules := $(sort $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod)))
---
> __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))

That's when the light started to go off:
#env
...
GREP_OPTIONS=--color=always
...
That doesn't look good. :oops:

# export GREP_OPTIONS=--color=auto
# make modules
!! Eureka !!

The ansi escape codes in the coloured grep ouput were royally messing things up.
I'll finally be able to get some sleep tonight. Thanks overkll, jmbsvicetto and limn for all your help.
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1249
Location: Austin, Texas

PostPosted: Tue Jun 07, 2005 3:44 am    Post subject: Reply with quote

I'm soo glad you figured it out. It was bugging me, even though it wasn't my issue. Good work!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum