Bug 416 - [Tracker] Integration of grub2
: [Tracker] Integration of grub2
Status: REOPENED
Product: Mageia
Classification: Unclassified
Component: RPM Packages
: Cauldron
: All Linux
: Normal Severity: normal
: Mageia 5
Assigned To: Mageia Bug Squad
:
:
:
: TRACKER
: 16010 16268 18461 18538 18761 18780 8366 8390 8408 8462 8463 8481 8540 8553 8742 8781 8785 8850 8886 8959 9126 9148 9177 9334 9426 9431 9560 9563 9608 9627 9826 9832 9991 10024 12419 13772 13901 15291 15514 15532 15583 15675 15695 15846 15913 15914 15930 16030 16059 17455 18552 18560 18646 18656 18739 18770 18781 18783 18952
: 5140
  Show dependency treegraph
 
Reported: 2011-03-17 13:09 CET by Y.LE_NY
Modified: 2016-07-25 14:34 CEST (History)
14 users (show)

See Also:
Source RPM: grub2
CVE:
Status comment:


Attachments

Description Y.LE_NY 2011-03-17 13:09:56 CET
Description of problem:

Mageia 1 Alpha2 use grub 0.97 release 
but the latest stable version is 1.98.
Please upgrade it from 0.97 (2005-05-08) to 1.98 (2010-03-06) to fix bugs
and because and GRUB 0.9x (Legacy) is no longer being developed.

GRUB 0.97 (Legacy) has the following features:
http://www.gnu.org/software/grub/grub-legacy.en.html

GRUB 1.98 has the following features:
http://grub.enbug.org/CurrentStatus

GRUB 2 is the next generation of GNU GRUB, using version numbers 1.90 and above. GRUB 2 is a complete rewrite and is at a developmental phase. The most important goal is to make GNU GRUB cleaner, safer, more robust, more portable and more powerful.

CommandList: Comparison of commands between GRUB Legacy and GRUB 2 
http://grub.enbug.org/CommandList
Most of the work to adapt ???

Grub 1.98 sources :
ftp://alpha.gnu.org/gnu/grub/grub-1.98.tar.gz 

Version-Release number of selected component (if applicable):
Feb 11 2011 21:45       190286 grub-0.97-32.mga1.i586.rpm
Feb 11 2011 21:45       376677 grub-doc-0.97-32.mga1.i586.rpm

For better information, latest grub in several Linux
Distribution :
Fedora 15 rawhide use 0.97
OpenSuse 11.4 and factory use 0.97
Debian 6.0 squeeze and testing wheezy use 1.98
Ubuntu snapshot natty use 1.99 and 
Ubuntu 10.10 maverick use 1.98



Grub 0.97 to 1.98 Changelog :

New in 1.98 - 2010-03-06:

* Multiboot on EFI support.

* Graphical menu support.

* MIPS support.

* Saved default menu entry support, with new utilities `grub-reboot' and
  `grub-set-default'.

* Unit testing framework.

* Support for multiple terminals.

* Encrypted password support, with a new utility `grub-mkpasswd-pbkdf2'.

* `grub-mkfloppy' removed; use `grub-mkrescue' to create floppy images.

* Add grub-probe support for GNU/Hurd.

* Add support for gettext.

New in 1.97:

* Add support for loading XNU (MacOS X kernel).

* ACPI override support.

* Integrated gptsync.

* Password protection support.

* Partition manipulation tool.

* Add `keystatus' command.

* Unicode fonts are now used by default.

* Add `hdparm' command.

* Add support for getting the current date and time from CMOS as variables.

* Add `drivemap' command.

* Add support for RAID levels 4,6 and 10.

* update-grub is replaced by grub-mkconfig.

* When booting from PXE, PXE can be used to load files.

* High resolution timer support.

* Image loaders now support IO buffering.

* Add `crc' command.

* Add Cygwin support.

* Add x86_64 EFI support.

* Use LZMA compression instead of LZO.

* Support for saving the environment from and loading the environment
  from a file.

* Allow the UUID to be used as device name.

