Accepting request 160165 from home:michael-chang:test-upgrade1

Please review this v2. version. Thanks.

v2. Renaming of grub2-efi unconditionally.
  
- remove all compatible links in grub2-efi as now all concerned 
  utilities are fixed
- superseding grub2-efi by grub2-x86_64-efi and grub2-i386-efi on
  x86_64 and ix86 respectively
- make grub2-x86_64-efi and grub2-i386-efi providing grub2-efi
  capability to not break package dependency
- handle upgrade from 12.2 by preseving grubenv and custom.cfg to
  new directory /boot/grub2, rename /boot/grub2-efi to
  /boot/grub2-efi.rpmsave to avoid confusion.

OBS-URL: https://build.opensuse.org/request/show/160165
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=28
This commit is contained in:
Andrei Borzenkov 2013-03-20 16:58:19 +00:00 committed by Git OBS Bridge
parent 5932ec5ef7
commit 04d8f6bbb5
2 changed files with 28 additions and 105 deletions

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Mar 13 11:30:52 UTC 2013 - mchang@suse.com
- remove all compatible links in grub2-efi as now all concerned
utilities are fixed
- superseding grub2-efi by grub2-x86_64-efi and grub2-i386-efi on
x86_64 and ix86 respectively
- make grub2-x86_64-efi and grub2-i386-efi providing grub2-efi
capability to not break package dependency
- handle upgrade from 12.2 by preseving grubenv and custom.cfg to
new directory /boot/grub2, rename /boot/grub2-efi to
/boot/grub2-efi.rpmsave to avoid confusion.
-------------------------------------------------------------------
Mon Mar 11 16:02:26 UTC 2013 - arvidjaar@gmail.com

View File

@ -187,32 +187,6 @@ file systems, computer architectures and hardware devices. This subpackage
provides support for %{platform} systems.
%ifarch %{efi}
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
%package efi
Summary: Bootloader with support for Linux, Multiboot and more
Group: System/Boot
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
highly configurable and customizable bootloader with modular
architecture. It support rich scale of kernel formats, file systems,
computer architectures and hardware devices.
Authors:
--------
Gordon Matzigkeit
Yoshinori K. Okuji
Colin Watson
Colin D. Bennett
Vesa Jääskeläinen
Robert Millan
Carles Pina
%endif
%package %{grubefiarch}
@ -227,6 +201,8 @@ Requires: %{name} = %{version}-%{release}
Requires(post): %{name} = %{version}-%{release}
Requires: perl-Bootloader >= 0.706
Requires(post): perl-Bootloader >= 0.706
Provides: %{name}-efi = %{version}-%{release}
Obsoletes: %{name}-efi < %{version}-%{release}
%description %{grubefiarch}
The GRand Unified Bootloader (GRUB) is a highly configurable and customizable
@ -413,17 +389,6 @@ rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*/*.h
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.h
%endif
%ifarch %{efi}
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
# grub2-efi compatibility links until other packages are fixed
ln -sf %{name}-editenv $RPM_BUILD_ROOT%{_bindir}/%{name}-efi-editenv
ln -sf %{name}-set-default $RPM_BUILD_ROOT%{_sbindir}/%{name}-efi-set-default
ln -sf %{name}-mkconfig $RPM_BUILD_ROOT%{_sbindir}/%{name}-efi-mkconfig
ln -sf %{name}-install $RPM_BUILD_ROOT%{_sbindir}/%{name}-efi-install
ln -sf %{name} $RPM_BUILD_ROOT/boot/%{name}-efi
%endif
%endif
# Defaults
install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
install -m 755 -D %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/grub2-once
@ -477,63 +442,6 @@ fi
%endif
%ifarch %{efi}
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
%triggerpostun -- %{name}-efi
# It is needed on update only
if [ $2 -gt 0 ]; then
# Workaround for lost /boot/grub2/grub.cfg and possibly /boot/grub2-efi
# after old grub2-efi deinstallation
if [ -f /boot/%{name}/grub.cfg.migrated ]; then
mv /boot/%{name}/grub.cfg.migrated /boot/%{name}/grub.cfg
fi
[ -h /boot/%{name}-efi ] || ln -sf %{name} /boot/%{name}-efi
fi
exit 0
%post efi
if [ $1 -eq 1 ]; then
# If this is new install, just create compatibility link
ln -sf grub2 /boot/grub2-efi
else
# Always create compatibility link even if current loader is not grub2-efi
if [ -h /boot/%{name}-efi ]; then
migrate_grub2_efi=
else
migrate_grub2_efi=yes
fi
# To check by current loader settings
if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then
. %{_sysconfdir}/sysconfig/bootloader
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
mv /boot/%{name}-efi /boot/%{name}-efi.rpmsave
ln -sf %{name} /boot/%{name}-efi
fi
fi
exit 0
%endif
%post %{grubefiarch}
@ -543,10 +451,23 @@ if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then
fi
if [ "x${LOADER_TYPE}" = "xgrub2-efi" ]; then
if [ -d /boot/%{name}-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
fi
# It's enough to call update-bootloader --refesh to install grub2 and update it's config
/sbin/update-bootloader --refresh || true
fi
if [ -d /boot/%{name}-efi ]; then
mv /boot/%{name}-efi /boot/%{name}-efi.rpmsave
fi
exit 0
%endif
@ -658,17 +579,6 @@ fi
%ifarch %{efi}
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
%files efi
%defattr(-,root,root,-)
%doc README
%ghost /boot/grub2-efi
%{_sbindir}/grub2-efi-install
%{_sbindir}/grub2-efi-mkconfig
%{_sbindir}/grub2-efi-set-default
%{_bindir}/grub2-efi-editenv
%endif
%files %{grubefiarch}
%defattr(-,root,root,-)
%dir %{_libdir}/%{name}/%{grubefiarch}