userboot.so can't open rootfs partition if you use raw BSD partitions directly on disk without any slices
Michael Pounov
misho at elwix.org
Thu Jun 4 16:47:33 UTC 2020
Excuse me for double sent, but I forgot the attachment :(
After upgrade from FreeBSD 12.0 to 12-STABLE of embedded image under BHyve guest I faced with bootloader issue.
>From FreeBSD 12.1 till current version of FreeBFrom FreeBSD 12.1 till current version of FreeBSD. userboot.so loader haves issue with raw BSD partitions directly on disk without any PC slice schema aka MBR or GPT.
Bug came after commit, when predefine constant values was replaced with macro definitions in userboot/main.c and common/disk.c. These two members of devsw structure d_slice and d_partition now have defined constants. One of them have different value from previous version of code.
D_PARTWILD now have value -2, before that change dev.d_partition has 0.
I didn't take easy step directly to change macro D_PARTWILD to 0, because I saw that uboot loader already used this macro.
I made patch in common/disk.c file into disk_open() functionSD. userboot.so loader haves issue with raw BSD partitions directly on disk without any PC slice schema aka MBR or GPT.
Bug came after commit, when predefine constant values was replaced with macro definitions in userboot/main.c and common/disk.c. These two members of devsw structure d_slice and d_partition now have defined constants. One of them have different value from previous version of code.
D_PARTWILD now have value -2, before that change dev.d_partition has 0.
I didn't take easy step directly to change macro D_PARTWILD to 0, because I saw that uboot loader already used this macro.
I made patch in common/disk.c file into disk_open() function
P.S. Patch was produced against base/head sources
Regards
Michael Pounov
CloudSigma AG
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disk_open.patch
Type: application/octet-stream
Size: 478 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20200604/5af7ff57/attachment.obj>
More information about the svn-src-all
mailing list