* The `search' command can use UUIDs now.

* Add support for IEEE 1275 on i386.

* Create partmap.lst and use it to automatically load partition map
  modules.

* grub-mkconfig supports os-prober to add operating systems to the
  boot menu.

* The ATA driver supports devices bigger than 2 TiB.

* Add support for the UDF, AFS and EXT4 filesystems.

* The ISO9660 filesystem supports the Joliet extension

* Add support for loading kernels of FreeBSD, NetBSD and OpenBSD.

* Add new command `sleep'.

* Support for direct access to AT keyboards.

* New utility `grub-fstest'.

New in 1.96 - 2008-02-03:

* The license term is changed to GNU General Public License Version 3.

* grub-emu is made optional.  Now you have to use
  `--enable-grub-emu' to enable it.

* Add Multiboot2 support.

* grub-emu can access the host filesystem now.

* Add support for the NTFS, cpio/tar and Reiserfs filesystems.

* Add support for ATA/ATAPI.

* Add update-grub script to generate grub.cfg.

* Add grub-mkrescue script to generate floppy or ElTorito images
  (i386-pc only).

* Add support for background images in gfxterm (background_image command).

* Add support for detection of 64-bit support in CPU (cpuid command).

* GPT is now enabled in i386-pc target.

* Add grub-install for EFI.

* Ported to the following new platforms: Efika, coreboot (a.k.a. LinuxBIOS),
  OLPC XO.

* Add support for colored menu (menu_color_normal and menu_color_highlight
  variables).

* Fix support for loading Linux zImages (such as memtest86).

New in 1.95 - 2006-10-15:

* Number partitions from 1 instead of 0. For instance, the first
  partition of "hd0" is now "hd0,1" but not "hd0,0".

* grub-probefs is renamed to grub-probe, and supports printing a
  guessed OS device name and a GRUB drive name.

* RAID and LVM support is added.

* New command, echo.

* The disk API is changed to support 64-bit addressing.

* A TGA loader is added for the video API.

New in 1.94 - 2006-06-04:

* Fix several serious bugs in HFS+.

* Add experimental EFI support. Chainloading and Linux loading are
  supported at the moment.

* Add a new command "blocklist" to show a block list.

* Use --with-platform to specify a boot environment. For now, efi,
  ieee1275 and pc are supported.

* Use the filename "kernel.elf" instead of "grubof" on ieee1275.

* Install GRUB into pkglibdir instead of pkgdatadir.

* Support environmental variables. You can export variables by the
  command "export".

* Remove the commands "default" and "timeout". They are now variables.

* Add the commands "source" and "." to include a file.

* Implement experimental Video API and a new terminal "gfxterm" based
  on the Video API.


New in 1.93 - 2006-03-10:

* Add support for the HFS+ wrapper.

* Major improvements to scripting support.

* Menu entries are now scriptable.


New in 1.92 - 2005-12-25:

* Add support for GPT partition table format.

* Add a new command "play" to play an audio file on PC.

* Add support for Linux/ADFS partition table format.

* Add support for BASH-like scripting.

* Add support for Apple HFS+ filesystems.


New in 1.91 - 2005-10-15:

* Add support for LZO version 2.

* Support completion in the entry editor.

* Add VBE support.

* New commands, "search", "vbetest" and "vbeinfo".

* The option BOOT_IMAGE is passed to Linux.

* Add support for automatic decompression for gzip.

* Add support for terminfo and serial.

* Add support for x86_64.

* GRUB itself is a Multiboot-compliant kernel.

* Add new filesystems: XFS, SFS, and AFFS.


New in 1.90 - 2005-08-07:

* Rename the project name PUPA to GRUB. Now this version is the
  developmental version of GRUB officially.

* The GRUB emulator ``grub-emu'' is added.

* Add support for newworld Mac. This should work with other
  PowerPC-based machines as well, if they use IEEE 1275
  (Open Firmware).

* Too many changes to describe. Look at ChangeLog for more details.



Reproducible: 

Steps to Reproduce:
Comment 1 Michael Scherer 2011-03-17 13:46:26 CET
Please, next time, do not paste the whole changelog here.

