diff --git a/grub2.changes b/grub2.changes index b390973..7d2a3f9 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Mon Mar 11 16:02:26 UTC 2013 - arvidjaar@gmail.com + +- move post scripts into corresponding subpackages to ensure they are + run after updated binaries are installed. Currently it may happen + that update-bootlader picks up old binaries. +- move requires for perl-Bootloader to target subpackages. Make sure + efi requires minimal version that supports /boot/grub2. +- add requires(post) to force order of installation: grub2 => grub2-arch + => grub2-efi +- split efi post in two parts. One that updates configuration and is part + of grub2-efiarch and second that migrates settings and is part of + grub2-efi. Only custom.cfg and grubenv may need migration. device.map + is not relevant for EFI and new grub.cfg had been created at this point. + ------------------------------------------------------------------- Mon Mar 11 06:52:58 UTC 2013 - mchang@suse.com diff --git a/grub2.spec b/grub2.spec index 1c64493..1e365c6 100644 --- a/grub2.spec +++ b/grub2.spec @@ -135,7 +135,6 @@ Patch30: grub2-cdpath.patch Patch31: efidisk-ahci-workaround Patch32: grub2-grub-mount-return-failure-if-FUSE-failed.patch Patch33: grub2-fix-tftp-endianness.patch -PreReq: perl-Bootloader Requires: gettext-runtime %if 0%{?suse_version} >= 1140 Requires: os-prober @@ -176,6 +175,10 @@ Authors: Summary: Bootloader with support for Linux, Multiboot and more Group: System/Boot +Requires: %{name} = %{version}-%{release} +Requires(post): %{name} = %{version}-%{release} +Requires: perl-Bootloader +Requires(post): perl-Bootloader %description %{grubarch} The GRand Unified Bootloader (GRUB) is a highly configurable and customizable @@ -189,8 +192,8 @@ provides support for %{platform} systems. Summary: Bootloader with support for Linux, Multiboot and more Group: System/Boot -PreReq: %{name} = %{version}-%{release} -PreReq: %{name}-%{grubefiarch} = %{version}-%{release} +Requires: %{name}-%{grubefiarch} = %{version}-%{release} +Requires(pre): %{name}-%{grubefiarch} = %{version}-%{release} %description efi This is the second version of the GRUB (Grand Unified Bootloader), a @@ -218,7 +221,12 @@ Group: System/Boot %ifarch ia64 x86_64 #Package is available on ia64 and x86_64 only and not necessarily needed Requires: efibootmgr +Requires(post): efibootmgr %endif +Requires: %{name} = %{version}-%{release} +Requires(post): %{name} = %{version}-%{release} +Requires: perl-Bootloader >= 0.706 +Requires(post): perl-Bootloader >= 0.706 %description %{grubefiarch} The GRand Unified Bootloader (GRUB) is a highly configurable and customizable @@ -427,6 +435,8 @@ install -m 755 -D %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/grub2-once /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || : %if ! 0%{?only_efi:1} + +%post %{grubarch} # To check by current loader settings if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then . %{_sysconfdir}/sysconfig/bootloader @@ -505,14 +515,15 @@ else . %{_sysconfdir}/sysconfig/bootloader fi - if [ "x${LOADER_TYPE}" = "xgrub2-efi" ]; then - - if [ "$migrate_grub2_efi" ]; then - # Migrate settings to standard prefix /boot/grub2 - for i in custom.cfg device.map grub.cfg grubenv; do - [ -f /boot/%{name}-efi/$i ] && cp -a /boot/%{name}-efi/$i /boot/%{name} || : - done - fi + if [ "x${LOADER_TYPE}" = "xgrub2-efi" ] && [ "$migrate_grub2_efi" ]; then + # Migrate settings to standard prefix /boot/grub2 + for i in custom.cfg grubenv; do + [ -f /boot/%{name}-efi/$i ] && cp -a /boot/%{name}-efi/$i /boot/%{name} || : + done + # Uninstallation of previous grub2-efi versions will remove + # /boot/grub2-efi/grub.cfg and possibly /boot/grub2-efi itself. + # Preserve grub2.cfg and use it as migration flag in postun trigger + mv /boot/%{name}/grub.cfg /boot/%{name}/grub.cfg.migrated fi if [ "$migrate_grub2_efi" ]; then @@ -520,19 +531,23 @@ else ln -sf %{name} /boot/%{name}-efi fi - if [ "x${LOADER_TYPE}" = "xgrub2-efi" ]; then - # It's enough to call update-bootloader --refesh to install grub2 and update it's config - /sbin/update-bootloader --refresh || true - - # Uninstallation of previous grub2-efi versions will remove - # /boot/grub2-efi/grub.cfg and possibly /boot/grub2-efi itself. - # Preserve grub2.cfg and use it as migration flag in postun trigger - [ "$migrate_grub2_efi" ] && mv /boot/%{name}/grub.cfg /boot/%{name}/grub.cfg.migrated - fi - fi exit 0 %endif + +%post %{grubefiarch} + +# To check by current loader settings +if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then + . %{_sysconfdir}/sysconfig/bootloader +fi + +if [ "x${LOADER_TYPE}" = "xgrub2-efi" ]; then + # It's enough to call update-bootloader --refesh to install grub2 and update it's config + /sbin/update-bootloader --refresh || true +fi + +exit 0 %endif %preun