From: Richard W.M. Jones Date: Tue, 6 Jun 2023 12:54:26 +0000 (+0100) Subject: Package 32- and 64-bit firmware versions X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=fbd0321544a7f2da82164f8d32fedf48be4107ec;p=fedora-reviews.git Package 32- and 64-bit firmware versions --- diff --git a/opensbi/opensbi.spec b/opensbi/opensbi.spec index 8d779b3..ad8051c 100644 --- a/opensbi/opensbi.spec +++ b/opensbi/opensbi.spec @@ -48,21 +48,54 @@ RISC-V virt machines. %build -make \ +mkdir build32 build64 +# Build 32 bit firmware. +%make_build \ + O=build32 \ + CROSS_COMPILE=riscv64-linux-gnu- \ + PLATFORM=generic \ + PLATFORM_RISCV_XLEN=32 +# Build 64 bit firmware. +%make_build \ + O=build32 \ CROSS_COMPILE=riscv64-linux-gnu- \ PLATFORM=generic %install -make \ +# Install 32 bit firmware. +%make_install \ + O=build32 \ CROSS_COMPILE=riscv64-linux-gnu- \ PLATFORM=generic \ + PLATFORM_RISCV_XLEN=32 \ I=%{buildroot} \ - INSTALL_LIB_PATH=lib64 \ - INSTALL_FIRMWARE_PATH=%{_datadir}/%{name} \ - install - -rm -rfv %{buildroot}/lib64 + INSTALL_LIB_PATH=%{_libdir} \ + INSTALL_FIRMWARE_PATH=%{_datadir}/%{name} +pushd %{buildroot}%{_datadir}/%{name}/generic/firmware +for f in fw_*.bin fw_*.elf; do + mv $f riscv32_$f +done +popd + +# Install 64 bit firmware. +%make_install \ + O=build64 \ + CROSS_COMPILE=riscv64-linux-gnu- \ + PLATFORM=generic \ + I=%{buildroot} \ + INSTALL_LIB_PATH=%{_libdir} \ + INSTALL_FIRMWARE_PATH=%{_datadir}/%{name} +pushd %{buildroot}%{_datadir}/%{name}/generic/firmware +for f in fw_*.bin fw_*.elf; do + mv $f riscv64_$f +done +popd + +# Remove development libraries and headers for the time being. +rm -rfv %{buildroot}%{_libdir} rm -rfv %{buildroot}/include + +# Remove the example/testing payloads. rm -rfv %{buildroot}%{_datadir}/%{name}/*/firmware/payloads