help-grub
[Top][All Lists]
Advanced

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

chainloader peculiarity


From: Harald Fricke
Subject: chainloader peculiarity
Date: Thu, 19 Oct 2017 13:07:20 +0200 (CEST)

Hello,

I am trying to boot an "i386-pc" server using GRUB chain loading. I want the 
first GRUB installation to search by label for the disk containing the actual 
OS to be booted.

Implementation used: GRUB 2.02 as supplied on the arch linux 2017.10.01 live 
system .iso.

Disk layout:
(hd0) (hd0,msdos1) : USB memory key holding "primary" GRUB installation created 
with arch linux.
(hd1)  (hd1,gpt1)  (hd1,gpt2): FreeNAS 11 installation using "secondary" GRUB 
2.02 beta 2 to boot off a zfs partition. This has been verified to boot as 
expected by removing all other disks from the system.

Problem: The following sequence of commands from the primary GRUB shell 
successfully loads the secondary GRUB

echo $root # prints hd0,msdos1
set root=(hd1)
chainloader (hd1)0+1
boot

while the following commands crash after "boot" with an illegal instruction at 
EIP 7

echo $root # prints hd0,msdos1
chainloader (hd1)0+1
boot

>From the GNU documentation and from instructions found on the net 
>(https://wiki.bsdforen.de/howto:grub2-anleitung) I would have expected that 
>"chainloader" takes a file as an argument, which may be an absolute path 
>including a device.

However, looking at the source code in grub-core/loader/i386/pc/chainloader.c
I'd say that chainloader uses the information from the root variable in some 
places and the path supplied as an argument in other places, possibly causing 
the boot process to crash.

Could this behavior of chainloader be considered a bug? If not, would it be 
possible to update the documentation to reflect the observed behavior? I think 
it would be helpful if chainloader would issue at least a warning if passed an 
absolute path.

Regards
Harald Fricke



reply via email to

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