]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r344260, r344335
authorIan Lepore <ian@FreeBSD.org>
Sun, 21 Apr 2019 20:46:49 +0000 (20:46 +0000)
committerIan Lepore <ian@FreeBSD.org>
Sun, 21 Apr 2019 20:46:49 +0000 (20:46 +0000)
commit875975231fca08d80840330c7fe3c1c4617c867f
tree4557ccc3d223479f6219fb1019a2488dae2e2524
parent3ab0176fe9379537dd42c1b09e4be9dfb227be3a
MFC r344260, r344335

r344260:
Allow the u-boot loaderdev env var to be formatted in the "usual" loader(8)
way: device<unit>[s|p]<slice><partition>.  E.g., disk0s2a or disk3p12.
The code first tries to parse the variable in this format using the
standard disk_parsedev().  If that fails, it falls back to parsing the
legacy format that has been supported by ubldr for years.

In addition to 'disk', all the valid uboot device names can also be used:
mmc, sata, usb, ide, scsi. The 'disk' device serves as an alias for all
those types and will match the Nth storage-type device found (where N is
the unit number).

r344335:
Fix the handling of legacy-format devices in the u-boot loaderdev variable.
When I added support for the standard loader(8) disk0s2a: type formats,
the parsing of legacy format was broken because it also contains a colon,
but it comes before the slice and partition. That would cause disk_parsedev()
to return success with the slice and partition set to wildcard values.

This change examines the string first, and if it contains spaces, dots, or
a colon at any position other than the end, it must be a legacy-format
string and we don't even try to use disk_parsedev() on it.
stand/uboot/common/main.c