Can anyone explain why, and how I can fix this in a way that will
still work the next time the bookworm kernel gets an update?
I am curious to know from Debian
GRUBbers (as it were) if the behaviour I am describing in this thread
is expected...
Mark Fletcher composed on 2023-12-20 00:28 (UTC):
I am curious to know from Debian
GRUBbers (as it were) if the behaviour I am describing in this thread
is expected...
I suspect few if any regulars here spend much time with Slackware. I think a more
conventional approach would be to reconfigure Slackware to boot by UUID, with the
result that Debian's os-prober should pick it up in the more reliable fashion. I
don't have a bootloader installed on my only Slackware, and have no more familiarity with ELILO than that it seems to be the Slack user favorite bootloader. Whether or how well it or its Grub might pick up Debian, or any proclivity it may have to usurp boot control from Debian or include stanza(s) for
Debian, I have no basis for guessing.
If you can keep your Slack kernel (& initrd if using one) generically symlinked
without much trouble, a stanza you put in /etc/grub.d/41_custom should be able to
boot Slack from Debian's Grub using your custom stanza containing root=LABEL= or
root=UUID= without trouble. Same would go for using 07_custom, or custom.cfg with
06_custom, to move your custom stanza to the Debian Grub menu's top.
In case it's not clear, "generically symlinked" means that
/vmlinuz is a symlink pointing to the most recent linux-image.
(Similarly for initrd.) I added the following to
/etc/grub.d/07_custom:
menuentry 'My bullseye' $menuentry_id_option 'custom' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --set=root --label noah03
echo 'Load /vmlinuz …'
linux /vmlinuz root=LABEL=noah03 ro systemd.show_status=true quiet
echo 'Load initial ramdisk /initrd.img …'
initrd /initrd.img
}
I suspect few if any regulars here spend much time with Slackware.
Felix Miata wrote:
I suspect few if any regulars here spend much time with Slackware.
I am genuinely confused about how Slackware came into the picture
here... my foreign OS is LFS, nothing to do with slackware as far as I know...
I appreciate your initial help which I still think is my best hope of
a solution
From one PC here currently booted:# grep vmlinuz /boot/grub2/custom.cfg | wc -l
From one PC here currently booted:# grep vmlinuz /boot/grub2/custom.cfg | wc -l
21
# grep root= /boot/grub2/custom.cfg | wc -l
21
# grep root=LABEL /boot/grub2/custom.cfg | wc -l
21
On Wed, 20 Dec 2023 at 06:01, David Wright <deblis@lionunicorn.co.uk> wrote:
I can't see anywhere where the OP claims to have set up LFS for
booting itself, as opposed to being booted from a Debian Grub.
It only says "I have been able to get a grub.cfg including the
LFS system …", which seems to imply LFS has only been set up
as a "foreign" system by a Debian system.
Yes, that's exactly it. My very first attempt involved using Debian's
/boot partition as the /boot partition for LFS as well, so installing
LFS's kernel (6.4.12 IIRC) alongside Debian's, but I quickly learned
the folly of that when I saw the mess update-grub made of that...
So I rebuilt my LFS (was happy to do so, this is a learning exercise)
with its own /boot partition, which gets me closer to the solution I
want which is one Grub, Debian's grub, with Debian as the first and
default boot choice, but LFS available as an alternative. And the only remaining problem is the Debian GRUB's insistence on using /dev/sdX2
(for the root partition is the second partition on the disk) in the
"linux" command line parameter.
When os-prober runs on my system, a lot of stuff gets logged in
messages, syslog and user.log. The lines that contain the string
"result:" (without the quotes) are interesting. It's evident from
those that have six fields following result: have had their root=
field copied from the foreign system's grub.cfg. (In my case,
"foreign" means a Debian system of the previous release.)
When os-prober writes several clauses into my new grub.cfg's
"### BEGIN /etc/grub.d/30_os-prober ###" section, the references
to the partition are constructed using UUIDs (not PARTUUIDs, because there's an initrd). However, the kernel command line reads "root=LABEL=toto04", so that string wasn't constructed by os-prober,
but copied from the foreign grub.cfg.
That suggests to me the probability that whereas +Grub constructs+
the root= strings for the "### BEGIN /etc/grub.d/10_linux ###"
section, +os-prober copies+ the root= strings into the
"### BEGIN /etc/grub.d/30_os-prober ###" section instead.
Interesting -- but there is no grub.cfg on the LFS system because grub
has never been installed there. There is a /boot partition but no /boot/grub/grub.cfg <suddenly doubts self, and goes to check --
indeed, there isn't>.
So, nothing to copy from in this case.
The question is, what values are config_directory and prefix set to?
I have just discovered that I
had a typo in my custom.cfg file, and when I fixed it, it worked.
Thanks all for your help with this.
On Fri, 22 Dec 2023 at 01:21, David Wright <deblis@lionunicorn.co.uk> wrote:
What sort of mess? I would have thought Grub would ignore excess[ … ]
kernels dropped into /boot.
It saw a Debian kernel (6.1.something) on <debian boot partition>/ and
a LFS kernel (6.4.12 IIRC) on <the same Debian boot partition>/. It
also saw candidate root filesystems on <debian lvm root> and <LFS root partition>. And it proceeded to cartesian join them, so I got LFS
kernel with debian root filesystem, Debian kernel with Debian root filesystem, LFS kernel with LFS root filesystem (specified by
/dev/sdc2 which the very next time it booted that disk was /dev/sda2)
and Debian kernel with LFS root filesystem (again specified by device
name). Obviously, only 2 of those are things I'd ever want to boot.
And, once I saw what it had done, I kinda slapped my forehead and
thought well yeah, how was it supposed to know not to do that...
I've never run LFS; what does the menuentry in grub.cfg look like?[ … ]
That is AFTER my edits to replace root=/dev/sdc2 in the linux command
line with the PARTUUID. The FS UUIDs I elided above were put there by
GRUB. Again, Debian GRUB created this when I ran it with os_prober
turned ON. I grabbed this and copied it to custom.cfg, made the edit
to add the PARTUUID, then ran update-grub again with os_prober turned
off.
Ah hold on. Maybe os_prober is what is generating this menuentry
stanza in the first place, and grub is just using it. If that's the
case, I was asking the wrong question in the first place. Maybe the
question isn't why isn't grub using PARTUUID= in this situation, which
the manual says it will, but rather why isn't os_prober doing so?
I don't know how it figured out /dev/sdc2 -- on the one hand it is
clever to have done so with no grub.cfg to tell it,
on the other I
wish it were clever enough to use PARTUUID= instead, as the
grub-mkconfig manual implies it is.
That all said, the updated idea of trying 40_custom instead of
41_custom and thus avoiding the question of the config_directory
variable is what I will try next.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (0 / 16) |
Uptime: | 00:05:36 |
Calls: | 6,669 |
Calls today: | 1 |
Files: | 12,216 |
Messages: | 5,338,431 |