diff --git a/grub2.changes b/grub2.changes index 371b91a..3aa2911 100644 --- a/grub2.changes +++ b/grub2.changes @@ -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 diff --git a/grub2.spec b/grub2.spec index fa9a7df..6def954 100644 --- a/grub2.spec +++ b/grub2.spec @@ -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