[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to chain-load Debian

From: Carlo Zancanaro
Subject: Re: Unable to chain-load Debian
Date: Wed, 06 Mar 2024 22:38:50 +1100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi William,

I don't know anything about Grub chainloading, but I had a quick look
and I think I have a vague idea what's going on.

The menu entry is put together by this code in gnu/bootloader/grub.scm:

--8<---------------cut here---------------start------------->8---
        #~(format port "
menuentry ~s {
  chainloader ~a
                  #$(grub-root-search device chain-loader)
--8<---------------cut here---------------end--------------->8---

Where "label", "device" and "chain-loader" are bound to their values
from the provided menu-entry record.

This calls grub-root-search to emit a grub "search" command. This
function has the following:

--8<---------------cut here---------------start------------->8---
(define (grub-root-search device file)
  (if (and (string? file) (not (string-prefix? "/" file)))
--8<---------------cut here---------------end--------------->8---

In your config, chain-loader is "+1", so when this is passed in as
"file" the conditions both pass: it is a string, and it does not start
with a "/". Thus, the root-search returns the empty string, which is
dutifully inserted into your grub.cfg file.

I think this is a bug. Unfortunately I'm not familiar enough with this
code to know how to fix it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]