9067 Support PMBR customisation with EFI label
Review Request #843 - Created Feb. 7, 2018 and submitted
| Information | |
|---|---|
| Andy Fiddaman | |
| illumos-gate | |
| master | |
| 9067, 9116 | |
| 6fbc984... | |
| Reviewers | |
| general | |
| hadfl | |
9067 Support PMBR customisation with EFI label
libefi:
reaper# grep Dell /usr/share/hwdata/efi.fixes | tail -1 sys.manufacturer="Dell Inc." sys.product="PowerEdge R730" mb.version=A04 pmbr_active=1 pmbr_slot=3 reaper# zpool create test c0t13d1 reaper# fdisk -W - c0t13d1p0 | tail -5 * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 238 128 255 63 1023 255 63 1023 1 62499999 reaper# zpool replace test c0t{13,14}d1 reaper# fdisk -W - c0t14d1p0 | tail -5 * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 238 128 255 63 1023 255 63 1023 1 62499999 reaper# sed -i '/PowerEdge/s/active=1/active=0/' /usr/share/hwdata/efi.fixes reaper# zpool replace test c0t{14,13}d1 reaper# fdisk -W - c0t13d1p0 | tail -5 * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 238 0 255 63 1023 255 63 1023 1 62499999 reaper# sed -i '/PowerEdge/s/slot=3/slot=1/' /usr/share/hwdata/efi.fixes reaper# zpool replace test c0t{13,14}d1 reaper# fdisk -W - c0t14d1p0 | tail -5 * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect 0 0 0 0 0 0 0 0 0 0 238 0 255 63 1023 255 63 1023 1 62499999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 reaper# sed -i '/PowerEdge/s/^/#/' /usr/share/hwdata/efi.fixes reaper# zpool replace test c0t{14,13}d1 reaper# fdisk -W - c0t13d1p0 | tail -5 * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect 238 0 255 63 1023 255 63 1023 1 62499999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0fdisk:
reaper# zpool export test reaper# fdisk -E 2:1 c0t13d1p0 reaper# fdisk -W - c0t13d1p0 | tail -5 * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 238 128 255 63 1023 255 63 1023 1 62499999 0 0 0 0 0 0 0 0 0 0 reaper# zpool import test reaper# zpool status test pool: test state: ONLINE scan: resilvered 86K in 0h0m with 0 errors on Mon Feb 12 10:46:49 2018 config: NAME STATE READ WRITE CKSUM test ONLINE 0 0 0 c0t13d1 ONLINE 0 0 0 errors: No known data errors
I really don't feel like providing a "default" file is correct solution here, could it be done in say zpool command instead, same way we added the -B option?
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Bugs: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
People: |
|
Change Summary:
Round 2 - different implementation with two parts.
fdisk -Eextended to take arguments so that the PMBR can be modified if necessary (useful for testing, patching, or moving disks between systems).- libefi - automatically tweak the PMBR for broken systems as defined in a separate database (text-file). The benefit of doing it here is that all consumers of libefi benefit and things like replacing a disk with
zpool replacework as expected - the replacement disk gets the modified PMBR too.I'm still unsure about where the database file should be in the filesystem but I think it is right to set
preserve=renamenewsince anyone who has modified this file has done it to support the host system and won't want the changes to be lost on an upgrade (and likely won't care about changes in that file since it's working for them).There was a bug in fdisk too that caused the EFI labels to always be cleared, even if the old and new PMBRs both contained an EFI partition of the same size and location. Please see testing notes for a summary of this working on a test system.
Lastly, the database file still needs a copyright adding. Since the data therein is derived from the FreeBSD installer, it likely needs to include theirs too but advice welcome.
Comments appreciated, thanks!
Commit: |
|
||||
|---|---|---|---|---|---|
Diff: |
Revision 2 (+300 -45) |
Can't speak for the actually code but I do like the new design.
/system/boot/kernel/drv <== driver configs like sd.conf live there. Maybe somewhere close to that location would be a good place to store it?
Change Summary:
Made smbios string checks case-insensitive. Added some missing (void) casts.
Commit: |
|
||||
|---|---|---|---|---|---|
Diff: |
Revision 3 (+326 -45) |
Successfully installed OmniOS on my LENOVO ThinkPad X1 with an install imaged based on this code provided by Andy.
-
usr/src/cmd/fdisk/fdisk.c (Diff revision 3) -
I think this (and 2265) would need issue and explanation - you can combine multiple issues in single update.
Change Summary:
Modify maximum HEAD globally in fdisk.c and adjust, include new bug number too.
Bugs: |
|
||||
|---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 4 (+325 -45) |
Ship It!
The new BSD licensed file likely needs the THIRDPARTYLICENSE stuff?
Change Summary:
Add THIRDPARTYLICENSE for efi.fixes database. Remove duplicate MAX_ definitions from fdisk.c.
Commit: |
|
||||
|---|---|---|---|---|---|
Diff: |
Revision 5 (+369 -64) |
Ship It!
