Page MenuHomeFreeBSD

stand/uboot: reorg
ClosedPublic

Authored by imp on Dec 9 2021, 8:37 PM.

Details

Summary

Build uboot ubldr and friends like we build efi binaries
o move everything to be under stand/uboot
o md code goes in arch/$ARCH
o move everything over from the library

  • Had to rename console.c, disk.c and module.c due to conflicts

o update version to 1.5 to reflect the new way of building

This results in a more consistent build system and should represent no
functional change, apart from powerpc version getting new help
file. Also, moved to exlcuding uboot on powerpc64le by using
BROKEN_OPTION instead of the incidental exclusion we had before due to
Makefile reorgs.

Sponsored by: Netflix

Test Plan

Looking for ways to test this...

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

imp requested review of this revision.Dec 9 2021, 8:37 PM
imp added reviewers: manu, mmel, bdragon, tsoome.
jrtc27 added inline comments.
share/mk/src.opts.mk
318

I think you mean || ${__T} == "powerpc64le" inside your parentheses (!ppcbe == !(ppc && be) == (!ppc || !be) == (!ppc || le))? What you have is equivalent to the existing ${__T:Mpowerpc*} == "".

Get logic right, per jessica's feedback

imp marked an inline comment as done.Dec 9 2021, 10:10 PM
imp added inline comments.
share/mk/src.opts.mk
318

I think this fix is correct, please verify.

stevek added inline comments.
share/mk/src.opts.mk
317

Instead of the separate :M values you can do it like this:

.if ${__T:Narm*:Npowerpc*} != "" || ${__T} == "powerpc64le"

(Note that I don't think you intended to have $__fT in there... it looks like a "f" creeped in.)

imp marked an inline comment as done.Dec 10 2021, 3:58 AM
imp added inline comments.
share/mk/src.opts.mk
317

I agree about the stray f.

However, your example is != and mine is ==, so ${__T:Narm*:Npowerpc*} will always produce the null set, no?

share/mk/src.opts.mk
317

stevek's suggestion uses :N not :M, but :N isn't commonly used in base for this, especially this file likes :M != "", so I'd prefer to keep it as is

share/mk/src.opts.mk
317

We use the :N form a lot in our build at Juniper as it's rather convenient and more efficient than a bunch of separate expressions

share/mk/src.opts.mk
317

For example of usage already in the tree, see share/mk/bsd.obj.mk with the .TARGETS variable

share/mk/src.opts.mk
317

OK. I've convinced myself that :N makes sense (thanks jrtc27 for the insight).
I'm inclined to keep it as is for the moment,...

I do have one question on ubldr: how do I test it?

This revision was not accepted when it landed; it landed in state Needs Review.Dec 15 2021, 4:15 AM
Closed by commit rG9dc70af83e59: stand/uboot: reorg (authored by imp). · Explain Why
This revision was automatically updated to reflect the committed changes.