You are not logged in.

#1 2011-06-09 06:13:15

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Compiling a kernel in ARCH

Hi guys,

I feel like a complete idiot - I've never had an issue doing any of this before on another distro, but I can't for the life of me get my new kernel to boot.

I followed the instructions on the wiki without issue (normal kernel compilation - make/make modules etc), however my issue seems to be directly related to mkinitcpio and the RAMDISK.

I'm getting the following error when I attempt to reboot into the 'new' kernel on 2.6.39.1:
:: Running Hook [udev]
:: Triggering uevents...done
waiting 10 seconds for device /dev/disk/by-uuid/4e4d6b11-54ab-4201-a032-c52ffdba2b6c ...
mount: mounting /dev/disk/by-uuid/4e4d6b11-54ab-4201-a032-c52ffdba2b6c on /new_root failed: No such device
ERROR: Failed to mount the real root device
Bailing out, you are on your own. Good luck.

/bin/sh: can't access tty; job control turned off
[ramfs /]#

/boot has the following in it:
[root@ARCH boot]# ls -la
total 19160
drwxr-xr-x  4 root root    1024 Jun  8 08:36 .
drwxr-xr-x 21 root root    4096 Jun  8 06:36 ..
drwxr-xr-x  2 root root    1024 Jun  8 06:53 grub
-rw-r--r--  1 root root 1334513 Jun  9 01:47 kernel26-2.6.39.1.img
-rw-r--r--  1 root root 8515155 Jun  8 06:51 kernel26-fallback.img
-rw-r--r--  1 root root 1777968 Jun  8 06:50 kernel26.img
drwx------  2 root root   12288 Jun  8 06:32 lost+found
lrwxrwxrwx  1 root root      25 Jun  8 08:36 System.map -> /boot/System.map-2.6.39.1
-rw-r--r--  1 root root 1807854 Jun  8 08:36 System.map-2.6.39.1
-rw-r--r--  1 root root 2081424 May 23 16:07 vmlinuz26
-rw-r--r--  1 root root 3995952 Jun  8 08:35 vmlinuz-2.6.39.1
[root@ARCH boot]#

grub config (menu.lst) looks like:

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/4e4d6b11-54ab-4201-a032-c52ffdba2b6c ro
initrd /kernel26.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/4e4d6b11-54ab-4201-a032-c52ffdba2b6c ro
initrd /kernel26-fallback.img

# (2) Arch Linux 2.6.39.1
title Arch Linux 2.6.39.1
root    (hd0,0)
kernel /vmlinuz-2.6.39.1 root=/dev/disk/by-uuid/4e4d6b11-54ab-4201-a032-c52ffdba2b6c ro
initrd /kernel26-2.6.39.1.img

-----------

What the heck am I doing wrong? I'm obviously trying to mount something incorrectly...I just don't know what it is.

Please slap some intelligence into me.

Thanks!

Offline

#2 2011-06-09 07:46:53

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Compiling a kernel in ARCH

you used a custom config? also you can pick a kernel from AUR, many of them are updated to 2.6.39.1, eg. kernel26-ck, kernel26-bfs, etc.

Offline

#3 2011-06-09 08:13:52

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

Yeah - I used a custom config via make menuconfig

I didn't really change too much though (removed AMD/PowerPC/kernel debugs/few drivers for bluetooth/RF etc). Nothing too crazy.

Offline

#4 2011-06-09 11:41:13

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Compiling a kernel in ARCH

hmm, try the kernel26 package from [testing] too.

Offline

#5 2011-06-09 11:48:18

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

I don't want to use someone else's kernel - I'd just like to figure out what my problem is with the above one.

Thanks,

Edit: I just pulled kernel26-2.6.38.8-1 from the repositories via pacman and it installed without issue.

Last edited by NuMPTy (2011-06-09 11:57:53)

Offline

#6 2011-06-09 11:50:37

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Compiling a kernel in ARCH

test the 2.9.39.1 kernel from testing to see if it works for you.

also, I wonder what config did you used.

also,

