On Tue, Jul 28, 2015 at 10:40 AM, Peter Humphrey <pe...@prh.myzen.co.uk> wrote:
> On Tuesday 28 July 2015 08:31:58 Rich Freeman wrote:
>> On Tue, Jul 28, 2015 at 8:16 AM, Neil Bothwick <n...@digimed.co.uk> wrote:
>
>> > I've just installed a new laptop with it, using btrfs
>> > for everything but /boot.
>
> I know you use grub-2, which can boot that setup, but I suppose I'd need an
> init thingy if I stick to grub legacy.

You may not need an initramfs to run root on btrfs as long as btrfs is
compiled into your kernel (I haven't looked into it closely though).
You WOULD need a boot partition on ext4 to store your kernel on, since
grub legacy can't read a kernel/initramfs off of btrfs.

All grub does is read your kernel and initramfs and run the kernel.
The kernel actually does all the drive mounting/etc.  So, as long as
grub can read your kernel (and initramfs if you're using one) then
you're fine, since the kernel can do just about anything.

And this is one of the whole points of projects like
linuxbios/coreboot/etc.  Traditionally PC bootloaders have been pretty
limited in capabilities, so by using a linux kernel as your bootloader
you can potentially boot anything linux+userspace can read (such as
retrieving a kernel image and root squashfs from an FTP site and
booting it, or running an SMTP server and booting whatever kernel
somebody emails as an attachment - ok, I'm going a bit crazy with that
one).

>
> My main reason for preferring grub legacy is illustrated by my present
> grub.conf:
>
> title=Gentoo Linux 4.0.5
>         kernel /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 net.ifnames=0 
> irqpoll
>
> title=Gentoo Linux 4.0.5, no X
>         kernel /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 softlevel=nox 
> net.ifnames=0 irqpoll
>
> title=Gentoo Linux 4.0.5, no network
>         kernel /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 softlevel=nonet 
> net.ifnames=0 irqpoll
>
> title=Gentoo Linux 3.18.16
>         kernel /boot/kernel-x86_64-3.18.16-gentoo root=/dev/md5 net.ifnames=0 
> irqpoll
>
> title=Gentoo Linux 3.18.16, no X
>         kernel /boot/kernel-x86_64-3.18.16-gentoo root=/dev/md5 softlevel=nox 
> net.ifnames=0 irqpoll
>
> title=Gentoo Linux 3.18.16, no network
>         kernel /boot/kernel-x86_64-3.18.16-gentoo root=/dev/md5 
> softlevel=nonet net.ifnames=0 irqpoll
>
> title=Rescue System 3.18.12
>         kernel /boot/kernel-x86_64-3.18.12-gentoo-rescue root=/dev/sda8 
> net.ifnames=0 irqpoll
>
> title=Rescue System 4.0.5
>         kernel /boot/kernel-x86_64-4.0.5-gentoo-rescue root=/dev/sda8 
> net.ifnames=0 irqpoll
>
> I know it's supposed to be possible to set up something like that in grub-2,
> but last time I tried it I got into a mess and gave up.
>
> As you say, guidance is hard to find.

Yeah, that one probably would need some hand-rolling unless you
basically wanted to write your own mkconfig plugins or your own
mkconfig.

But, it is certainly possible to hand-roll that.

Something like:

menuentry 'Gentoo Linux 4.0.5' {
  linux /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 net.ifnames=0 irqpoll
}
...

You need all the header stuff like setting your root and such.  The
syntax changed a little from legacy grub, but it is all the same
thing.  If you look at the mkconfig-generated files you'll see a ton
of wrapper scripting/etc that is completely unnecessary if you're
hand-rolling it.  There is actually very little you need to make it
work.  Just set root= whatever, maybe set a default=0 or whatever, and
then have your menuentry lines.

-- 
Rich

Reply via email to