Page MenuHomeFreeBSD

Add support for 'BSD' partition layout to bsdinstall/zfsboot
AbandonedPublic

Authored by allanjude on Jun 4 2014, 10:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 22 2024, 11:16 AM
Unknown Object (File)
Jan 3 2024, 3:10 AM
Unknown Object (File)
Dec 19 2023, 1:42 PM
Unknown Object (File)
Nov 11 2023, 10:02 PM
Unknown Object (File)
Oct 29 2023, 2:29 PM
Unknown Object (File)
Sep 19 2023, 4:55 PM
Unknown Object (File)
Sep 5 2023, 11:50 PM
Unknown Object (File)
Jul 1 2023, 12:54 AM
Subscribers
None

Details

Summary

On some Lenovo machines, booting ZFS off MBR partitions does not work

On the Lenovo X61s that we were able to test on at the BSDCan Hackers
Lounge, we were able to get them to boot properly using a BSD
partitioning scheme instead.

  • Add support for BSD partition type
  • Moved the write of the MBR boot sector to the end of the process to

avoid it being nuked by the pedantic zpool labelclear commands

  • Change the MBR code to not always create 2 zpools when using MBR. The

user only wants 2 pools (1 unencrypted to boot, and one encrypted for
data) in the case where they enable encryption. Due to the simplicity of
the code in previous versions of bsdinstall, two pools were used to
avoid a problem with the order of the creation of the partitions to
ensure that there was a partition at the front of the drive for the boot
code, and that the swap partition was the 2nd partition (BSD partition 'b')

  • Some style cleanup to make the flow of the MBR section more clear
  • Write the 'zfsboot' code to the two different places require for MBR and

BSD. Write the larger section first because writing the first sector
first seems to make the BSD partition disappear and appear as an empty
MBR (No idea why this was happening, reproduced on two Lenovo laptops)

  • Resolve variable reuse by renaming 'disksize' in second case to

'usablesize' to avoid disksize being disksize less swap+boot size

Sponsored By: ScaleEngine Inc.

Test Plan

Build release ISO and test

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

allanjude retitled this revision from to Add support for 'BSD' partition layout to bsdinstall/zfsboot.
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: roberto, eadler, wblock, bcr.
roberto edited edge metadata.

Looks good to me.

This revision is now accepted and ready to land.Jun 4 2014, 10:43 PM

I can't say much about it other than it's good that you are doing it.
If Ollivier as a source committer is OK with it, then you have his approval to make changes in the src tree and add a "Reviewed by: roberto" in the commit message. You don't need to get the approval from your doc mentors for this kind of change. Only for man page changes in the src tree, that is special.

This patch is no longer necessary, as I have developed a workaround for the Lenovo machines that cannot boot standard GPT. Writing the fake partition to the 2nd slot in the pMBR solves the issue.