Debrand for AlmaLinux

Build btrfs module

Drop backtrace module from riscv64-efi CC image
This commit is contained in:
Eduard Abdullin 2026-07-29 01:47:52 +00:00 committed by root
commit 9e095b92a3

View File

@ -17,7 +17,7 @@
Name: grub2
Epoch: 1
Version: 2.12
Release: 53%{?dist}.alma.1
Release: 54%{?dist}.alma.1
Summary: Bootloader with support for Linux, Multiboot and more
License: GPL-3.0-or-later
URL: http://www.gnu.org/software/grub/
@ -424,6 +424,75 @@ if test -f ${EFI_HOME}/grubenv; then
mv --force ${EFI_HOME}/grubenv ${GRUB_HOME}/grubenv
fi
%if "%{platform}" == "pc"
%posttrans pc
set -eu
set -o pipefail
SYS_FIRMWARE_EFI_DIR=/sys/firmware/efi
BOOT_DIR=/boot
find_grub_devices() {
local boot_device
local component_devs=()
local block_devs=()
# Exit if UEFI system running
if test -d $SYS_FIRMWARE_EFI_DIR ; then
exit 0
fi
# grub2-probe is required for device finding
if ! command -v grub2-probe &>/dev/null; then
exit 0;
fi
# Get block devices where GRUB is located. We assume GRUB is on the same device
# as /boot partition is. In case that device is an md (Multiple Device) device, all
# of the component devices of such a device are considered.
boot_device=$(grub2-probe --target=device $BOOT_DIR)
# Check if a given device is an md (Multiple Device) device
# It is expected that the "mdadm" command is available,
# if it's not it is assumed the device is not an md device.
if command -v mdadm &>/dev/null && \
mdadm --detail --verbose --brief "$boot_device" &> /dev/null; then
out=$(mdadm --detail --verbose --brief "$boot_device")
# output would look like:
# ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=localhost.localdomain:0 UUID=c4acea6e:d56e1598:91822e3f:fb26832c disable=line-too-long devices=/dev/vda1,/dev/vdb1
for d in $(echo "$out" | sed -n -e 's/.* devices=\([^ ]*\).*/\1/p' | sed 's/,/ /g'); do
component_devs+=("$d")
done
else
component_devs+=("$boot_device")
fi
# Get blocks from partitions
for d in "${component_devs[@]}"; do
block_devs+=("$(lsblk -spnlo name "$d" | tail -1)")
done
# Filter those GRUB blocks
for d in "${block_devs[@]}"; do
if dd if="$d" bs=446 count=1 status=none | grep -aq "GRUB"; then
echo "$d"
fi
done
}
grub_install () {
if ! command -v grub2-install &>/dev/null; then
exit 0
fi
for d in $(find_grub_devices); do
echo "Installing on $d" >&2
grub2-install "$d"
done
}
grub_install || :
%endif
%files common -f grub.lang
%dir %{_libdir}/grub/
%dir %{_datarootdir}/grub/
@ -597,11 +666,15 @@ fi
%endif
%changelog
* Thu Jul 23 2026 Eduard Abdullin <eabdullin@almalinux.org> - 1:2.12-53.alma.1
* Wed Jul 29 2026 Eduard Abdullin <eabdullin@almalinux.org> - 1:2.12-54.alma.1
- Debrand for AlmaLinux
- Build btrfs module
- Drop backtrace module from riscv64-efi CC image
* Mon Jul 20 2026 Leo Sandoval <lsandova@redhat.com> - 2.12-54
- Run grub2-install automatically on grub2-pc posttrans
- Resolves: #RHEL-188047
* Mon Jul 20 2026 Josue Hernandez <josherna@redhat.com> - 2.12-53
- Remove creation of /boot/loader/entries
- Resolves: #RHEL-78104