[CFC/CFT] large changes in the loader(8) code
- From: "Andrey V. Elsukov" <bu7cher@xxxxxxxxx>
- Date: Tue, 26 Jun 2012 16:50:36 +0400
Some time ago i have started reading the code in the sys/boot.
Especially i'm interested in the partition tables handling.
I found several problems:
1. There are several copies of the same code in the libi386/biosdisk.c
and common/disk.c, and partially libpc98/biosdisk.c.
2. ZFS probing is very slow, because the ZFS code doesn't know how many
disks and partitions the system has:
3. The GPT support doesn't check CRC and even doesn't know anything
about the secondary GPT header/table.
So, i have created the branch and committed the changes:
The patch is here:
What i already did:
1. The partition tables handling now is machine independent,
and it is compatible with the kernel's GEOM_PART implementation.
There is new API for disk drivers in the loader to get information
about partitions and tables:
2. The similar and general code from the disk drivers merged in the
3. ZFS code now uses new API and probing on the systems with many disks
should be greatly increased:
4. The gptboot now searches the backup GPT header in the previous sectors,
when it finds the "GEOM::" signature in the last sector. PMBR code also
tries to do the same:
5. Also the pmbr image now contains one fake partition record.
When several first sectors are damaged the kernel can't detect GPT
(see RECOVERING section in the gpart(8)). We can restore PMBR with dd(1)
command, but the old pmbr image has an empty partition table and
loader doesn't able to boot from GPT, when there is no partition record
in the PMBR. Now it will be able. When pmbr is installed via 'gpart bootcode'
command, the kernel correctly modifies this partition record. So, this is only
for the first rescue step.
6. I have changed userboot interface. I guess there is none consumers except
the one test program. But if it isn't that, i can make it compatible.
Any comments are welcome.
WBR, Andrey V. Elsukov
Description: OpenPGP digital signature
- Prev by Date: Re: sysctl filesystem ?
- Next by Date: Re: [CFC/CFT] large changes in the loader(8) code
- Previous by thread: sysctl filesystem ?
- Next by thread: Re: [CFC/CFT] large changes in the loader(8) code