Grub2 does not setup existing linux operating systems correctly on PowerPC

Bug #1261817 reported by Adam Smith
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fedora
New
Undecided
Unassigned
os-prober (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello

I don't know if Ubuntu have any plans to use Grub2 for PowerPC, but currently there is an easily fixable bug with os-prober:

Existing installations that use yaboot will normally have their root defined like so in a yaboot.conf:

root=UUID=big-long-number-0000

However, os-prober (or more accuratly the file 40yaboot) when it scans the yaboot.conf will read this as

root=UUID

Consequently, when the operating system is selected from a grub2 menu it fails to boot.

This can be solved by changing (in 40yaboot)

  case "$1" in
   root)
    rootdev="$(dequote "$2")"

to

  case "$1" in
   root)
    shift 1
    rootdev="$(dequote "${line#root=}")"

I'll make a proper diff patch when I'm back on a linux machine. I'm not sure if the shift 1 is necessary. but some of the other cases seem to have it so I put it in.

I had a look at yaboot-installer to see how that does things and interestingly that has its own piece of code to setup root:

# Get UUID= or LABEL= for the given unix partition block device.
# If it could not be determined, give the unix partition block device back.
uuidlabel() {
  echo `devsymlink "$1" nobyid` \
  | sed -e "s,/dev/disk/by-uuid/,UUID=," \
        -e "s,/dev/disk/by-label/,LABEL=,"
}

root="`uuidlabel "$mappedpartition"`"

This therefore doesn't suffer from this bug. It's actually quite a sensible thing to do since root=/dev/sdx (which a lot of old installs used to use) is unreliable. I don't know whether to create a patch for os-prober to do the same, or if the grub2 scripts should really sort it out.

Anyway, that's turned into a bit of a ramble. Oh, nearly forgot, fedora also has a patch on os-prober for PowerPC - see https://bugzilla.redhat.com/show_bug.cgi?id=825041 .

I'm toying with the idea of creating an updated iso for Ubuntu 12.04. If I do then I plan to use Grub2 as the bootloader. If you would like to collaborate on shifting PowerPC to grub2 then get in touch!

Thanks

Tags: patch
Revision history for this message
Adam Smith (adamsmith) wrote :

Attached is the patch. If anybody wants to fix this on their system then all you need to do is edit the file /usr/lib/linux-boot-probes/mounted/40yaboot and apply the changes.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix root UUID on PowerPC" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Adam Smith (adamsmith) wrote :

This is a different bug from Fedora 825041 and so this should not be assigned to that bug.

affects: os-prober (Fedora) → fedora
Changed in fedora:
importance: Unknown → Undecided
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.