Il 06/04/20 20:51, Jonathan Billings ha scritto:> On Mon, Apr 06, 2020 at 04:03:53PM +0200, Alessandro Baggi wrote: >> I'm on 8.1. I'm searching help to see if this is a bug or error by me but >> can't find nothing. >> Currently I used grubby but it does not write any file that I know like >> /boot/efi/EFI/centos/grub.cfg (I tried to remove and add arg but nothing >> changed on files), so I don't know where it make update. >> >> I never got a problem using grub2-mkconfig -o file on C7 (last used was 7.5) >> It always worked as expected to me (for example when I installed nvidia >> driver using NVIDIA package to blacklist nouveau manually). > In CentOS 8, GRUB2 uses 'blscfg' to store bootloader-independent boot > entries in /boot/loader/entries (by default). grub2-mkconfig > generates an initial configuration but grubby modifies the individual > bootloader spec files in the entries directory. After It's updated > the kernel arguments, it overrides the kernelopts in the grub.cfg and > hard-codes them per-spec file. > > In addition to providing a bootloader-agnostic config file, another > benefit of blscfg is that the EFI volume is usually a FAT32 filesystem > and can't recover easily from filesystem errors. We want to avoid > writing to the EFI volume repeatedly, so we write a single > configuration once and it should remain static. New kernel entries > create new bootloader spec files in /boot/loader/entries/, which is on > the /boot filesystem, which is normally a journaled EXT4 or XFS > filesystem, which can recover better from failures. >Hi Jonathan, thank you for your explanation. So in el8 grubby should be used to update kernel opts and grub2-mkconfig is used to generate an initial config. If I'm not wrong, grubby updates every single (sperated) entries on /boot/loader/entries and then generate the /boot/efi/EFI/centos/grub.cfg? Suppose that I want use only grub2-mkconfig to generate the grub.cfg what other operation are needed to make it working? Thank you in advance.
On Apr 7, 2020, at 04:14, Alessandro Baggi <alessandro.baggi at gmail.com> wrote:> thank you for your explanation. So in el8 grubby should be used to update kernel opts and grub2-mkconfig is used to generate an initial config. > > If I'm not wrong, grubby updates every single (sperated) entries on /boot/loader/entries and then generate the /boot/efi/EFI/centos/grub.cfg? > > Suppose that I want use only grub2-mkconfig to generate the grub.cfg what other operation are needed to make it working?grubby only alters the existing configuration. It never regenerates the grub.cfg in EFI. You can?t use ?grub2-mkconfig? to create individual boot spec entries. -- Jonathan Billings <billings at negate.org>
Il 08/04/20 01:46, Jonathan Billings ha scritto:> On Apr 7, 2020, at 04:14, Alessandro Baggi <alessandro.baggi at gmail.com> wrote: >> thank you for your explanation. So in el8 grubby should be used to update kernel opts and grub2-mkconfig is used to generate an initial config. >> >> If I'm not wrong, grubby updates every single (sperated) entries on /boot/loader/entries and then generate the /boot/efi/EFI/centos/grub.cfg? >> >> Suppose that I want use only grub2-mkconfig to generate the grub.cfg what other operation are needed to make it working? > grubby only alters the existing configuration. It never regenerates the grub.cfg in EFI. > > You can?t use ?grub2-mkconfig? to create individual boot spec entries. > > -- > Jonathan Billings <billings at negate.org>Please explain how the process work, it is not so clear for me. I'm confused. In C7 when I need to modify grub menu kernel option I modify /etc/default/grub and run grub2-mkconfig and thats all. It always worked for me. On C8 this does not work anymore, grub2-mkconfig is not enough, it generates only the grub.cfg but it does not update the menu entries and need to modify each entry using grubby. At this point what grub.cfg is used for if directives are not loaded by it and need grubby to modify entries? I'm missing something....