Bailing out, you are on your own. Good luck.

Last edited by JokerBoy (2011-06-09 11:50:57)

Offline

#7 2011-06-09 12:07:48

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

Well, to appease the crowd I pulled 2.6.39.1-1 down from [testing] and installed it without issue onto the test box:

[root@ARCH ~]# uname -a
Linux ARCH 2.6.39-ARCH #1 SMP PREEMPT Tue Jun 7 05:49:02 UTC 2011 i686 Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz GenuineIntel GNU/Linux

So the issue is obviously not the kernel, and almost certainly my config.

What the heck am I doing wrong?

Offline

#8 2011-06-09 13:49:33

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Compiling a kernel in ARCH

NuMPTy wrote:

Well, to appease the crowd I pulled 2.6.39.1-1 down from [testing] and installed it without issue onto the test box:

[root@ARCH ~]# uname -a
Linux ARCH 2.6.39-ARCH #1 SMP PREEMPT Tue Jun 7 05:49:02 UTC 2011 i686 Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz GenuineIntel GNU/Linux

So the issue is obviously not the kernel, and almost certainly my config.

What the heck am I doing wrong?

Kinda tough to tell without a list of what you actually did. May be as simple as misspelling a command. More likely you're lacking some important drivers which handle your root filesystem or partition...


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#9 2011-06-09 15:14:26

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Compiling a kernel in ARCH

Post a list of the files contained in your init image - the mkinitcpio wiki page tells you how to list the files, if you don't know already.

Offline

#10 2011-06-09 16:30:15

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: Compiling a kernel in ARCH

I know this is contrary to the thinking of many Archers, but I have had a heck of a time using UUIDs in grub.  Somehow, I suspect that all kernels don't calculate them the same way; But I could be wrong hmm

I suggest you use the partition identifier ( /dev/sdan), at least until you get it working.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2011-06-09 22:10:22

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

I'm trying out a fresh build in a new VM at home, and simply trying to use the 'standard' config from ARCH and build it without modification, however I can't seem to locate the normal .config that I'm used to seeing.

Is there something I need to do to have ARCH generate one for me?

On my 'base' system I've got one, but on this fresh VM I don't have anything.

Offline

#12 2011-06-09 23:02:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Compiling a kernel in ARCH

It's in /proc/config.gz .

BTW are you aware that you don't have to use mkinitcpio etc?

Last edited by tomk (2011-06-09 23:03:07)

Offline

#13 2011-06-09 23:23:02

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

tomk wrote:

It's in /proc/config.gz .

BTW are you aware that you don't have to use mkinitcpio etc?

Awesome, thank you.

I've never done it without mkinitcpio - please enlighten me smile

I should be done compiling this 'new' kernel in a few minutes hopefully. We'll see if I have the same issue.

Cheers,

Offline

#14 2011-06-09 23:46:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Compiling a kernel in ARCH

Build your boot-time requirements into the kernel, instead of as modules, and you can forget about init images.

Offline

#15 2011-06-09 23:54:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Compiling a kernel in ARCH

@tomk - interesting... is there a wiki page on this topic?  Some questions that come to mind:
-How can one interrogate the kernel img to see exactly what is required to build in?
-What should a /boot/grub/grub.cfg entry look like?

Love to learn more and try it on my machine.

EDIT:  I did find this old thread, but would really benefit from someone outlining the key steps to make it successfully the first time smile

https://bbs.archlinux.org/viewtopic.php?id=74107

Last edited by graysky (2011-06-10 00:27:34)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#16 2011-06-10 00:02:02

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

tomk wrote:

Build your boot-time requirements into the kernel, instead of as modules, and you can forget about init images.

Makes sense smile

Any recommended reading material for that?

Also - kernel is still compiling and I'm heading out for the next 24~ hours.

I'll update this thread when I get back.

Thanks for all your help!

Offline

#17 2011-06-10 02:39:22

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: Compiling a kernel in ARCH

NuMPTy wrote:
tomk wrote:

Build your boot-time requirements into the kernel, instead of as modules, and you can forget about init images.

