Subject: Re: [bug#64907] [PATCH 2/2] gnu: Add opensbi-rvvm.

From: Vagrant Cascadian <[email-masked]>
Date: Sat, 02 Sep 2023 19:24:45 -0700

On 2023-07-27, Juliana Sims wrote:
> * gnu/packages/firmware.scm (opensbi-rvvm): New symbol.
> * gnu/packages/patches/opensbi-rvvm-lowram-fdt.patch: New patch.
...
> diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
> index ff5afbcbe1..728050b43a 100644
> --- a/gnu/packages/firmware.scm
> +++ b/gnu/packages/firmware.scm
...
> @@ -567,6 +569,36 @@ (define-public opensbi-qemu
>      (description
>       "This package contains OpenSBI firmware files for use with QEMU.")))
>  
> +(define-public opensbi-rvvm
> +  (let ((base opensbi-generic))
> +    (package
> +      (inherit base)
> +      (name "opensbi-rvvm")
> +      (source (origin
> +                (inherit (package-source base))
> +                (patches (cons
> +                          ;; Allows opensbi to work on systems with <32M of RAM
> +                          ;; https://github.com/LekKit/patches-misc/blob/cc40906fbf1de9ae466304157f2bf7b8cc909cbe/opensbi/opensbi_lowram_fdt.patch
> +                          (search-patch "opensbi-rvvm-lowram-fdt.patch")
> +                          (origin-patches (package-source base))))))

As discussed elsewhere, maybe try the unpatched opensbi-generic.

> +
> +      (arguments
> +       (substitute-keyword-arguments (package-arguments base)
> +         ((#:make-flags flags)
> +          #~(cons (string-append "FW_PAYLOAD_PATH="
> +                                 #$(file-append u-boot-rvvm
> +                                                "/libexec/u-boot.bin"))
> +                  (delete "FW_PAYLOAD=n"
> +                          #$flags)))))
> +      (inputs (cons u-boot-rvvm
> +                    (package-inputs base)))
> +      (description (string-append (package-description base)

So my main question is if you can use rvvm with an unmodified
opensbi-generic, passing opensbi-generic and the u-boot-rvvm as
commandline arguments? I know this can be done with qemu...

If it really isn't possible, then just drop the low-ram patch if that
still works.

Thanks!

live well,
  vagrant