27.08.2024 00:53, Vagrant Cascadian wrote:
On 2023-12-18, Michael Tokarev wrote:
If we're to go this route, will ask opensbi maintainer(s) to create symlinks to
opensbi firmware in /usr/share/qemu/ directory. This will involve Break/Replace
of the old qemu-system-data package.

I could do that with all the Breaks/Replaces dance in opensbi ... but
would it also be an option to just put the symlinks in qemu-system-data
and depend or recommend on opensbi to avoid the Breaks/Replaces dance?

Actually.. I can't remember exactly why I asked for the (sym)links.

For an optional firmware (like it was with sgabios for example), I can't
ship such symlink on qemu side because it becomes dangling if the package
isn't installed, and users complain, - so it should be the optional pkg
who provides the symlink to itself, named after what the qemu expects...

Aha. Now I start to realize what's going on.

This is for qemu-system-riscv64.  Which is part of qemu-system-misc.  So
for most setups, this file wont be needed, and "can" be optional, - as
long as you don't run qemu-system-riscv64.

I can make qemu-system-data depend on opensbi, with the symlinks et al, -
this way it will be exactly the way it is now, except of the extra
package installed which was just a file (two actually) inside.

Or I can split qemu-system-riscv out of qemu-system-misc and make *that*
one depend on opensbi.  But this way I can't merge all qemu-system-foo
packages back into single qemu-system which I dreamed to do for quite
some time...

So, the reason why I thought about symlink in qemu namespace provided by
opensbi is to be able to make opensbi optional, not because something in
there changes often.

Maybe I can, at least, make qemu produce a warning when it tries to load
opensbi firmware and can't - to install appropriate package.

Ok.  This one needs a bit more thoughts.


Now a more interesting question.  Does opensbi provide all necessary files
for qemu?  Right now, qemu-system-data ships these files:

262K Aug 17 10:53 usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
265K Aug 17 10:53 usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.bin

Apparently this is not what opensbi package ships.  Maybe this one:

113K Nov 25  2022 usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.bin

is okay as opensbi-riscv64-generic-fw_dynamic.bin but from the size it does
not look like it is, or maybe I just forgot to run strip on the elf part
in my build.

But apparently it lacks opensbi-riscv32-generic-fw_dynamic.bin which qemu
ships too.

I don't know how the 32bit version is used. I build qemu-system-riscv32
binary, and that one does load opensbi-riscv32-generic-fw_dynamic.bin and
fails if it is not present. But how useful it is, - I don't know.

Hmm...

Reply via email to