help-grub
[Top][All Lists]
Advanced

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

Re: grub-mkimage


From: Andrei Borzenkov
Subject: Re: grub-mkimage
Date: Wed, 26 Jan 2022 21:41:36 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 26.01.2022 12:34, Pascal wrote:
> hi,
> 
> thank you Andrei for taking the time to read and answer me.
> 
> I try to reduce the space taken by GRUB as much as possible.
> this way, I only have the bootloader and a basic configuration file :
> 
> # ll -h /run/live/bootmnt/efi/boot/bootx64.efi
> -rwxr-xr-x 1 root root 584K 26 janv. 07:46
> /run/live/bootmnt/efi/boot/bootx64.efi
> 
> # cat /run/live/bootmnt/efi/menu.cfg
> menuentry MyLiveSystem {
> linux /boot/kernel ...
> initrd /boot/initramfs
> }
> 
> I tried to remove efi_gop and efi_uga but I always get (at least with Qemu)
> the following error message :
> 
> error: no suitable video mode found.
> Booting in blind mode
> 

Yes, grub tries to set suitable video mode for Linux kernel. Sorry. You do need
video driver for your platform, I was wrong.

> adding video and/or video_fb modules (which are required/used by efi_*
> modules) does not change anything.
> 
> I tried to use grub-mkstandalone but I fail to generate a bootloader that
> works as simply as my tiny one.
> here is the command used :
> 
> grub-mkstandalone \
>    --disable-shim-lock \
>    --fonts="" --locales="" --themes="" \
>    --modules="linux normal minicmd gzio efi_uga efi_gop fat part_gpt chain"
> \
>    -o /run/live/bootmnt/efi/boot/test.efi \
>    -O x86_64-efi \
>    "boot/grub/grub.cfg=/run/live/bootmnt/efi/menu.cfg"
> 
> as root and prefix use (memdisk), I get the following error message :
> 
> error: file `/boot/kernel' not found.
> 
> only the cmdpath variable refers to my disk with (hd0,gpt2)/efi/boot.
> it works once the root variable is manually set to (hd0,gpt2) (but not with
> (,gpt2)).
> 

Which is correct. ",gpt2" works only during early initialization.

If you want to create image that will always boot from the same USB stick, just
use search command to find this stick (e.g. using filesystem UUID or designated
file on this stick). If you want to create image that boots from arbitrary 
stick,
you could utilize $cmdpath.

But whatever works for you. May be removing native drivers from image is enough.



reply via email to

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