You are not logged in.

#1 2008-12-16 19:45:29

Flasher
Member
From: Bavaria / Germany
Registered: 2005-04-24
Posts: 126

Custom Kernel and by-uuid grub config

Hello!

I compilied a custom kernel for my system. The kernel works perfectly, but I have to change my grub config. The original menu.lst config for the arch-kernel26 uses uuids to identify the partions:

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/780daad2-ca5d-403b-beca-854f76a06070 ro video=uvesafb:1280x1024-32,mtrr:3,ywrap


With my custom kernel booting isn't possible because the system can't identify the partions. I have to use the old style:

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda2 ro video=uvesafb:1024x786-32,mtrr:3,ywrap

Is there any kernel option, which I have to activate to use the new uuid method in menu.lst?

Best regards,

Flasher

Offline

#2 2008-12-16 22:58:01

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 3,282

Re: Custom Kernel and by-uuid grub config

Hmmmm I'm not sure about this but shouldn't it be like

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/780daad2-ca5d-403b-beca-854f76a06070 ro video=uvesafb:1280x1024-32,mtrr:3,ywrap
initrd /boot/kernel26.img

R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2008-12-17 02:25:06

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 873

Re: Custom Kernel and by-uuid grub config

I think you can generate UUIDs by running "uuid-gen" or something similar, then use the UUID generated in the menu.lst file itself.  I just cannot recall the exact command to do this, so check the wiki and/or the UUID man pages.


I'm torn apart between worlds. Basically, using vim in a highly visual environment with a lot of mouse features feels like soldering a lose wire to a motherboard with a Zippo and a needle, while working with ANY TEXT AT ALL with a "modern GUI" text editor feels like joining the London Philharmonic Orchestra with a Fisher-Price Laugh and Learn Magical Musical Mirror.  --Awebb

Offline

#4 2008-12-17 19:25:11

Flasher
Member
From: Bavaria / Germany
Registered: 2005-04-24
Posts: 126

Re: Custom Kernel and by-uuid grub config

@ R00KIE

Because I built my own kernel I haven't the file /boot/kernel26.img. I don't need it, because alle necessary components are in my custom kernel.

@ MoonSwan

The uuid tool is known as "uuid-gen". It generates randomized uuid, but I don't know why this generated uuids should help to find a solution for my problem.

The command ls -l /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 2008-12-17 16:42 780daad2-ca5d-403b-beca-854f76a06070-> ../../sda2
lrwxrwxrwx 1 root root 10 2008-12-17 16:42 ce88b287-5d3c-4edc-ba34-86c60786d06a-> ../../sda3
lrwxrwxrwx 1 root root 10 2008-12-17 16:42 df1fe74f-f2ed-45e7-b7d1-d5a645176339-> ../../sda1

Shows the correct uuids, which are used in the menu.lst. It looks like, that the kernel can't allocate these ID to the partition naming scheme (/dev/sda?)

Best regards,

Flasher

Offline

#5 2008-12-17 19:36:54

TjPhysicist
Member
From: Waterloo, Canada
Registered: 2008-04-12
Posts: 125
Website

Re: Custom Kernel and by-uuid grub config

i have the same issue, it seems the kernel does not assign the uuid's until after initialising at some point, so while looking for root the uuids are not there yet, i have no idea why however.


-Tj
Now reborn as Tjh_ (to keep it similar to my username in other places)

Offline

#6 2008-12-17 21:18:03

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 3,282

Re: Custom Kernel and by-uuid grub config

Ok so you don't need the boot image smile, and what is the order in which things are loaded, that sounds like udev didn't have time to populate the list of disks or it isn't yet loaded when trying to access the disk. I think that job is done by udev but I can't remember where I saw that hmm


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2008-12-17 21:19:55

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Custom Kernel and by-uuid grub config

If you don't have an initramfs image, then udev is not run in early-userspace, so no uuid device symlinks are created. The kernel doesn't do this on its own - that is all udev.

If you want to use a custom kernel and UUIDs, you'll probably want to use an initramfs, even if it has no modules in it.

Offline

#8 2008-12-17 21:38:53

Flasher
Member
From: Bavaria / Germany
Registered: 2005-04-24
Posts: 126

Re: Custom Kernel and by-uuid grub config

Hm.... do I need a special initramfs configuration to use udev in early-userspace?

At the moment I only load the v86d binary. I use the following initramfs config file:

dir /dev 0755 0 0
nod /dev/console 0600 0 0 c 5 1
nod /dev/tty1 0600 0 0 c 4 1
nod /dev/zero 0600 0 0 c 1 5
nod /dev/mem 0600 0 0 c 1 1
dir /root 0700 0 0
dir /sbin 0755 0 0
file /sbin/v86d /sbin/v86d 0755 0 0


Best regards,

Flasher

Offline

#9 2008-12-18 02:26:36

huntxu
Member
Registered: 2008-12-07
Posts: 12

Re: Custom Kernel and by-uuid grub config

http://marc.info/?l=linux-kernel&m=111881296506069&w=2
it seems that kernel don't recognize uuid without initrd.img.
just use root=/dev/sd**

Offline

#10 2008-12-19 01:17:05

TjPhysicist
Member
From: Waterloo, Canada
Registered: 2008-04-12
Posts: 125
Website

Re: Custom Kernel and by-uuid grub config

phrakture wrote:

If you don't have an initramfs image, then udev is not run in early-userspace, so no uuid device symlinks are created. The kernel doesn't do this on its own - that is all udev.

If you want to use a custom kernel and UUIDs, you'll probably want to use an initramfs, even if it has no modules in it.

does that include label symlinks too?? ...

-Tj


-Tj
Now reborn as Tjh_ (to keep it similar to my username in other places)

Offline

Board footer

Powered by FluxBB