Add flag to the makefile to allow loader compilation as
Little-Endian 32-bit executable. Having 32-bit LE
loader.kboot is necessary to work on the latest
petitboot on POWER8 systems.
Usage: make LOADER_FORCE_LE=y -C sys/boot all
Differential D12421
Compile loader as Little-Endian on PPC64/POWER8 wma on Sep 20 2017, 11:05 AM. Authored by Tags None Referenced Files
Details Add flag to the makefile to allow loader compilation as Usage: make LOADER_FORCE_LE=y -C sys/boot all
Diff Detail
Event TimelineComment Actions How does this interact with the libstand build, which also needs to be little-endian? Is there a way to make the build system create both loader.kbootbe and loader.kbootle (or the like) by default, rather than relying on a custom build flag? Comment Actions The Makefile.inc adds the -mlittle_endian flag to all dependencies automatically, including libstand32. Regarding building of both loader.kboot and loader.kbootle the biggest problem is to provide two separate versions of libstand/libfdt/etc. I'm not sure how to do this with makefiles in elegant way... If you have no objections, I'd rather stick to WITH_LOADER_LE/MK_LOADER_LE as Warner suggested, since it's much simpler solution. Comment Actions OK. That's a pain to deal with. However, I'm not sure how we would make, say, ppc64 install media that include a usable loader.kboot in this configuration along with other cis-endian loaders. Maybe the answer is that we don't, that we use direct kexec() of our kernel (from the powernv branch) on install media, and leave a usable loader.kboot as an optional feature that people have to set up by hand? Comment Actions For future updates please include full context (e.g. git diff -U9999)
Comment Actions Oh, I indeed forgot to add -U9999 to the format-patch, sorry. As for the installation of fbsd on P8, I have a plan to investigate what can be done to make the petitboot running the freebsd kernel or loader netively.
Comment Actions I like this. I'll echo the concerns of how to build both in one tree, but this allows either/or choice which is the next best thing. Comment Actions I just (two days ago) committed code to the powernv branch that allows this. It's missing one patch (to ignore r6) that requires a little work still (you can fake it by setting mdp = NULL early in powerpc_init() for testing). The downside is that the kernel has to be on a petitboot-readable filesystem and you can't load KLDs from loader. Maybe we can lean on the petitboot people to add read-only UFS to their images?
I think this might be the harder option. Even aside from the initrd thing, there isn't an obvious way to provide a UI from loader. I guess you could do serial-only via OPAL? In any case, patch looks good. Thanks for doing this! |