Fix failure to request grub.cfg over HTTP
Some ARM fixes (pbrobinson)
Preserve multi-device workflows (Yclept Nemo)
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Fix --bls-directory option comment in grub2-switch-to-blscfg man page
Resolves: rhbz#1714835
10_linux_bls: use '=' to separate --id argument due a Petitboot bug
grub-set-bootflag: Print an error if failing to read from grubenv
Resolves: rhbz#1702354
10_linux: generate BLS section even if no kernels are found in /boot
10_linux: don't search for OSTree kernels
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The rpm-build's "debugedit" program will silently corrupt .debug_macro
strings when a binary is compiled with -g3. Later in the build phase,
gdb-add-index is invoked to extract the DWARF index from the binary,
and GDB will segfault because dwarf2read.c:parse_definition_macro's
'body' variable is NULL.
Resolves: rhbz#1708780
There's no point on executing the script if GRUB_ENABLE_BLSCFG has already
been set. Currently was checking if an user explicitly set it to false to
avoid enabling the BLS configuration, but it should also be avoided if was
already set to true by a previous package update or during installation.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The blscfg module isn't compatible with the GRUB core.img installed by any
release older than Fedora 21.
This is because the blscfg module calls to the grub_file_size() function to
check if the BLS file size is correct, but the struct grub_file used as the
parameter for this function changed in the GRUB version used in Fedora 21.
So the function returns a wrong file size due the .size field offset being
different in the older GRUB from Fedora 20 and earlier.
This is causing all the BLS files to be ignored due having a wrong size and
leading to GRUB menu not being populated on boot.
Related: rhbz#1652806
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
os-prober 1.75 dropped all the code for handling device mapper
directly in favor of only supporting the use of grub2-mount.
Thus, we now need grub2-mount to be built and packaged so that
os-prober can depend on it. We ship it in the grub2-tools-minimal
package to avoid creating a dependency loop between grub2-tools and
os-prober.
Resolves: rhbz#1471267
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
GRUB has an user-space program emulator that allows to parse config files
and execute boot entries using the kexec tool. Add a grub2-emu subpackage
to install the emulator.
The subpackage is disabled on ppc64le architecture for now since grub2-emu
fails to build there.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The GRUB configuration is switched to BLS using the grub2-switch-to-blscfg
script, which is installed by the grub2-tools package. Among other things,
the script copies the blscfg module from the /usr/lib/grub/$arch directory
to /boot/grub2/$arch.
This is done because for non-UEFI installs (i386-pc and powerpc-ieee1275)
the GRUB core and modules aren't updated on package upgrade, so the blscfg
module won't be the latest that contains the current BLS support.
But the grub2-switch-to-blscfg script is currently executed in grub2-tools
%post scritplet, which means that if the grub2-tools package is installed
before the grub2-pc-modules package (that installs the blscfg module), the
grub2-switch-to-blscfg script won't copy the latest version of the module.
This will make systems to fail to populate the GRUB menu, since its config
will already be migrated to BLS but the blscfg module won't be the latest.
So to make sure that the latest blscfg module is copied regardless of the
grub2-tools and grub2-pc-modules packages install order, run the switch
script in a grub2-tools %posttrans so it's executed at the end of the RPM
transaction once all the packages have been installed.
Resolves: rhbz#1652806
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The generated menu entries have a --users $grub_users option but this will
fail on old versions of GRUB, since it expects the --users option argument
to either be a constant or a variable that has been set.
The latest GRUB version fix this but the GRUB core isn't updated on a GRUB
package update, so this will cause the entries to not be shown in the menu
after a system upgrade.
Since can cause issues and because the entries that weren't generated from
the BLS snippets didn't have the --users option either, just don't add it.
Resolves: rhbz#1693515
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
There was an error in the logic that stored the parsed BLS snippets in the
sorted linked list that is used to populate the GRUB boot menu entries.
Also add a fix found by coverity scan about a possible undefined behaviour
due grub_efi_status_t having the wrong type.
Resolves: rhbz#1691232
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Commit bfc756f8d86 ("Set blsdir if the BLS directory path isn't one of the
looked up by default") attempted to set blsdir if /boot/loader/entries was
not the real path of the directory containing the BLS snippets. Which may
be the case if for example /boot/loader/entries is in a btrfs subvolume.
But in the case of ostree, /boot/loader is a symlink to the directory with
the entries for the current deployment. So with ostree the blsdir will be
wrongly set, since GRUB is able to follow the symlinks just fine. In fact,
it has to follow the symlink since otherwise GRUB will always use the BLS
files for the deployment that the symlink pointed out when blsdir was set.
So only set blsdir if /boot/loader/entries is in a btrfs or zfs partition.
Related: rhbz#1688453
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The switch to a BLS configuration was made before in the grubby package
%post scriptlet, but this is wrong since it means that a not up-do-date
grub2-switch-to-blscfg script could be used to do the switch.
Resolves: rhbz#1652806
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
20-grub-install: Replace, rather than overwrite, the existing kernel (pjones)
Resolves: rhbz#1642402
99-grub-mkconfig: Don't update grubenv generating entries on ppc64le
Related: rhbz#1637875
blscfg: fallback to default_kernelopts if BLS option field isn't set
Related: rhbz#1625124
grub-switch-to-blscfg: copy increment.mod for legacy BIOS and ppc64
Resolves: rhbz#1652806
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Don't make grub_strtoull() print an error if no conversion is performed
Resolves: rhbz#1674512
Set blsdir if the BLS directory path isn't one of the looked up by default
Resolves: rhbz#1657240
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
- Don't build the grub2-efi-ia32-* packages on i686 (pjones)
- Add efi-export-env and efi-load-env commands (pjones)
- Make it possible to subtract conditions from debug= (pjones)
- Try to set -fPIE and friends on libgnu.a (pjones)
- Add more options to blscfg command to make it more flexible
- Add support for prepend early initrds to the BLS entries
- Fix grub.cfg-XXX look up when booting over TFTP
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
BLS files should only be copied by grub-switch-to-blscfg if BLS isn't set
Related: rhbz#1638117
Fix get_entry_number() wrongly dereferencing the tail pointer
Resolves: rhbz#1654936
Make grub2-mkconfig to honour GRUB_CMDLINE_LINUX in /etc/default/grub
Resolves: rhbz#1637875
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Add comments and revert logic changes in 01_fallback_counting
Remove quotes when reading ID value from /etc/os-release
Related: rhbz#1650706
blscfg: expand grub_users before passing to grub_normal_add_menu_entry()
Resolves: rhbz#1650706
Drop buggy downstream patch "efinet: retransmit if our device is busy"
Resolves: rhbz#1649048
Make the menu entry users option argument to be optional
Related: rhbz#1652434
10_linux_bls: add missing menu entries options
Resolves: rhbz#1652434
Drop "Be more aggro about actually using the *configured* network device."
Resolves: rhbz#1654388
Fix menu entry selection based on title
Resolves: rhbz#1654936
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The installkernel-bls script is present in both the grub2-common and
grubby packages. But there's no need for this duplication and it can
just be installed by the grubby package.
Related: rhbz#1647721
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
If a debug kernel package is installed, the default entry should only
be set when DEFAULTDEBUG=yes is set in /etc/sysconfig/kernel.
Resolves: rhbz#1636346
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
- add 10_linux_bls grub.d snippet to generate menu entries from BLS files
Resolves: rhbz#1636013
- Only set kernelopts in grubenv if it wasn't set before
Resolves: rhbz#1636466
- kernel-install: Remove existing initramfs if it's older than the kernel (pjones)
Resolves: rhbz#1638405
- Update the saved entry correctly after a kernel install (pjones)
Resolves: rhbz#1638117
- blscfg: sort everything with rpm *package* comparison (pjones)
Related: rhbz#1638103
- blscfg: Make 10_linux_bls sort the same way as well
Related: rhbz#1638103
- don't set saved_entry on grub2-mkconfig
Resolves: rhbz#1636466
- Fix menu entry selection based on ID and title (pjones)
Resolves: rhbz#1640979
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
- Fix grub.cfg boot counting snippet generation (lorbus)
Resolves: rhbz#1614637
- Fix spurrious allocation error reporting on EFI boot
Resolves: rhbz#1635319
- Stop doing TPM on BIOS *again*. It just doesn't work.
Related: rhbz#1579835
- Make blscfg module loadable on older grub2 i386-pc and powerpc-ieee1275
builds
- Fix execstack cropping up in grub2-tools
- Ban stack trampolines with compiler flags.
Signed-off-by: Peter Jones <pjones@redhat.com>
Stop using pkexec for grub2-set-bootflag, it does not work under gdm instead
make it suid root (it was written with this in mind)
Signed-off-by: Peter Jones <pjones@redhat.com>
Add 2 conditions to boot-success timer and service:
Don't run it for system users
Resolves: rhbz#1592201
Don't run it when pkexec isn't available
Resolves: rhbz#1619445
Use -Wsign-compare -Wconversion -Wextra in the build.
Related: rhbz#1624532
Related: rhbz#1626844
Signed-off-by: Peter Jones <pjones@redhat.com>
- Limit grub_malloc() on x86_64 to < 31bit addresses, as some devices seem to
have a colossally broken storage controller (or UEFI driver) that can't do
DMA to higher memory addresses, but fails silently.
Resolves: rhbz#1626844 (possibly really resolving it this time.)
- Also integrate Hans's attempt to fix the related error from -54, but do it
the other way around: try the low addresses first and *then* the high one if
the allocation fails. This way we'll get low regions by default, and if
kernel/initramfs don't fit anywhere, it'll try the higher addresses.
Related: rhbz#1624532
- Coalesce all the intermediate debugging junk from -54/-55/-56.
Signed-off-by: Peter Jones <pjones@redhat.com>
Don't mangle fw_path even harder.
Resolves: rhbz#1626844
Fix reboot being missing on some platforms, and make it alias to
"reset" as well.
More dprintf().
Signed-off-by: Peter Jones <pjones@redhat.com>
Fix UEFI memory problem in a different way.
Related: rhbz#1624532
Don't mangle fw_path with a / unless we're on http
Resolves: rhbz#1626844
Signed-off-by: Peter Jones <pjones@redhat.com>
Fix AArch64 machines with no RAM latched lower than 1GB
Resolves: rhbz#1615969
Set http_path and http_url when HTTP booting
Hopefully slightly better error reporting in some cases
Better allocation of kernel+initramfs on x86_64 and aarch64
Resolves: rhbz#1572126
Signed-off-by: Peter Jones <pjones@redhat.com>
We need to move these to /boot/efi/EFI/BOOT/ and change the perms at the same
time, but that means changing this, comps, and lorax (at least) at the same
time. Right this minute isn't a good time to do that.
Signed-off-by: Peter Jones <pjones@redhat.com>
autogen.sh was running autoreconf, which *ran* configure but didn't actually
re-make it if it was there. This means we effectively can't change our
configure invocation (for newer configure options), so that's bad.
Signed-off-by: Peter Jones <pjones@redhat.com>
Apparently working on two identical trees at once is not good for doing things
right.
Resolves: rhbz#1601578
Signed-off-by: Peter Jones <pjones@redhat.com>
Add support for making the user session automatically set the boot_success
flag and make offline-updates increment the boot_indeterminate grubenv var.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Fixups to work with gcc 8
Experimental https boot support on UEFI
XFS fixes for sparse inode support
Resolves: rhbz#1575797
Signed-off-by: Peter Jones <pjones@redhat.com>
- Use version field to sort BLS entries if id field isn't defined
- Add version field to BLS fragments generated by 20-grub.install
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
If MAKEDEBUG=yes in /etc/sysconfig/kernel, then a debug menu entry should
be created. So for BLS, a debug configuration file has to be created that
contains debug kernel command line parameters.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Install a 20-grubby.install and 90-loaderentry.install kernel-install
scripts in /etc/kernel/install.d so these have higher precedence than
the ones installed in /usr/lib/kernel/install.d by the systemd pkg.
If GRUB 2 pkg isn't installed, then the systemd scripts are executed
on kernel installation and removal.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
- Try to fix things for new compiler madness.
I really don't know why gcc decided __attribute__((packed)) on a "typedef
struct" should imply __attribute__((align (1))) and that it should have a
warning that it does so. The obvious behavior would be to keep the alignment
of the first element unless it's used in another object or type that /also/
hask the packed attribute. Why should it change the default alignment at
all?
- Merge in the BLS patches Javier and I wrote.
- Attempt to fix pmtimer initialization failures to not be super duper slow.
Signed-off-by: Peter Jones <pjones@redhat.com>
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Fix a merge error from 2.02-21 that affected kernel loading on Aarch64.
Related: rhbz#1519311
Related: rhbz#1506704
Related: rhbz#1502312
Signed-off-by: Peter Jones <pjones@redhat.com>
- Only nerf annobin, not -fstack-crash-protection.
- Fix a conflict on /boot/efi directory permissions between -cdboot and the
normal bootloader.
Signed-off-by: Peter Jones <pjones@redhat.com>
For now, completely nerf annobin and -fstack-clash-protection; at least
one of those things makes grubx64.efi crash on start.
Signed-off-by: Peter Jones <pjones@redhat.com>
You'll still need to actually install grub2-${efiarch}-modules and then
use grub2-install to install the xen modules in /boot/grub2/,
but this should handle actually loading them from the grub config file.
Resolves: rhbz#1486002
Signed-off-by: Peter Jones <pjones@redhat.com>
I'm not sure this is 100% the right place to do this - maybe it should
go in anaconda - but it seems most expedient :/
Resolves: rhbz#1491045
Signed-off-by: Peter Jones <pjones@redhat.com>