Bug 158358

Summary: [loader] [patch] allow /boot/loader to work from an MBR extended partition
Product: Base System Reporter: Gyrd Thane Lange <gyrd-se>
Component: kernAssignee: Andrey V. Elsukov <ae>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 9.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Gyrd Thane Lange 2011-06-28 02:00:20 UTC
http://parvati.thanelange.no/freebsd/boot_loader/

The FreeBSD loader has since a very long time ago attempted to work
with MBR extended partitions but a simple logical error has prevented
it from succeeding:

How it is supposed to work.

-----
| 1 |
-----
| 2 | --
-----   |
        |
        |
        |
----- <-
| 5 |
-----
|   | --
-----   |
        |
        |
        |
----- <-
| 6 |
-----
|   |
-----


How /boot/loader (incorrectly) works.

-----
| 1 |
-----
| 2 | --
-----   |
        |
        |
        |
----- <-
| 5 |
-----
| 6 | --
-----   |
        |
        |
        |
----- <-
| 7 |
-----
| 8 |
-----

Fix: Using the attached patch:
patch -d /usr/src/sys/boot/i386/libi386/ < boot_loader.diff

Patch is also found here:
http://parvati.thanelange.no/freebsd/boot_loader/boot_loader.diff


Patch attached with submission follows:
How-To-Repeat: Install FreeBSD in an MBR extended partition. (It is easily doable using command line tools.)

Attempt to boot.

Observe that the /boot/loader does not find the desired partition.
Comment 1 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-08-06 09:55:30 UTC
State Changed
From-To: open->patched

This issue fixed in head/ after r239088.
Comment 2 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-10-17 16:31:57 UTC
Responsible Changed
From-To: freebsd-bugs->ae

Take.
Comment 3 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-11-19 13:08:43 UTC
State Changed
From-To: patched->closed

Fixed in r243243. Thanks!