You are not logged in.

#1 2012-10-03 03:55:49

Linpandro
Member
Registered: 2012-10-03
Posts: 25

[Solved] Problems compiling a kernel on Archlinux

Hi all, some days ago I wanted to compile a kernel on my system, and everything was fine but I have a simple problem.

Compile the kernel in the traditional manner, but no logo create the ramdisk image.
https://wiki.archlinux.org/index.php/Ke … raditional

Example:

cp -v arch/x86/boot/bzImage /boot/vmlinuz-NewKernel

And:

mkinitcpio -k NewKernel -g /boot/initramfs-NewKernel.img

But I get this error:
Error: unable to locate module directory for NewKernel.
What am I doing wrong?

PD:Sorry for my English

Last edited by Linpandro (2012-10-03 13:50:43)

Offline

#2 2012-10-03 04:40:58

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: [Solved] Problems compiling a kernel on Archlinux

is your kernel modularized ?

Also from the wiki :

# mkinitcpio -k FullKernelName -g /boot/initramfs-YourKernelName.img

  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#3 2012-10-03 04:45:33

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,784

Re: [Solved] Problems compiling a kernel on Archlinux

Did you do a make modules_install?

Offline

#4 2012-10-03 08:13:55

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

Re: [Solved] Problems compiling a kernel on Archlinux

This:

mkinitcpio -k NewKernel -g /boot/initramfs-NewKernel.img

Should be this:

mkinitcpio -k 3.x.x-RCn-NewKernel -g /boot/initramfs-NewKernel.img

To clarify, the wiki tells you to run this:

# mkinitcpio -k FullKernelName -g /boot/initramfs-YourKernelName.img

If you need any modules loaded in order to mount the root filesystem, build a ramdisk (most users need this). The -k parameter accepts the kernel version and appended string you set in menuconfig and is used to locate the corresponding modules directory in '/usr/lib/modules':

If you used the sources for, say, 3.5.4, "FullKernelName" would be 3.5.4-NewKernel.

If you're not sure about what the "FullKernelName" should be, simply check which directory was created after running modules_install

ls -l /lib/modules

This should show you something like this:

[stefan@archsteef scrub]$ ls -l /lib/modules/
total 8
drwxr-xr-x 3 root root 4096 Sep 30 01:30 3.5.4-1-ARCH
drwxr-xr-x 2 root root 4096 Sep 30 01:30 extramodules-3.5-ARCH
drwxr-xr-x 2 root root 4096 Oct 1 03:25 3.5.4-NewKernel

The directory name is the full name of your kernel and can be used after the -k flag.


p.s. this is all assuming that you used make menuconfig to set the local version name to "NewKernel" smile

Last edited by stefanwilkens (2012-10-03 08:15:26)


Arch i686 on Phenom X4 | GTX760

Offline

#5 2012-10-03 13:50:02

Linpandro
Member
Registered: 2012-10-03
Posts: 25

Re: [Solved] Problems compiling a kernel on Archlinux

It worked, thank you very much for helping. big_smile

Offline

Board footer

Powered by FluxBB