os-prober should chainload other linux if there is bootloader on the partition

Bug #446764 reported by Andrew Jorgensen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
os-prober (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: os-prober

I have two Linux distributions installed. SUSE prefers to install it's bootloader on it's root partition rather than on the MBR. Ideally os-prober / grub-common would see that the partition has a bootloader (grub) on it and chainload instead of loading the other distro's kernel directly.

This approach would be a lot safer than the current approach because it would allow the other distro to fully control the kernel parameters used to boot and would (assuming the distro takes care of this itself) allow the other distro to upgrade it's kernel or change parameters without os-prober needing to re-detect.

Revision history for this message
David (deivi73) wrote :

I solved this issue with two modifications.

In first place, I wrote a grub detector based on /usr/lib/os-probes/mounted/90linux-distro with sequence number 89 to run before linux distribution detection:

/usr/lib/os-probes/mounted/89grub is attached

Then, I modified /etc/grub.d/30_os-prober to deal with the grub case. I set the following before the *) default option:

grub)
      found_other_os=1
      cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" --class linux --class gnu --class os {
EOF
      GDRIVE="`grub-probe -d /dev/sda4 -t drive 2> /dev/null`"
      cat <<EOF
 insmod ext2
 set root='${GDRIVE}'
 chainloader +1
}
EOF
    ;;
*)

Revision history for this message
David (deivi73) wrote :

I forgot to attach the file that should be installed in /usr/lib/os-probes/mounted/89grub

It returns "grub" as detected OS and it is parsed later in /etc/grub.d/30_os-prober

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in os-prober (Ubuntu):
status: New → Confirmed
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.