[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Handle errors when booting
From: |
Andrei Borzenkov |
Subject: |
Re: Handle errors when booting |
Date: |
Mon, 29 Jan 2024 14:26:12 +0300 |
On Mon, Jan 29, 2024 at 2:15 PM Mathias Radtke <m.radtke@uib.de> wrote:
>
> Hi,
>
> I currently have a little headache with an issue.
> I have a device that gets the following part of grub.cfg
>
>
> search --no-floppy --file --set=bootable_efi
> /EFI/MICROSOFT/BOOT/BOOTMGFW.EFI
>
> if [ -n "${bootable_efi}" ]; then
>
> menuentry "Local Disk" --class unknown {
>
> set root="${bootable_efi}"
>
> chainloader /EFI/MICROSOFT/BOOT/BOOTMGFW.EFI
>
> boot
>
> }
>
> This leads to an error "error: loader/efi/chainloader.c:733not a valid root
> device."
Upstream efi/chainloader.c does not have 733 lines nor does it care
about $root at all. You are probably using vendor patched grub, in
which case you better direct this question to your vendor support
channels.
> Is there any way to kind of work around that error and run an "exit" command
> if an error occours?
>
What is the exit code of chainloader command? If it is non-zero, you
can check for it and do something else instead of boot.