[sf-lug] GRUB2 question

Rick Moen rick at linuxmafia.com
Sun Feb 7 18:56:31 PST 2021


Quoting aaronco36 (aaronco36 at SDF.ORG):

> Have the "new" desktop Lenovo from Tom set up with Slackware Linux,
> Devuan GNU+Linux and Debian GNU/Linux in a triple multiboot from a
> single /boot
> partition's grub.cfg
> Am trying to determine how the grub.cfg's "--class" directive can be
> best specified for Devuan other than its default "--class debian
> --class gnu-linux --class gnu --class os"?
> 
> According to a grub support webpage https://support.huaweicloud.com/intl/en-us/usermanual-ims/ims_01_0324.html
> , ......"menuentry 'Ubuntu Linux, with Linux 3.13.0-24-generic'
> --class ubuntu --class gnu-linux --class gnu --class os " should
> work fine specifically for Ubuntu, so why shouldn't it be similar
> for a Devuan grub.cfg entry as "--class devuan --class gnu-linux
> --class gnu --class os" ??
> 
> Still doing research on this; any further input welcome :-)

I can't really help much because I've strenuously avoided GRUB2 so far,
so the only way I'd be able to give substantive help would require 
researching it, starting from close to zero.

That having been said, when I was hearing on the Jitsi Meet instance
people (you?  someone) claiming you customise GRUB2 for qualifying OSes
using the --class directive, I was surprised and doubtful about whether
that is true.

Why?  Because GRUB has always been maintained by GNU Project as a
bootloader project that is OS-independent and neither knows nor cares
what you boot from it.  It's definitely _not_ strongly tied to Linux, as 
you may recall that FSF has a love-hate relationship with the Linux
kernel and thinks of it as one kernel among others that could be used in
a GNU system.  Anyway, as far as I'm aware (and last I heard), the
closest GRUB has ever come to knowing or caring what you are booting 
is that, in order to boot anything, it must be able to parse the
filesystem all its pieces and referenced objects live on.  (Thus the
fact that it has a device-numbering system of its own that is distinct
from Linux's.)  

This trait of needing to be able to parse filesystem semantics to find
things referenced in grub.cfg is a fundamental difference from, say, the
old lilo bootloader.  With lilo, any time the things you referenced in
lilo.conf got moved or replaced, you needed to re-run /sbin/lilo, the
'map installer', which updated the lilo boot code's internal map in
terms of cylinders, heads, sectors and byte size of things it needed to
find at boot time.  Therefore, at boot time, lilo didn't need to
navigate filesystems to find things, as it didn't rely on that view of
the world, to do so.

Anyway, beyond that (saying I a-priori doubt that --class has
OS-specific functionality, because according to my understanding, GRUB 
doesn't care or know about your OSes), I lack adequate knowledge to speak 
further.

-- 
Cheers,                         "2021 showed up, and told 2020 'hold my beer.'"
Rick Moen                                                   -- @justinaireland
rick at linuxmafia.com
McQ! (4x80)



More information about the sf-lug mailing list