diff --git a/0001-Enable-build-id-for-elf-files.patch b/0001-Enable-build-id-for-elf-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..e5842da178dee8902235684984b5b31706149ab7 --- /dev/null +++ b/0001-Enable-build-id-for-elf-files.patch @@ -0,0 +1,25 @@ +From 458c01801bb9f0084d47ef421809693517c48ccf Mon Sep 17 00:00:00 2001 +From: zhangxuzhou +Date: Mon, 3 Aug 2020 16:58:44 +0800 +Subject: [PATCH] Enable build id for elf files + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index ccf8ea3..025ccf8 100644 +--- a/Makefile ++++ b/Makefile +@@ -191,7 +191,7 @@ ASFLAGS += $(firmware-asflags-y) + + ARFLAGS = rcs + +-ELFFLAGS += -Wl,--build-id=none -N -static-libgcc -lgcc ++ELFFLAGS += -N -static-libgcc -lgcc + ELFFLAGS += $(platform-ldflags-y) + ELFFLAGS += $(firmware-ldflags-y) + +-- +2.26.2 + diff --git a/opensbi.spec b/opensbi.spec new file mode 100644 index 0000000000000000000000000000000000000000..1b0f7eaaa31c56ed41be99c8225ed67eb60ce92d --- /dev/null +++ b/opensbi.spec @@ -0,0 +1,77 @@ +# The obs worker of RISC-V runs in cross-arch qemu virt, which support +# multi-thread maxmium of 8. +%global _smp_mflags -j8 +%global debug_package %{nil} + +Name: opensbi +Version: 0.6 +Release: 1 +Summary: RISC-V Open Source Supervisor Binary Interface +URL: https://github.com/riscv/opensbi +License: BSD + +Source0: https://github.com/riscv/opensbi/archive/v0.6.zip + +Patch0: 0001-Enable-build-id-for-elf-files.patch + +BuildRequires: kernel-riscv64 +BuildRequires: gcc, binutils, findutils, coreutils, gzip, file + +Provides: opensbi-%{_target_cpu}-image = %{version}-%{release} + +ExclusiveArch: riscv64 +ExclusiveOS: Linux + +%ifarch riscv64 +%define hd_arch riscv +%endif + +%description +The RISC-V openSBI with flattened kernel image as payload. +Currently this packages only provides booting image for RISC-V QEMU virt. + +%package devel +Summary: OpenSBI Generic Headers and library + +%description devel +The opensbi static lib for developing applications of interaction with RISC-V opensbi. + +%package devel-qemu +Summary: OpenSBI Static library for QEMU + +%description devel-qemu +The opensbi lib for developing applications of interaction with RISC-V firmware. + +%prep +%autosetup -n opensbi-%{version} + +%build +mkdir -p build-oe/qemu-virt + +# QEMU/virt build: use flatten Linux kernel Image as QEMU virt payload +make O=build-oe/qemu-virt PLATFORM=qemu/virt FW_PAYLOAD=y FW_PAYLOAD_PATH=/boot/Image + +# TODO: build opensbi Image for SiFive hardware + +%install +# QEMU/virt Install +make I=%{buildroot} PLATFORM=qemu/virt O=build-oe/qemu-virt install +mkdir -p %{buildroot}/boot +cp %{buildroot}/platform/qemu/virt/firmware/fw_payload.elf \ + %{buildroot}/boot/fw_payload_oe_qemuvirt.elf + +%files +%license COPYING.BSD +%doc README.md +/boot/fw_payload_oe_qemuvirt.elf + +%files devel +/include/* +/lib/* + +%files devel-qemu +/platform/qemu/virt/* + +%changelog +* Mon Aug 03 2020 whoisxxx - 0.6-1-riscv64 +- Init version of QEMU/virt with flattened Image as payload diff --git a/v0.6.zip b/v0.6.zip new file mode 100644 index 0000000000000000000000000000000000000000..5e1f54f7c4d9d1c70ae18b443a8fe3030d3c849e Binary files /dev/null and b/v0.6.zip differ