And for mageia 1, the goal is to not have any intrusive and big changes. And a major migration to a new grub version is such a change, so this will not be done before June. Grub2 is a totally different beast that would requires change to drakx, to to various drakxtools, and changes to various packages ( like kernel , and install-kernel ).
Comment 2 Y.LE_NY 2011-03-17 17:13:54 CET
(In reply to comment #1)
> Please, next time, do not paste the whole changelog here.
Sorry, it is to help to identify if the upgrade is needed 
and with grub, I didn't find a url with the changelog. 
 
> And for mageia 1, the goal is to not have any intrusive and big changes. 
I know. This ticket is reminder for the next upgrade tasks for Mageia 2.
As the ticket for module-init-tools that I have opened.

> And a major migration to a new grub version is such a change, so this will not > be done before June. 
OK

>Grub2 is a totally different beast that would requires change
> to drakx, to to various drakxtools, and changes to various packages ( like
> kernel , and install-kernel ).
OK, can you add the tag Mageia2 for the field "Target Milestone:" in Mageia's bugzilla ?
Comment 3 Y.LE_NY 2011-03-20 16:51:17 CET
At http://blog.mageia.org/fr/2011/03/15/mageia-1-alpha-2-primavera-arrive/ , there is a use that said that he have problem when testing Mageia 1 alpha 2 in  Virtualbox because he uses Ubuntu. He said thar Ubuntu's startupmanager software that manage the boot for several operating system as MS Windows, other Linux distributions, recognize well Mageia, but that his system is blocked.
He think that it is because a problem with grub.

I think that when we can have Grub 1.9x with Mageia, it will be more easy for the users to switch from their previous Linux distribution to Mageia.
Comment 4 Barry Jackson 2011-03-21 22:22:34 CET
(In reply to comment #3)
I don't see the logic in your last comment.
Surely that would only apply to someone coming from Debian or Ubuntu.

Since grub legacy is still more common than grub2 then Mageia is better placed as it is.

There is nothing to stop anyone booting from one version into the other - it just needs some care and research.

I currently boot all my systems using grub2 including Mandriva. I do this purely to learn about grub2 which I have also patched to use only labels.

Despite this I would be the last person to recommend a sudden switch to grub2 for Mageia or Mandriva - it is a different animal.
Comment 5 Y.LE_NY 2011-04-09 19:53:28 CEST
grub is not upgraded from 0.97 to 1.98 in Mageia 1 Beta 1.
Then now, is it for Mageia 2 release ?
Comment 6 Ahmad Samir 2011-04-09 21:00:01 CEST
(In reply to comment #5)
> grub is not upgraded from 0.97 to 1.98 in Mageia 1 Beta 1.
> Then now, is it for Mageia 2 release ?

Definitely not for Mageia 1.

Maybe for Mageia 2.
Comment 7 Y.LE_NY 2011-04-09 21:11:08 CEST
(In reply to comment #6)
> (In reply to comment #5)
> > grub is not upgraded from 0.97 to 1.98 in Mageia 1 Beta 1.
> > Then now, is it for Mageia 2 release ?
> 
> Definitely not for Mageia 1.
> 
> Maybe for Mageia 2.

Ok, then change Field "Target Milestone" to Mageia 2 in this ticket.
Comment 8 Ahmad Samir 2011-04-09 21:50:55 CEST
Well, I said it's a maybe, unfortunately I don't know for sure when the switch will happen...
Comment 9 Michael Scherer 2011-04-14 16:51:19 CEST
And as i said, this would requires more work that just upgrading the rpm.
Comment 10 Barry Jackson 2011-04-15 14:48:41 CEST
I just built a package of grub2 1.99 (today's trunk) for x86_64 Mageia and it is installed and working.
http://forum.mandriva.com/en/viewtopic.php?f=17&t=134598&p=844642#p844642
However I am not an official packager and I don't have any upload rights, but if anyone wants to experiment with this I can upload it to a server and a private email will get you the URL. ;-)

There is one file needed for the graphical menu :-
/usr/share/grub/unicode.pf2
it was not available other than in Ubuntu, so I pinched it and built it into my package - I have no idea about the license issues involved with this. :-/
Comment 11 Michael Scherer 2011-04-16 09:36:49 CEST
Well, have you tested with raid, lvm, encrypted root, brtfs ?
Have you installed another kernel, was it took in account by itself ? 

Did you have to do anything besides installing the rpm ? ( ie, creating the grub image, hunt for the differents modules etc ).

If not, then this is work that need to be done before hoping to replace grub.
Comment 12 Barry Jackson 2011-04-16 11:16:10 CEST
> Well, have you tested with raid, lvm, encrypted root, brtfs ?
> Have you installed another kernel, was it took in account by itself ?
No, however kernel update should trigger a re-build of grub.cfg if the spec file is correct.

> Did you have to do anything besides installing the rpm ? ( ie, creating the
> grub image, hunt for the differents modules etc ).
grub2-install --grub-setup=/bin/true /dev/sdb5  (to / in my case)
grub2-mkconfig -o /boot/grub2/grub.cfg

> If not, then this is work that need to be done before hoping to replace grub.
I agree entirely and I do not advocate a change to grub2 unless it becomes absolutely essential.
I simply offered this to anyone (OP maybe?) who would like to experimant with the latest state of grub2.
It does (AFAICT reading #grub irc) have issues with brtfs, and documentation is improving, but still minimal.
If people experiment with grub2 now, then issues can be ironed out well before a possible change in the (hopefully quite distant) future. ;-)
Comment 13 Marja van Waes 2011-10-06 07:13:00 CEST
Still on grub 0.97 today, so this enhancement didn't silently happen
Comment 14 Marja van Waes 2011-11-07 19:31:02 CET
Copying Blocks field from duplicate bug report 2121, to be able to close that one
Comment 15 Marja van Waes 2011-11-07 19:31:28 CET
*** Bug 2121 has been marked as a duplicate of this bug. ***
Comment 16 Marja van Waes 2012-01-01 09:49:49 CET
(In reply to comment #12)

> It does (AFAICT reading #grub irc) have issues with brtfs, and documentation is
> improving, but still minimal.

More than 8 months later now. At first sight, documentation seems to be OK

http://www.gnu.org/software/grub/manual/html_node/index.html

And I don't see an open brtfs bug, so that issue got fixed.

But I suppose there are other serious issues left, version is 1.99 atm and not 2.x
Comment 17 Kristoffer Grundström 2012-01-17 03:14:40 CET
I second this idea as well.
Comment 18 Barry Jackson 2012-03-15 21:55:46 CET
I have packages of grub2-pc and grub2-efi almost ready.

It is my intention to import these into Cauldron after the launch of mga2 and the dust has settled, unless anyone has serious objections.

This will probably coincide with the next stable release of grub2 which coincidentally will be 2.00 (current is 1.99). (I am currently working with 2.00b2)

I have not tested with raid, lvm, etc., but no one person has all the hardware available to do this sort of testing - which is the whole point of making these packages available.

PC works fine for me and EFI is also working and tested in Mageia but not by me.

They will include basic instructions in README files to enable anyone interested to install and experiment with grub2 with minimal risk to their existing systems. 
These packages will co-exist alongside grub-legacy.

I think that the feedback we get from users will be a good basis for making decisions about any possible later integration of grub2 into maybe mga3 or 4.

Thoughts anyone?
Comment 19 dave stroud 2012-05-07 06:00:20 CEST
Most all new distro have moved to grub2. I use it to boot mageia2 from ubuntu grub. Its easier to use and update than legacy.I had to make a small change in mageia menu 1st.to make it boot.The two grubs handle the uuid differently.In the beginning it had a lot of problems But most have been worked out.I vote to move to it as soon as possible.  thanks
Comment 20 Marja van Waes 2012-05-26 13:07:24 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja
Comment 21 Jérôme Hénin 2012-06-26 11:07:41 CEST
This is definitely still valid for Mageia 2. I have a UEFI-based laptop that cannot boot with any bootloader supported by Mageia. At this point, I can only use a third-party bootloader on a USB drive (super grub2 disk), until I figure out how to properly install grub2 by hand.

I suspect many people with recent hardware will be in the same situation soon.

Jerome
Comment 22 Manuel Hiebel 2012-06-26 11:12:44 CEST
Grub2 is in cauldron since some weeks thanks to barjac, but the integration needs to be done, if we need a new bug for that we can open a tracker later, so closing this one.
Comment 23 Jérôme Hénin 2012-06-26 11:20:05 CEST
The target for Grub2 integration is Mageia 3, so this kind of UEFI hardware will not be supported by Mageia 2 at any point. I can perfectly understand that backporting to Mageia 2 would be a large amount of work that is better invested elsewhere.

Then, maybe there should be a warning about this somewhere in the release notes, so that users don't try to install Mageia 2 on unsupported hardware? (or make sure that they are able to set up their own bootloader by hand)
Comment 24 Manuel Hiebel 2012-06-26 11:25:35 CEST
Jérôme, feel free to complete the feature page https://wiki.mageia.org/en/Feature:Grub2AsDefault with your point of view.
Comment 25 Barry Jackson 2012-06-26 15:44:48 CEST
(In reply to comment #21)
> This is definitely still valid for Mageia 2. I have a UEFI-based laptop that
> cannot boot with any bootloader supported by Mageia. At this point, I can only
> use a third-party bootloader on a USB drive (super grub2 disk), until I figure
> out how to properly install grub2 by hand.
> 
> I suspect many people with recent hardware will be in the same situation soon.
> 
> Jerome

There is the package grub2-efi in Cauldron, it has been tested and the tester's notes are in README.efi which is installed with the package.
He is using it in mga1 having re-built it from the src.rpm.
  
I personally have no uefi hardware, but if there are any questions regarding install or any clarification required regarding the notes in the README.efi then I will be happy to pass them on.

Barry <barjac>
Comment 26 Jérôme Hénin 2012-06-27 11:51:38 CEST
Okay, I have set up grub2-efi successfully, but there was a catch-22: to set grub2-efi as default, you need efibootmgr, and that requires to be booted in EFI mode, which is not simple until grub2-efi is installed.

One bootstrap process that works on my hardware:
1 - install mga (bootloader on MBR is non-functional)
2 - use a "super grub2" boot drive to boot in BIOS mode
3 - install grub2-efi as per README.efi instructions
4 - download and compile efibootmgr (I didn't find an mga package)
5 - use a rEFInd boot drive to reboot via grub2-efi, in EFI mode
6 - modprobe efivars; run efibootmgr as per Ubuntu's UEFIBooting page to set Grub2 as default.

This whole process will become entirely unnecessary only once the installer istelf boots in EFI mode, and can setup EFI boot. However, things could alreadyh be made a bit easier if:
a - the kernel config had CONFIG_EFI_STUB=y (skip step 2 above)
b - there was an efibootmgr package (skip step 4 above)

I wonder where this is best discussed. It is connected to Grub2, but the EFI install problem is more general, so it doesn't really belong on the Grub2AsDefault page.
Comment 27 Barry Jackson 2012-06-27 13:09:25 CEST
(In reply to comment #26)
Good that's encouraging. I can see that I have a lot to learn about efi ;)

I will look into importing efibootmgr package into Cauldron.

As regards a discussion forum, I think we need to open a tracker bug for grub2 integration, and then re-open this bug (or open a new one) as a place for the actual discussion which will be linked to the tracker.
I agree that the wiki features page seems to be the wrong place for discussion which will become protracted and the ML is busy enough.
A bug report seems the best place to me.

Anyone else got a better idea?.
Comment 28 Manuel Hiebel 2012-06-27 14:03:06 CEST
We can reopen this bug or a make a new one as tracker ( a new will be more clear in my opinion) and then add inside this tracker, two other: one for real bugs / absolutly integration needed, and one for a less priority enhancement (not like in mga2 where there was a mix beetween blocker and feature)
https://wiki.mageia.org/en/Mageia2_Postmortem#Bad_2

not sure if it's a better ideas, since I'm new in "devs/QA" side ;)
Comment 29 Barry Jackson 2012-06-30 02:43:08 CEST
Re-opening for now.
Update:-
Grub2 in Cauldron is now Version 2.0 Final Release.
efibootmgr is now in Cauldron for testing, and is suggested by grub2-efi.
Comment 30 Sander Lepik 2012-06-30 07:23:25 CEST
Should we keep an eye on this one too: https://plus.google.com/u/0/115547683951727699051/posts/gDfHgApPma1 ?
Comment 31 Jérôme Hénin 2012-07-01 11:46:28 CEST
(In reply to comment #30)
> Should we keep an eye on this one too:
> https://plus.google.com/u/0/115547683951727699051/posts/gDfHgApPma1 ?

This looks very interesting: now that mga kernels have the EFI stub option enabled (Bug 6598), they should be able to boot directly through gummiboot (as long as kernel images are copied to the ESP).
Comment 32 Thierry Vignaud 2012-12-07 12:42:25 CET
There's basic support in drakxtools-15.1 in core/updates_testing
Comment 33 Barry Jackson 2012-12-07 13:56:05 CET
(In reply to comment #32)
> There's basic support in drakxtools-15.1 in core/updates_testing

mcc -> boot -> set up boot system ....slight pause - bang.
#-------------

The "drakboot" program has crashed with the following error:

  unknown bootloader method grub2 (read) at /usr/lib/libDrakX/bootloader.pm line 194.
  Perl's trace:
  standalone::bug_handler() called from /usr/lib/libDrakX/bootloader.pm:194
  bootloader::read() called from /usr/sbin/drakboot:53

Used theme: oxygen-gtk
#-------------

grub2 is installed - this is in a vbox i586 install fully updated with updates-testing enabled.
Comment 34 Manuel Hiebel 2012-12-08 19:28:54 CET
(In reply to comment #33)
should be fixed in the new one (according to the changelog)
Comment 35 Barry Jackson 2012-12-09 00:10:20 CET
(In reply to comment #34)
> (In reply to comment #33)
> should be fixed in the new one (according to the changelog)

Yes it works, I can now switch to grub2 using drakboot - no problem in vbox, I have not yet tested in real hardware.
Comment 36 Barry Jackson 2012-12-27 02:03:52 CET
I just did a clean net-install on real hardware and attempted to install grub2 to sda7 (system root) rather than MBR, as I have a dedicated grub2 partition to multiboot/chanload into various systems.

The install failed with grub2-install complaining that it was not possible and /usr/sbin/grub2-bios-setup warnings about block lists, It also referred to /usr/lib/libdrakX/any.pm line 267 

I changed to MBR install and that worked OK. I then booted using the new grub2 menu into my current main Cauldron installation (on sda6) and chrooted into the new installation of Beta 1, (on sda7) where I issued:-

[root@localhost baz]# grub2-install --grub-setup=/bin/true /dev/sda7
Installation finished. No error reported.

Now why could the installer not do that? Maybe it's trying to do something else?

After correcting my overwritten MBR and updating my master boot menu for the new installation it now boots from my dedicated grub2 menu via multiboot:-

menuentry 'Mageia-3 Beta 1' {
search --no-floppy --label --set=root mageia-3b1
multiboot /boot/grub2/i386-pc/core.img

There is a long delay before the KDE login appears, but I am guessing that is unrelated to the bootloader.

Also:-
During the installation (after the user setup) the next screen asked:
"You decided to install the bootloader on a partition. This implies you already have a bootloader on the hard disk drive you boot (eg: System Commander)."
However at that stage I had not entered anything at all about boot configuration, as this was prior to the summary!
Comment 37 Barry Jackson 2012-12-28 18:33:29 CET
I have opened a separate bug about the last point above.
https://bugs.mageia.org/show_bug.cgi?id=8534

On a second net-install, to avoid overwriting the MBR I killed the install with 3 fingers at the grub2-install failure screen. I then chrooted into the new installation and continued as in #36.
It boots perfectly.
Comment 38 Manuel Hiebel 2013-02-26 11:31:07 CET
moving out enhancement bugs :
https://bugs.mageia.org/buglist.cgi?quicksearch=sw%3Agrub2_enhancement

to have a better view of what is still really needed
Comment 39 Richard Neill 2013-05-05 17:56:57 CEST
Perhaps I might add bug #9991 to this, as memtest86+ is missing from the grub2 boot options.
Comment 40 Barry Jackson 2013-05-05 18:23:18 CEST
(In reply to Richard Neill from comment #39)
> Perhaps I might add bug #9991 to this, as memtest86+ is missing from the
> grub2 boot options.

Yes you could change that bug to enhancement. It's not actually 'missing' BTW as we have never had it there. ;)

Note You need to log in before you can comment on or make changes to this bug.