FS#7574 - udev root symlink script incompatible with lilo
Attached to Project:
Arch Linux
Opened by Sergej Pupykin (sergej) - Friday, 06 July 2007, 13:17 GMT
Last edited by Greg (dolby) - Tuesday, 17 June 2008, 10:39 GMT
Opened by Sergej Pupykin (sergej) - Friday, 06 July 2007, 13:17 GMT
Last edited by Greg (dolby) - Tuesday, 17 June 2008, 10:39 GMT
|
Details
Description:
Udev /lib/udev/root-link.sh incompatible with lilo. $ dmesg | grep 'Kernel command' Kernel command line: BOOT_IMAGE=arch ro root=302 quiet so /lib/udev/root-link.sh does not work Steps to reproduce: Boot with lilo and check /dev/root file Solution: I have no ideas about symlink, but may be something like this will be usefull: #!/bin/sh # Creates root symlink in /dev # for Arch Linux by Roman Kyrylych <Roman.Kyrylych@gmail.com> if ! [ -L /dev/root ]; then ROOT=$(cat /proc/cmdline | sed "s: :\n:g" | grep root= | sed "s:root=::") if [ "x${ROOT:0:4}" == "x/dev" ]; then ln -f -s $ROOT /dev/root else ROOT_MAJ=`echo -e "ibase=16\n$ROOT/100" | bc` ROOT_MIN=`echo -e "ibase=16\n$ROOT%100" | bc` mknod -m 0660 /dev/root b $ROOT_MAJ $ROOT_MIN chown root.disk /dev/root fi fi |
This task depends upon
IIRC there was a patch long time ago to make lilo pass normal style root=/dev/sda to kernel. Tpowa, can you correct me?
I've noticed something, cat /proc/mounts on my Arch system gives me:
<code>/dev/root / ext3 rw,noatime,data=ordered 0 0</code>
but on a Debian system it gives me:
<code>/dev/hda1 / ext3 rw,data=ordered 0 0</code>
So maybe if we find what the difference is, and make /proc/mount on Arch be as the Debian case, the HAL problem will be solved too?
FS#5519which is was very annoying bug.It would be cool if lilo pass root=/dev/sda1 instead of root=302 to kernel.
FS#5519is really a HAL bug, where HAL reads from /proc/mounts instead of /etc/mtab, right? It would be silly to patch udev, lilo, grub, initcpio etc.. just for a HAL bug, isn't it...BTW I'll try to help here, I can check with Debian and Slackware (Slack has the same problem actually).
Does anyone know where is the command that mounts the root filesystem in the initramfs? Is it the last line in /lib/initcpio/init (exec kinit ...)???
Referring to /etc/mtab is quite crappy: it's a user controlled file that doesn't always reflect what is mounted currently. /proc/mounts does, and so will some sysfs equivalent do. Mounts belong in the kernel, let the kernel manage the mount table then. Hal runs on top of udev and the kernel, so it's no point in looking for a file controlled by userspace tools.
About the dev/root symlink: this is how all other distros solve it, though they create the file from initrd as normal block device instead of a symlink.
In Debian 4.0 *with* initrd and the default 2.6.18-4-686 kernel /proc/mounts is correct ... so it seems that the Debian initrd scripts do it right...
The difference is that Arch just calls /bin/kinit -- "root=${root}", while Debian mount's the rootfs in it's scripts, and then moves /sys and /proc to /root/sys and /root/proc ...
If you have a Debian near you can check /usr/share/initramfs-tools/scripts/local (mountroot is defined here) and /usr/share/initramfs-tools/init
As far as I understood, if you are mounting without an initrd then:
1) you can't specify the root device by-label, or by-uuid, or LABEL=
2) you can't have anything else but /dev/root in /proc/mounts
You can pass root=/dev/sda to kernel with lilo. On my system /dev/root is a broken symlink whch points to a non-existing /dev/308. My system boots and works fine though.
Also, on further test, it seems that it is not necessary anymore. Nautilus only displays one icon for the root filesystem. Either the update to udev 118 fixed it or I mistook the entries for my winxp or backup partition.