From: Tony Houghton on
I just installed Ubuntu Feisty on my laptop. Its update-grub insists on
referring to root by its UUID instead of /dev name which makes my
self-compiled kernel panic at start-up if I forget to change it back
(kind of defeats the point of grub). I can't work out what to enable in
the kernel to make it work. The best I could find on Googling UUID was
that it might be something to do with dev-mapper so I enabled that, but
it still panics.

--
TH * http://www.realh.co.uk
From: Stephen Chadfield on
Tony Houghton <h(a)realh.co.uk> wrote:
> I just installed Ubuntu Feisty on my laptop. Its update-grub insists on
> referring to root by its UUID instead of /dev name which makes my
> self-compiled kernel panic at start-up if I forget to change it back
> (kind of defeats the point of grub). I can't work out what to enable in
> the kernel to make it work. The best I could find on Googling UUID was
> that it might be something to do with dev-mapper so I enabled that, but
> it still panics.

Are you lacking support for some feature in your initrd.img file?

I find it safest to start with a kernel configuration identical to that
of a working, distro kernel and then gradually make changes in small
steps - keeping backups of working ".config" files as I go.

--
Stephen Chadfield
From: Nix on
On 5 Mar 2007, Stephen Chadfield said:

> Tony Houghton <h(a)realh.co.uk> wrote:
>> I just installed Ubuntu Feisty on my laptop. Its update-grub insists on
>> referring to root by its UUID instead of /dev name which makes my
>> self-compiled kernel panic at start-up if I forget to change it back
>> (kind of defeats the point of grub). I can't work out what to enable in
>> the kernel to make it work. The best I could find on Googling UUID was
>> that it might be something to do with dev-mapper so I enabled that, but
>> it still panics.
>
> Are you lacking support for some feature in your initrd.img file?

Certainly you'll need either an initrd or initramfs (preferably the
latter, preferably linked into the kernel: it's more robust, you can't
break it by removing or rewriting any file other than the kernel image;
initrds are obsolete and will eventually be removed) with an /init
script which is capable of mounting root by its UUID (pretty trivial,
util-linux mount can do it with no extra effort: it's just the kernel's
hyper-minimalist built-in root filesystem locating code which can't.
There's no need to use that code at *all* anymore, though.)

--
`In the future, company names will be a 32-character hex string.'
--- Bruce Schneier on the shortage of company names
From: Tony Houghton on
In <873b4jmauv.fsf(a)hades.wkstn.nix>,
Nix <nix-razor-pit(a)esperi.org.uk> wrote:

> Certainly you'll need either an initrd or initramfs (preferably the
> latter, preferably linked into the kernel: it's more robust, you can't
> break it by removing or rewriting any file other than the kernel image;
> initrds are obsolete and will eventually be removed) with an /init
> script which is capable of mounting root by its UUID (pretty trivial,
> util-linux mount can do it with no extra effort: it's just the kernel's
> hyper-minimalist built-in root filesystem locating code which can't.
> There's no need to use that code at *all* anymore, though.)

initramfs-utils makes it pretty easy to set up on Debian and Ubuntu too,
although I missed the --initrd option to make-kpkg and it looks like it
might not work for initramfs anyway. So I'll have to remember to run
update-initramfs each time I install a new kernel and I'm bound to
forget!

--
TH * http://www.realh.co.uk
From: Nix on
On 7 Mar 2007, Tony Houghton verbalised:

> In <873b4jmauv.fsf(a)hades.wkstn.nix>,
> Nix <nix-razor-pit(a)esperi.org.uk> wrote:
>
>> Certainly you'll need either an initrd or initramfs (preferably the
>> latter, preferably linked into the kernel: it's more robust, you can't
>> break it by removing or rewriting any file other than the kernel image;
>> initrds are obsolete and will eventually be removed) with an /init
>> script which is capable of mounting root by its UUID (pretty trivial,
>> util-linux mount can do it with no extra effort: it's just the kernel's
>> hyper-minimalist built-in root filesystem locating code which can't.
>> There's no need to use that code at *all* anymore, though.)
>
> initramfs-utils makes it pretty easy to set up on Debian and Ubuntu too,
> although I missed the --initrd option to make-kpkg and it looks like it
> might not work for initramfs anyway. So I'll have to remember to run
> update-initramfs each time I install a new kernel and I'm bound to
> forget!

If you build it into the kernel binary, you don't need to do that: the
kernel build system assembles the initramfs and links it into the kernel
image for you: it's impossible to forget because there's nothing to
remember. (Generally such things are linked with a different C library
from glibc, which is a bloated monster for this application: I use the
latest SVN copy of uClibc and busybox, as busybox has a switch_root
command which does the wipe-everything-on-the-rootfs-close-all-fds-
chroot()-and-exec() dance you need to use to continue booting without
wasting memory. Note that the rootfs is quite different from the
filesystem that happens to house / after you've booted; wipe that and
you'll soon regret it, of course ;} )

See linux/Documentation/early-userspace/README. (If you want a working
example, I've posted the URL to the linux-raid wiki page that describes
the scripts I use to boot so many times that everyone's probably sick of
it.)

--
`In the future, company names will be a 32-character hex string.'
--- Bruce Schneier on the shortage of company names