diff --git a/README.Fedora b/README.Fedora index ccfe58e..3313a5a 100644 --- a/README.Fedora +++ b/README.Fedora @@ -1,44 +1,63 @@ Using GNU GRUB 2 in Fedora ========================== -Though GRUB 2 provides various feature enhancements over previous GRUB -version (referred to as "GRUB", or "GRUB Legacy"), it did not reach its -stability and feature completness yet, and thus is not ready to replace -it for the whole user base. This package is primarily intended to -encourage testing and accelerate distribution integration. - -It is generally safe to install the package. It is able to co-exist with -existing GRUB installation and adds itself to the GRUB menu upon -installation, so you'll able to select GRUB 2 from GRUB menu during -the boot. +GRUB 2 provides various feature enhancements over the previous GRUB version +(referred to as "GRUB", or "GRUB Legacy") which has been unmaintained upstream +for years. GRUB has thus been deprecated in Fedora and replaced by GRUB 2 for +BIOS systems. (EFI systems still uses GRUB Legacy from the new grub-efi package.) Utilities --------- -The GRUB 2 utilities are prefixed (or postfixed) with 'grub2': +The GRUB 2 utilities are prefixed with 'grub2': +grub2-bin2h grub2-editenv -grub2-mkimage -grub2-mkelfimage -grub2-mkrescue -grub2-emu +grub2-fstest grub2-install +grub2-kbdcomp +grub2-menulst2cfg +grub2-mkconfig grub2-mkdevicemap +grub2-mkfont +grub2-mkimage +grub2-mklayout +grub2-mknetdir +grub2-mkpasswd-pbkdf2 +grub2-mkrelpath +grub2-mkrescue grub2-probe +grub2-reboot +grub2-script-check +grub2-set-default grub2-setup -update-grub2 -Documentation -------------- +The default location for boot loader installation is /boot/grub2/ . -The GRUB 2 lacks documentation. While you are encouraged to contribute -the documentation, you can use the GRUB 2 Wiki [1] as primary source of -information pertaining to this development snapshot. +GRUB 2 in Fedora +---------------- -[1] http://grub.enbug.org/ +The Fedora installer (anaconda) will make sure grub2 is installed for new and +updated systems. It will write /etc/default/grub and run grub2-mkconfig to +create /boot/grub2/grub.cfg, and it will run grub2-install to install the boot +loader in the MBR and in /boot/grub2/ . + +grubby will patch grub.cfg (through /etc/grub2.cfg) when new kernels are +installed. The GRUB 2 configuration system in /etc/default/grub and /etc/grub.d/ +is thus only used initially by anaconda, but it is possible to generate a new +grub.cfg with: + + grub2-mkconfig -o /boot/grub2/grub.cfg + +The active boot loader will not be changed when the GRUB 2 package is updated. +A new boot loader can be installed with something like: + + grub2-install /dev/sda + +Documentation +------------- -If you intend to install grub2 as your primary boot loader refer to -the GRUB 2 Wiki for information on how to set it up. +The GRUB 2 manual can be found on http://www.gnu.org/software/grub/manual/ . Support channels ---------------- diff --git a/grub-1.99-fix_grub-probe_call.patch b/grub-1.99-fix_grub-probe_call.patch new file mode 100644 index 0000000..0adf117 --- /dev/null +++ b/grub-1.99-fix_grub-probe_call.patch @@ -0,0 +1,16 @@ +From: Adam Williamson +Subject: call ${grub_probe} instead of grub-probe in OSXUUID line of 30_os-prober.in +Date: 2011-12-08 17:55:47 +0000 + +=== modified file 'util/grub.d/30_os-prober.in' +--- a/util/grub.d/30_os-prober.in 2011-12-08 09:39:52.311466000 -0800 ++++ b/util/grub.d/30_os-prober.in 2011-12-08 09:41:22.984908889 -0800 +@@ -168,7 +168,7 @@ + done + ;; + macosx) +- OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`" ++ OSXUUID="`${grub_probe} --target=fs_uuid --device ${DEVICE} 2> /dev/null`" + osx_entry xnu_kernel 32 + osx_entry xnu_kernel64 64 + ;; diff --git a/grub.default b/grub.default index 08f5349..9ce1bb0 100644 --- a/grub.default +++ b/grub.default @@ -1 +1,8 @@ +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_SAVEDEFAULT=true +# GRUB_TERMINAL="serial console" +# GRUB_SERIAL_COMMAND="serial --unit=0 --speed=9600" GRUB_CMDLINE_LINUX="quiet rhgb" +GRUB_DISABLE_RECOVERY="true" diff --git a/grub2-gfxpayload-efi.patch b/grub2-gfxpayload-efi.patch new file mode 100644 index 0000000..742417a --- /dev/null +++ b/grub2-gfxpayload-efi.patch @@ -0,0 +1,63 @@ +From: Vladimir 'phcoder' Serbinenko +Subject: Don't accept text modes on EFI when booting Linux. +Date: 2011-08-16 16:11:10 +0200 + +------------------------------------------------------------ +revno: 3402 +committer: Vladimir 'phcoder' Serbinenko +branch nick: grub +timestamp: Tue 2011-08-16 16:11:10 +0200 +message: + Don't accept text modes on EFI when booting Linux. + + * grub-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define. + (grub_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes. +diff: + +=== modified file 'grub-core/loader/i386/linux.c' +--- a/grub-core/loader/i386/linux.c 2011-05-18 07:56:33 +0000 ++++ b/grub-core/loader/i386/linux.c 2011-08-16 14:11:10 +0000 +@@ -45,15 +45,18 @@ + #include + #define HAS_VGA_TEXT 0 + #define DEFAULT_VIDEO_MODE "auto" ++#define ACCEPTS_PURE_TEXT 0 + #elif defined (GRUB_MACHINE_IEEE1275) + #include + #define HAS_VGA_TEXT 0 + #define DEFAULT_VIDEO_MODE "text" ++#define ACCEPTS_PURE_TEXT 1 + #else + #include + #include + #define HAS_VGA_TEXT 1 + #define DEFAULT_VIDEO_MODE "text" ++#define ACCEPTS_PURE_TEXT 1 + #endif + + #define GRUB_LINUX_CL_OFFSET 0x1000 +@@ -483,12 +486,22 @@ + tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); + if (! tmp) + return grub_errno; ++#if ACCEPTS_PURE_TEXT + err = grub_video_set_mode (tmp, 0, 0); ++#else ++ err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); ++#endif + grub_free (tmp); + } + else +- err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); +- ++ { ++#if ACCEPTS_PURE_TEXT ++ err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); ++#else ++ err = grub_video_set_mode (DEFAULT_VIDEO_MODE, ++ GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); ++#endif ++ } + if (err) + { + grub_print_error (); diff --git a/grub2.spec b/grub2.spec index d08c2e3..643fa43 100644 --- a/grub2.spec +++ b/grub2.spec @@ -18,7 +18,7 @@ Name: grub2 Epoch: 1 Version: 1.99 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -35,6 +35,9 @@ Patch2: grub-1.99-just-say-linux.patch Patch3: grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch Patch4: grub2-handle-initramfs-on-xen.patch Patch5: grub2-1.99-handle-more-dmraid.patch +Patch6: grub2-gfxpayload-efi.patch +# https://savannah.gnu.org/bugs/index.php?35018 +Patch7: grub-1.99-fix_grub-probe_call.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -108,7 +111,7 @@ cd grub-efi-%{version} CFLAGS="$(echo $RPM_OPT_FLAGS | sed \ -e 's/-fstack-protector//g' \ -e 's/--param=ssp-buffer-size=4//g' \ - -e 's/-mregparm=3/-mregparm=4//g' \ + -e 's/-mregparm=3/-mregparm=4/g' \ -e 's/-fexceptions//g' \ -e 's/-fasynchronous-unwind-tables//g' )" \ TARGET_LDFLAGS=-static \ @@ -140,7 +143,7 @@ PLATFORM=pc CFLAGS="$(echo $RPM_OPT_FLAGS | sed \ -e 's/-fstack-protector//g' \ -e 's/--param=ssp-buffer-size=4//g' \ - -e 's/-mregparm=3/-mregparm=4//g' \ + -e 's/-mregparm=3/-mregparm=4/g' \ -e 's/-fexceptions//g' \ -e 's/-m64//g' \ -e 's/-fasynchronous-unwind-tables//g' )" \ @@ -151,6 +154,14 @@ PLATFORM=pc make %{?_smp_mflags} +sed -i -e 's,(grub),(%{name}),g' \ + -e 's,grub.info,%{name}.info,g' \ + -e 's,\* GRUB:,* GRUB2:,g' \ + -e 's,/boot/grub/,/boot/%{name}/,g' \ + -e 's,grub-,%{name}-,g' \ + docs/grub.info +sed -i -e 's,grub-dev,%{name}-dev,g' docs/grub-dev.info + %install set -e rm -fr $RPM_BUILD_ROOT @@ -158,6 +169,7 @@ rm -fr $RPM_BUILD_ROOT %ifarch %{efi} cd grub-efi-%{version} make DESTDIR=$RPM_BUILD_ROOT install +mv $RPM_BUILD_ROOT/etc/bash_completion.d/grub $RPM_BUILD_ROOT/etc/bash_completion.d/grub-efi # Ghost config file install -d $RPM_BUILD_ROOT/boot/%{name}-efi @@ -225,11 +237,12 @@ if [ "$1" = 1 ]; then /sbin/install-info --info-dir=%{_infodir} %{_infodir}/grub2-dev.info.gz || : fi +%triggerun -- grub2 < 1:1.99-4 # grub2 < 1.99-4 removed a number of essential files in postun. To fix upgrades # from the affected grub2 packages, we first back up the files in triggerun and # later restore them in triggerpostun. # https://bugzilla.redhat.com/show_bug.cgi?id=735259 -%triggerun -- grub2 < 1:1.99-4 + # Back up the files before uninstalling old grub2 mkdir -p /boot/grub2.tmp && mv -f /boot/grub2/*.mod \ @@ -292,12 +305,10 @@ fi %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README -%{_sysconfdir}/%{name}.cfg +%config(noreplace) %{_sysconfdir}/%{name}.cfg %config(noreplace) %{_sysconfdir}/default/grub %dir /boot/%{name} -# Actually, this is replaced by update-grub from scriptlets, -# but it takes care of modified persistent part -%config(noreplace) /boot/%{name}/grub.cfg +%ghost %config(noreplace) /boot/%{name}/grub.cfg %doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS %doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO %doc grub-%{version}/ChangeLog grub-%{version}/README.Fedora @@ -308,7 +319,7 @@ fi %files efi %defattr(-,root,root,-) %attr(0755,root,root)/boot/efi/EFI/redhat -/etc/bash_completion.d/grub +/etc/bash_completion.d/grub-efi %{_libdir}/grub2-efi %{_libdir}/grub/ /sbin/grub2-efi-mkconfig @@ -341,12 +352,10 @@ fi %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README -%{_sysconfdir}/grub2-efi.cfg +%config(noreplace) %{_sysconfdir}/grub2-efi.cfg %config(noreplace) %{_sysconfdir}/default/grub %dir /boot/grub2-efi -# Actually, this is replaced by update-grub from scriptlets, -# but it takes care of modified persistent part -%config(noreplace) /boot/grub2-efi/grub.cfg +%ghost %config(noreplace) /boot/grub2-efi/grub.cfg %doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS %doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO %doc grub-%{version}/ChangeLog grub-%{version}/README.Fedora @@ -355,13 +364,29 @@ fi %endif %changelog -* Wed Oct 26 2011 Fedora Release Engineering - 1:1.99-12 +* Thu Dec 08 2011 Adam Williamson - 1.99-13 +- fix hardwired call to grub-probe in 30_os-prober (rhbz#737203) + +* Mon Nov 07 2011 Peter Jones - 1.99-12 +- Lots of .spec fixes from Mads Kiilerich: + Remove comment about update-grub - it isn't run in any scriptlets + patch info pages so they can be installed and removed correctly when renamed + fix references to grub/grub2 renames in info pages (#743964) + update README.Fedora (#734090) + fix comments for the hack for upgrading from grub2 < 1.99-4 + fix sed syntax error preventing use of $RPM_OPT_FLAGS (#704820) + make /etc/grub2*.cfg %config(noreplace) + make grub.cfg %ghost - an empty file is of no use anyway + create /etc/default/grub more like anaconda would create it (#678453) + don't create rescue entries by default - grubby will not maintain them anyway + set GRUB_SAVEDEFAULT=true so saved defaults works (rbhz#732058) + grub2-efi should have its own bash completion + don't set gfxpayload in efi mode - backport upstream r3402 +- Handle dmraid better. Resolves: rhbz#742226 + +* Wed Oct 26 2011 Fedora Release Engineering - 1:1.99-11 - Rebuilt for glibc bug#747377 -* Mon Oct 24 2011 Peter Jones - 1.99-11 -- Handle dmraid better. - Resolves: rhbz#742226 - * Wed Oct 19 2011 Adam Williamson - 1.99-10 - /etc/default/grub is explicitly intended for user customization, so mark it as config(noreplace)