error10 / kexec-reboot

Reboot in seconds, not minutes
GNU General Public License v3.0
250 stars 29 forks source link

broken on BLS configs (EL8, FC31+) fails with "Couldn't find a grub configuration anywhere!" #13

Open mailinglists35 opened 5 years ago

mailinglists35 commented 5 years ago
$ sudo dnf install ruby
Fedora Modular 31 - x86_64                                                                                               25 kB/s |  24 kB     00:00
Fedora Modular 31 - x86_64 - Updates                                                                                     27 kB/s |  19 kB     00:00
Fedora 31 - x86_64 - Updates                                                                                             23 kB/s |  19 kB     00:00
Fedora 31 - x86_64                                                                                                       22 kB/s |  24 kB     00:01
ZFS on Linux for Fedora 31                                                                                              4.8 kB/s | 3.0 kB     00:00
Dependencies resolved.
========================================================================================================================================================
 Package                                     Architecture                  Version                                 Repository                      Size
========================================================================================================================================================
Installing:
 ruby                                        x86_64                        2.6.5-124.fc31                          updates                         42 k
Installing dependencies:
 ruby-libs                                   x86_64                        2.6.5-124.fc31                          updates                        3.0 M
 rubygem-irb                                 noarch                        1.0.0-124.fc31                          updates                         64 k
 rubygem-psych                               x86_64                        3.1.0-124.fc31                          updates                         51 k
 rubygem-json                                x86_64                        2.2.0-201.fc31                          fedora                          57 k
 rubypick                                    noarch                        1.1.1-11.fc31                           fedora                         9.8 k
Installing weak dependencies:
 rubygem-bigdecimal                          x86_64                        1.4.1-124.fc31                          updates                         57 k
 rubygem-did_you_mean                        noarch                        1.3.0-124.fc31                          updates                         37 k
 rubygem-io-console                          x86_64                        0.4.7-124.fc31                          updates                         22 k
 rubygem-openssl                             x86_64                        2.1.2-124.fc31                          updates                        154 k
 rubygem-rdoc                                noarch                        6.1.2-124.fc31                          updates                        408 k
 rubygems                                    noarch                        3.0.3-124.fc31                          updates                        247 k

Transaction Summary
========================================================================================================================================================
Install  12 Packages

