Re: How do I rebuild Grub/Boot/initramfs from a Live USB?

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

 



On Sat, 29 Oct 2022 18:38:53 -0400
Felix Miata <mrmazda@xxxxxxxxxxxxx> wrote:

> stan via users composed on 2022-10-29 11:55 (UTC-0700):
> 
> >> I hadn't even looked into creating a new partition under
> >> /boot/efi/EFI with a unique name, and what would be required for
> >> it to work.  Is it really as simple as changing GRUB_DISTRIBUTOR=
> >> in /etc/default/grub, and everything else happens automatically?  
> 
> > How would dnf know about that changed name in order to install the
> > shim?  
> 
> DNF knows because it's a front-end to RPM, which operates according
> to the content of the grub2-efi rpm and /etc/default/grub, Grub's
> config file. Pretend it has .conf appended if necessary to
> understand. The value set for GRUB_DISTRIBUTOR= establishes the
> location on the ESP where the efi file(s) must be located.

This is good to know.  I had assumed that the shim location was
hardcoded in the rpm, so this is more flexible.
> 
> > How would the OS be installed initially, since the defaults are for
> > the current location?  
> 
> I have no idea whether the default location can be overridden
> /during/ Fedora installation. As long as the location has been made
> unique for each previous installation, it doesn't matter that the
> default is used initially. Just make
> 
> 	# dnf reinstall shim-* grub2-efi-* grub2-common
> 
> part of your standard first boot order of business, and the efi
> directory /should/ be good indefinitely. But, be on the lookout for
> unexpected changes to /etc/default/grub that might change it.

It seems that Fedora could facilitate this by appending a (random?)
suffix to the GRUB_DISTRIBUTOR value during install, so that this step
was automatically completed.  A more sophisticated implementation might
examine other entries, and append a sequential value, or ensure that
the suffix was unique.

> There remains the issue of whose bootloader has priority in firmware
> memory, and on what occasions when OS maintenance activity has reason
> to touch it. Efibootmgr is the utility for managing the NVRAM entries
> while fully booted, while BIOS setup includes its own. My solution to
> avoiding OS touching is to install any bootloader at all on a minimal
> selection of installations, such as only one. On others that have a
> bootloader installed, I omit the ESP from their fstabs, preventing
> them from finding conditions prerequisite to touching.
> 
> Finally, I build /boot/grub2/custom.cfg from scratch that uses volume
> LABELs and symlinks to kernels and initrds, and customize
> /etc/grub.d/ to cause its entries to head Grub's menu.

I think this means that if you update any of the installed OSs, you
have to recreate the custom.cfg menu to incorporate the changes.  And
that you have to have a custom utility you run in order to do that.
Would you be willing to share that utility, and your customizations of
/etc/grub.d?

This will work great, but I wouldn't consider it trivial for a new
user of Fedora.

Thanks for the information, filling out my sketchy understanding.  I now
understand how to accomplish running multiple versions of an OS with a
single EFI partition using grub.
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux