SHA256
1
0
forked from pool/grub2

Accepting request 51521 from devel:openSUSE:Factory

Accepted submit request 51521 from user a_jaeger

OBS-URL: https://build.opensuse.org/request/show/51521
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=10
This commit is contained in:
Ruediger Oertel 2010-10-28 13:16:28 +00:00 committed by Git OBS Bridge
parent 46d9358b61
commit 75fb9f3760
2 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 27 16:57:13 CEST 2010 - jslaby@suse.de
- fix vanishing of /boot/grub2/* if /boot/grub/device.map
doesn't exist
-------------------------------------------------------------------
Mon Oct 25 12:39:11 UTC 2010 - jslaby@suse.de

View File

@ -111,20 +111,23 @@ install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
%find_lang grub
%post
exec >/dev/null 2>&1
mkdir -p /boot/%{name}/ 2>/dev/null || true
# Create device.map or reuse one from GRUB Legacy
if [ -e /boot/grub/device.map ] ; then
if [ ! -e /boot/%{name}/device.map ] ; then
cp -u /boot/grub/device.map /boot/%{name}/device.map 2>/dev/null ||
%{name}-mkdevicemap
fi
if [ -e /boot/%{name}/device.map ]; then
# Determine the partition with /boot
BOOT_PARTITION=$(df -h /boot |(read; awk '{print $1; exit}'))
# Generate core.img, but don't let it be installed in boot sector
%{name}-install --grub-setup=/bin/true $BOOT_PARTITION
%{name}-install --grub-setup=/bin/true $BOOT_PARTITION || true
exec >/dev/null 2>&1
# Remove stale menu.lst entries
/sbin/update-bootloader --remove --image /boot/%{name}/core.img --name="GNU GRUB 2"
/sbin/update-bootloader --remove --image /boot/%{name}/core.img --name="GNU GRUB 2" || true
# Add core.img as multiboot kernel to GRUB Legacy menu
/sbin/update-bootloader --add --image /boot/%{name}/core.img --name="GNU GRUB 2"
/sbin/update-bootloader --refresh
/sbin/update-bootloader --add --image /boot/%{name}/core.img --name="GNU GRUB 2" || true
/sbin/update-bootloader --refresh || true
fi
%preun