Makes sense smile

Any recommended reading material for that?

Also - kernel is still compiling and I'm heading out for the next 24~ hours.

I'll update this thread when I get back.

Thanks for all your help!

I don't mean this to be a joke; You might look at the Gentoo documentation.  In particular this

Mind you, I'm not suggesting you install Gentoo, but they do do a lot of compiling of the kernel.  I came from, and still have a soft spot in my heart for, Gentoo. 
I regard them as the penultimate distribution.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#18 2011-06-10 02:42:01

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: Compiling a kernel in ARCH

Oh, and check out kernel seeds.  It is a site run by a hard core Gentoo'er who is known as Pappy_mcfae.  He is a real nice guy who seems to make a hobby of all things having to do with kernel configuration.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#19 2011-06-10 04:29:48

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Compiling a kernel in ARCH

ewaller, thanks for that link.

graysky wrote:

@tomk - interesting... is there a wiki page on this topic?  Some questions that come to mind:

I'm not tomk but I'll try to answer.

Love to learn more and try it on my machine.

EDIT:  I did find this old thread, but would really benefit from someone outlining the key steps to make it successfully the first time smile

https://bbs.archlinux.org/viewtopic.php?id=74107

Be aware of whatever you use the initramfs for. This can vary by person. IIRC, for most it is simply to mount root and load init.

Once you know what your initramfs is for, see if you can get rid of all that. Remember that these things must be present at boot before root is mounted. The only place they can be kept is in the kernel. So unfortunately, if there is anything other than kernel modules which you need at this stage of boot, you are out of luck.

Most if not all kernel modules can be compiled in. I'm not going to describe this as I'm sure you've used {x,menu,n}config or whatever at least once in your life. wink

-What should a /boot/grub/grub.cfg entry look like?

No need for initrd line. smile

-How can one interrogate the kernel img to see exactly what is required to build in?

*smacks graysky on the head*


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#20 2011-06-10 11:02:44

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Compiling a kernel in ARCH

Couldn't have put it better myself, fsckd. smile

And yes, my post #14 above was an over-simplification - in many cases, you can do without an initramfs that way, but as fsckd says, it depends what you're doing with it. For example, suspend2disk needs an initramfs, full disk encryption also.

graysky - as already mentioned in the same post, the "interrogation" method is outlined in the mkinitcpio wiki page.

Offline

#21 2011-06-10 19:06:56

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Compiling a kernel in ARCH

Thanks for the tips.

Last edited by graysky (2011-06-10 19:34:31)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#22 2011-06-11 15:34:43

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

I'm still failing miserably in the new VM it seems. I think there is something wrong in my grub config, but I don't see what it is.

# cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
UUID=8d1664d1-575f-4267-ba8a-c478b7e56ec7 /home ext4 defaults 0 1
UUID=ad6966ab-86fb-4f20-a642-cd7b79449c7f /boot ext2 defaults 0 1
UUID=bb97d70b-1d85-4ce6-bf5d-2b1d7a47b84a / ext4 defaults 0 1
UUID=f16d43f0-5ae6-474a-99ca-a24d8007e415 swap swap defaults 0 0

# ls -lah /boot
total 19M
drwxr-xr-x  4 root root 1.0K Jun 10 21:05 .
drwxr-xr-x 22 root root 4.0K Jun  6 19:48 ..
drwxr-xr-x  2 root root 1.0K Jun  6 19:52 grub
-rw-r--r--  1 root root 1.3M Jun 10 21:04 kernel26-2.6.39.1.img
-rw-r--r--  1 root root 8.4M Jun  9 21:00 kernel26-fallback.img
-rw-r--r--  1 root root 1.7M Jun  9 21:00 kernel26.img
drwx------  2 root root  12K Jun  6 19:38 lost+found
lrwxrwxrwx  1 root root   25 Jun 10 21:05 System.map -> /boot/System.map-2.6.39.1
-rw-r--r--  1 root root 1.7M Jun  6 16:52 System.map26
-rw-r--r--  1 root root 1.6M Jun 10 21:05 System.map-2.6.39.1
-rw-r--r--  1 root root 2.2M Jun  6 16:52 vmlinuz26
-rw-r--r--  1 root root 2.0M Jun 10 21:03 vmlinuz-2.6.39.1


# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/bb97d70b-1d85-4ce6-bf5d-2b1d7a47b84a ro
initrd /kernel26.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/bb97d70b-1d85-4ce6-bf5d-2b1d7a47b84a ro
initrd /kernel26-fallback.img

# (2) Arch Linux Test
title  Arch Linux Test
root   (hd0,0)
kernel /vmlinuz-2.6.39.1 root=/dev/disk/by-uuid/bb97d70b-1d85-4ce6-bf5d-2b1d7a47b84a ro
initrd /kernel26-2.6.39.1.img

And as requested:
# bsdtar -t -f kernel26-2.6.39.1.img
/proc
/sys
/dev
/bin
/sbin
/lib
/usr
/usr/bin
/usr/lib
/usr/sbin
/run
/dev/null
/dev/zero
/dev/console
/dev/mem
/bin/busybox
/lib/libc.so.6
/lib/libc-2.13.so
/lib/ld-linux-x86-64.so.2
/lib/ld-2.13.so
/sbin/modprobe
/sbin/blkid
/lib/libblkid.so.1
/lib/libblkid.so.1.1.0
/lib/libuuid.so.1
/lib/libuuid.so.1.3.0
/init_functions
/init
/config
/etc
/etc/modprobe.d
/etc/modprobe.d/usb-load-ehci-first.conf
/sbin/udevd
/lib/librt.so.1
/lib/librt-2.13.so
/lib/libpthread.so.0
/lib/libpthread-2.13.so
/sbin/udevadm
/lib/udev
/lib/udev/rules.d
/lib/udev/rules.d/50-firmware.rules
/lib/udev/rules.d/50-udev-default.rules
/lib/udev/rules.d/60-persistent-storage.rules
/lib/udev/rules.d/80-drivers.rules
/lib/udev/firmware
/lib/udev/ata_id
/lib/udev/path_id
/lib/udev/scsi_id
/lib/udev/usb_id
/lib/udev/load-modules.sh
/etc/udev
/etc/udev/udev.conf
/hooks
/hooks/udev
/lib/modules
/lib/modules/2.6.39.1
/lib/modules/2.6.39.1/kernel
/lib/modules/2.6.39.1/kernel/drivers
/lib/modules/2.6.39.1/kernel/drivers/scsi
/lib/modules/2.6.39.1/kernel/drivers/scsi/scsi_wait_scan.ko
/lib/modules/2.6.39.1/modules.dep
/lib/modules/2.6.39.1/modules.alias
/lib/modules/2.6.39.1/modules.symbols


It's kind of sad that I can't get this to work... sad

Offline

#23 2011-06-11 15:58:11

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Compiling a kernel in ARCH

I believe you are missing the scsi_wait_scan module... you need to build that into the kernel.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#24 2011-06-11 16:25:19

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

graysky wrote:

I believe you are missing the scsi_wait_scan module... you need to build that into the kernel.

Hey Graysky - just add 'scsi_wait_scan' to 'MODULES' section in mkinitcpio.conf  and rebuild?

Also - I've been looking for similar issues and I found your old thread/bug at:
https://bbs.archlinux.org/viewtopic.php?id=103362&p=1

I'm getting the same error on boot with the test kernel (granted my error is for the UUID of / rather than /dev/sda2)
ERROR: Unable to determine major/minor number of root device '/dev/sda2

I've tried hardcoding the filesystem via rootfstype=ext4 without success

Offline

#25 2011-06-11 16:34:44

NuMPTy
Member
From: Canada
Registered: 2011-06-04
Posts: 35

Re: Compiling a kernel in ARCH

As a follow-up to the above... I'm downloading 2.6.34.9 lts to see if I have any success with it

Offline

Board footer

Powered by FluxBB