Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Hubris?
Date: Tue, 28 Jul 2015 16:26:26
Message-Id: CAGfcS_kGuJW66q9RT3Yo-cSfUEHnSAwby8Hc30sobsobuXeghQ@mail.gmail.com
In Reply to: Re: [gentoo-user] Hubris? by Peter Humphrey
1 On Tue, Jul 28, 2015 at 10:40 AM, Peter Humphrey <peter@××××××××××××.uk> wrote:
2 > On Tuesday 28 July 2015 08:31:58 Rich Freeman wrote:
3 >> On Tue, Jul 28, 2015 at 8:16 AM, Neil Bothwick <neil@××××××××××.uk> wrote:
4 >
5 >> > I've just installed a new laptop with it, using btrfs
6 >> > for everything but /boot.
7 >
8 > I know you use grub-2, which can boot that setup, but I suppose I'd need an
9 > init thingy if I stick to grub legacy.
10
11 You may not need an initramfs to run root on btrfs as long as btrfs is
12 compiled into your kernel (I haven't looked into it closely though).
13 You WOULD need a boot partition on ext4 to store your kernel on, since
14 grub legacy can't read a kernel/initramfs off of btrfs.
15
16 All grub does is read your kernel and initramfs and run the kernel.
17 The kernel actually does all the drive mounting/etc. So, as long as
18 grub can read your kernel (and initramfs if you're using one) then
19 you're fine, since the kernel can do just about anything.
20
21 And this is one of the whole points of projects like
22 linuxbios/coreboot/etc. Traditionally PC bootloaders have been pretty
23 limited in capabilities, so by using a linux kernel as your bootloader
24 you can potentially boot anything linux+userspace can read (such as
25 retrieving a kernel image and root squashfs from an FTP site and
26 booting it, or running an SMTP server and booting whatever kernel
27 somebody emails as an attachment - ok, I'm going a bit crazy with that
28 one).
29
30 >
31 > My main reason for preferring grub legacy is illustrated by my present
32 > grub.conf:
33 >
34 > title=Gentoo Linux 4.0.5
35 > kernel /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 net.ifnames=0 irqpoll
36 >
37 > title=Gentoo Linux 4.0.5, no X
38 > kernel /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 softlevel=nox net.ifnames=0 irqpoll
39 >
40 > title=Gentoo Linux 4.0.5, no network
41 > kernel /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 softlevel=nonet net.ifnames=0 irqpoll
42 >
43 > title=Gentoo Linux 3.18.16
44 > kernel /boot/kernel-x86_64-3.18.16-gentoo root=/dev/md5 net.ifnames=0 irqpoll
45 >
46 > title=Gentoo Linux 3.18.16, no X
47 > kernel /boot/kernel-x86_64-3.18.16-gentoo root=/dev/md5 softlevel=nox net.ifnames=0 irqpoll
48 >
49 > title=Gentoo Linux 3.18.16, no network
50 > kernel /boot/kernel-x86_64-3.18.16-gentoo root=/dev/md5 softlevel=nonet net.ifnames=0 irqpoll
51 >
52 > title=Rescue System 3.18.12
53 > kernel /boot/kernel-x86_64-3.18.12-gentoo-rescue root=/dev/sda8 net.ifnames=0 irqpoll
54 >
55 > title=Rescue System 4.0.5
56 > kernel /boot/kernel-x86_64-4.0.5-gentoo-rescue root=/dev/sda8 net.ifnames=0 irqpoll
57 >
58 > I know it's supposed to be possible to set up something like that in grub-2,
59 > but last time I tried it I got into a mess and gave up.
60 >
61 > As you say, guidance is hard to find.
62
63 Yeah, that one probably would need some hand-rolling unless you
64 basically wanted to write your own mkconfig plugins or your own
65 mkconfig.
66
67 But, it is certainly possible to hand-roll that.
68
69 Something like:
70
71 menuentry 'Gentoo Linux 4.0.5' {
72 linux /boot/kernel-x86_64-4.0.5-gentoo root=/dev/md5 net.ifnames=0 irqpoll
73 }
74 ...
75
76 You need all the header stuff like setting your root and such. The
77 syntax changed a little from legacy grub, but it is all the same
78 thing. If you look at the mkconfig-generated files you'll see a ton
79 of wrapper scripting/etc that is completely unnecessary if you're
80 hand-rolling it. There is actually very little you need to make it
81 work. Just set root= whatever, maybe set a default=0 or whatever, and
82 then have your menuentry lines.
83
84 --
85 Rich

Replies

Subject Author
Re: [gentoo-user] Hubris? Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] Hubris? Bruce Schultz <brulzki@×××××.com>