DevHeads.net

seabios / seabios-bin split in Fedora - why?

I'm trying to package OpenSBI RISC-V firmware for Fedora
(<a href="https://github.com/riscv/opensbi" title="https://github.com/riscv/opensbi">https://github.com/riscv/opensbi</a>). It's a similar situation to
SeaBIOS and other architecture firmware. We have to cross-compile a
binary on potentially any Koji architecture, and end up with a noarch
package, because the final firmware blob can be installed on any
architecture too.

Here's my initial attempt:

<a href="https://koji.fedoraproject.org/koji/taskinfo?taskID=36861731" title="https://koji.fedoraproject.org/koji/taskinfo?taskID=36861731">https://koji.fedoraproject.org/koji/taskinfo?taskID=36861731</a>
<a href="http://oirase.annexia.org/reviews/opensbi/opensbi.spec" title="http://oirase.annexia.org/reviews/opensbi/opensbi.spec">http://oirase.annexia.org/reviews/opensbi/opensbi.spec</a>

I needed to use %global _binaries_in_noarch_packages_terminate_build 0
to stop RPM complaining about:

error: Arch dependent binaries in noarch package

SeaBIOS uses the same workaround:

<a href="https://src.fedoraproject.org/rpms/seabios/blob/master/f/seabios.spec" title="https://src.fedoraproject.org/rpms/seabios/blob/master/f/seabios.spec">https://src.fedoraproject.org/rpms/seabios/blob/master/f/seabios.spec</a>

But also it builds an empty seabios package and then builds the binary
into seabios-bin. Does anyone remember why that was needed?

Rich.

Comments

Re: seabios / seabios-bin split in Fedora - why?

By Daniel P. Berrange at 08/08/2019 - 10:25

On Thu, Aug 08, 2019 at 03:14:15PM +0100, Richard W.M. Jones wrote:
Originally we were using the native compilers, which meant we could
only build it on an x86 host. Thus the main seabios package was
ExclusiveArch %{ix86} x86_64. QEMU's TCG emulators though needed
the resulting firmware available on every arch, so we added the
ROM to the seabios-bin sub-RPM which was Buildarch: noarch.

It thus forced koji to pick an x86 host, but still gave us a noarch
result.

No longer after this though, we switched to using cross compilers,
so I'm not seeing the obvious need to keep this split -bin anymore.

Regards,
Daniel

Re: seabios / seabios-bin split in Fedora - why?

By Paolo Bonzini at 08/08/2019 - 10:22

On 08/08/19 16:14, Richard W.M. Jones wrote:
It's just backwards compatibility. seabios is a noarch package because
you can use it to run emulated x86 virtual machines on non-x86
architectures. At the same time, we wanted the build to happen on an
x86 machine so that was done via the empty package + ExclusiveArch.

Fedora builds of seabios and other firmware support cross compilation
these days though, so you don't need the hack anymore. You only need to
allow arch dependent binaries in noarch packages. Also, please install
the binaries in /usr/share, not /usr/lib.

Paolo

Re: seabios / seabios-bin split in Fedora - why?

By Daniel P. Berrange at 08/08/2019 - 10:27

On Thu, Aug 08, 2019 at 04:22:33PM +0200, Paolo Bonzini wrote:
If it is just backwards compat, how about we kill the -bin RPM now
to make it clearer to understand

Regards,
Daniel