Total download size: 4.1 M
Installed size: 15 M
Is this ok [y/N]: y
Downloading Packages:
Fedora 31 - x86_64 - Updates                            181% [==========================================================================================(1/12): ruby-2.6.5-124.fc31.x86_64.rpm                                                                                  111 kB/s |  42 kB     00:00
(2/12): rubygem-bigdecimal-1.4.1-124.fc31.x86_64.rpm                                                                    149 kB/s |  57 kB     00:00
(3/12): rubygem-io-console-0.4.7-124.fc31.x86_64.rpm                                                                    273 kB/s |  22 kB     00:00
(4/12): rubygem-did_you_mean-1.3.0-124.fc31.noarch.rpm                                                                  405 kB/s |  37 kB     00:00
(5/12): rubygem-irb-1.0.0-124.fc31.noarch.rpm                                                                           541 kB/s |  64 kB     00:00
(6/12): rubygem-psych-3.1.0-124.fc31.x86_64.rpm                                                                         407 kB/s |  51 kB     00:00
(7/12): rubygem-openssl-2.1.2-124.fc31.x86_64.rpm                                                                       619 kB/s | 154 kB     00:00
(8/12): rubygems-3.0.3-124.fc31.noarch.rpm                                                                              1.0 MB/s | 247 kB     00:00
(9/12): rubygem-json-2.2.0-201.fc31.x86_64.rpm                                                                          537 kB/s |  57 kB     00:00
(10/12): rubypick-1.1.1-11.fc31.noarch.rpm                                                                              173 kB/s | 9.8 kB     00:00
(11/12): rubygem-rdoc-6.1.2-124.fc31.noarch.rpm                                                                         659 kB/s | 408 kB     00:00
(12/12): ruby-libs-2.6.5-124.fc31.x86_64.rpm                                                                            1.7 MB/s | 3.0 MB     00:01
--------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                   1.3 MB/s | 4.1 MB     00:03
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                1/1
  Installing       : ruby-libs-2.6.5-124.fc31.x86_64                                                                                               1/12
  Installing       : rubygem-bigdecimal-1.4.1-124.fc31.x86_64                                                                                      2/12
  Installing       : rubygem-did_you_mean-1.3.0-124.fc31.noarch                                                                                    3/12
  Installing       : rubygem-io-console-0.4.7-124.fc31.x86_64                                                                                      4/12
  Installing       : rubygem-irb-1.0.0-124.fc31.noarch                                                                                             5/12
  Installing       : rubygem-openssl-2.1.2-124.fc31.x86_64                                                                                         6/12
  Installing       : rubygem-psych-3.1.0-124.fc31.x86_64                                                                                           7/12
  Installing       : rubygem-rdoc-6.1.2-124.fc31.noarch                                                                                            8/12
  Installing       : rubygem-json-2.2.0-201.fc31.x86_64                                                                                            9/12
  Installing       : rubygems-3.0.3-124.fc31.noarch                                                                                               10/12
  Installing       : rubypick-1.1.1-11.fc31.noarch                                                                                                11/12
  Installing       : ruby-2.6.5-124.fc31.x86_64                                                                                                   12/12
  Running scriptlet: ruby-2.6.5-124.fc31.x86_64                                                                                                   12/12
  Verifying        : ruby-2.6.5-124.fc31.x86_64                                                                                                    1/12
  Verifying        : ruby-libs-2.6.5-124.fc31.x86_64                                                                                               2/12
  Verifying        : rubygem-bigdecimal-1.4.1-124.fc31.x86_64                                                                                      3/12
  Verifying        : rubygem-did_you_mean-1.3.0-124.fc31.noarch                                                                                    4/12
  Verifying        : rubygem-io-console-0.4.7-124.fc31.x86_64                                                                                      5/12
  Verifying        : rubygem-irb-1.0.0-124.fc31.noarch                                                                                             6/12
  Verifying        : rubygem-openssl-2.1.2-124.fc31.x86_64                                                                                         7/12
  Verifying        : rubygem-psych-3.1.0-124.fc31.x86_64                                                                                           8/12
  Verifying        : rubygem-rdoc-6.1.2-124.fc31.noarch                                                                                            9/12
  Verifying        : rubygems-3.0.3-124.fc31.noarch                                                                                               10/12
  Verifying        : rubygem-json-2.2.0-201.fc31.x86_64                                                                                           11/12
  Verifying        : rubypick-1.1.1-11.fc31.noarch                                                                                                12/12

Installed:
  ruby-2.6.5-124.fc31.x86_64                       rubygem-bigdecimal-1.4.1-124.fc31.x86_64         rubygem-did_you_mean-1.3.0-124.fc31.noarch
  rubygem-io-console-0.4.7-124.fc31.x86_64         rubygem-openssl-2.1.2-124.fc31.x86_64            rubygem-rdoc-6.1.2-124.fc31.noarch
  rubygems-3.0.3-124.fc31.noarch                   ruby-libs-2.6.5-124.fc31.x86_64                  rubygem-irb-1.0.0-124.fc31.noarch
  rubygem-psych-3.1.0-124.fc31.x86_64              rubygem-json-2.2.0-201.fc31.x86_64               rubypick-1.1.1-11.fc31.noarch

Complete!
$ wget https://raw.githubusercontent.com/error10/kexec-reboot/master/kexec-reboot
[...]
$ sudo ./kexec-reboot -ivr
Couldn't find a grub configuration anywhere!
mailinglists35 commented 5 years ago

fresh install of fc31 xfce iso flavour

mailinglists35 commented 5 years ago

efi secure boot

mailinglists35 commented 5 years ago

note that on fc31 the entries are no longer JUST in /boot/efi/EFI/fedora/grub.cfg but also the main entries are in /boot/loader/entries/b2f754e0ff6542d4942aa55930f2badb-5.3.7-301.fc31.x86_64.conf (random uuid for each entry)

https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/

mailinglists35 commented 5 years ago
grep -C2 blscfg /boot/efi/EFI/fedora/grub.cfg
# will be lost the next time file is regenerated. Instead edit the BootLoaderSpec files.
#
# The blscfg command parses the BootLoaderSpec files stored in /boot/loader/entries and
# populates the boot menu. Please refer to the Boot Loader Specification documentation
# for the files format: https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/.
--
set default_kernelopts="root=/dev/mapper/root_lv-root ro rd.luks.uuid=luks-c1e2339a-a965-4d1f-b7c0-51d88c6bcaed rd.lvm.lv=root_lv/root rhgb quiet"

insmod blscfg
blscfg
mailinglists35 commented 3 years ago

https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault

mailinglists35 commented 3 years ago

https://systemd.io/BOOT_LOADER_SPECIFICATION/

mailinglists35 commented 3 years ago

enabled by default on rhel 8 & clones and post fedora 31

mailinglists35 commented 3 years ago

this affects bios setups as well, not just efi

mailinglists35 commented 3 years ago

the script is right to tell there is no grub configuration, because with BLS enabled, /boot/grub2/grub.cfg has no kernel entries. instead they are moved into separate files in /boot/loader/entries/*.conf

[root@optiplex ~]# tree -I '*.mod' /boot/
/boot/
├── config-5.4.17-2036.104.5.el8uek.x86_64
├── efi
│   └── EFI
│       └── redhat
├── grub2
│   ├── device.map
│   ├── fonts
│   │   └── unicode.pf2
│   ├── grub.cfg
│   ├── grubenv
│   └── i386-pc
│       ├── boot.img
│       ├── command.lst
│       ├── core.img
│       ├── crypto.lst
│       ├── fs.lst
│       ├── load.cfg
│       ├── moddep.lst
│       ├── modinfo.sh
│       ├── partmap.lst
│       ├── parttool.lst
│       ├── terminal.lst
│       └── video.lst
├── initramfs-0-rescue-1cf5faf2482d43329cdc1b7a583798b2.img
├── initramfs-5.4.17-2036.104.5.el8uek.x86_64.img
├── initramfs-5.4.17-2036.104.5.el8uek.x86_64kdump.img
├── loader
│   └── entries
│       ├── 1cf5faf2482d43329cdc1b7a583798b2-0-rescue.conf
│       └── 1cf5faf2482d43329cdc1b7a583798b2-5.4.17-2036.104.5.el8uek.x86_64.conf
├── lost+found
├── symvers-5.4.17-2036.104.5.el8uek.x86_64.gz
├── System.map-5.4.17-2036.104.5.el8uek.x86_64
├── vmlinuz-0-rescue-1cf5faf2482d43329cdc1b7a583798b2
└── vmlinuz-5.4.17-2036.104.5.el8uek.x86_64
[root@optiplex ~]# egrep -i 'kernel|linux' /boot/grub2/grub.cfg|grep -v ^\#
if [ -z "${kernelopts}" ]; then
  set kernelopts="root=/dev/mapper/ol-root ro crashkernel=auto resume=/dev/mapper/ol-swap rd.luks.uuid=luks-3d45e902-8a78-4a92-b756-636ccaa21e34 rd.lvm.lv=ol/root rd.lvm.lv=ol/swap "