From 390ad290602f87c6516eb4ba4ce426ee0c37d190 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Aug 2016 15:09:35 +0100 Subject: [PATCH] Add stage 2 riscv-pk package, containing the Berkeley bootloader (bbl). --- Makefile | 23 +++++++++++++++++- README | 5 +++- stage2-riscv-pk/riscv-pk.spec | 56 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 stage2-riscv-pk/riscv-pk.spec diff --git a/Makefile b/Makefile index f8dd949..7a577ae 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,9 @@ stage2: stage2-riscv-gnu-toolchain/riscv-gnu-toolchain-1374381e.tar.gz \ stage2-riscv-gnu-toolchain/gcc-6.1.0.tar.gz \ stage2-riscv-gnu-toolchain/glibc-2.23.tar.gz \ stage2-riscv-gnu-toolchain/newlib-2.2.0.tar.gz \ - stamp-riscv-gnu-toolchain-installed + stamp-riscv-gnu-toolchain-installed \ + stage2-riscv-pk/riscv-pk-927979c5.tar.gz \ + stamp-riscv-pk-installed stage2-riscv-gnu-toolchain/riscv-gnu-toolchain-1374381e.tar.gz: rm -f $@ $@-t @@ -85,6 +87,25 @@ stamp-riscv-gnu-toolchain-installed: } touch $@ +stage2-riscv-pk/riscv-pk-927979c5.tar.gz: + rm -f $@ $@-t + wget -O $@-t https://github.com/lowRISC/riscv-pk/archive/927979c5af6a69360b5dd61d3b17cd06ae73d1ac/riscv-pk-927979c5.tar.gz + mv $@-t $@ + +stamp-riscv-pk-installed: + rm -f $@ + @rpm -q riscv-pk >/dev/null || { \ + echo "ERROR: You must install riscv-pk:"; \ + echo; \ + echo " dnf copr enable rjones/riscv"; \ + echo " dnf install riscv-pk"; \ + echo; \ + echo "OR: you can build it yourself from the stage2-riscv-pk directory."; \ + echo; \ + exit 1; \ + } + touch $@ + # Stage 3 stage3: diff --git a/README b/README index 1224fa5..6849805 100644 --- a/README +++ b/README @@ -99,7 +99,7 @@ Bootstrapping stages Not upstream, fork of qemu 2.5.0. https://github.com/riscv/riscv-qemu -Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv-qemu/ +Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv Note this package runs on x86-64 hosts, and is intended for people who want to run Fedora/RISC-V but who do not have FPGA/hardware. @@ -114,10 +114,13 @@ http://www.lowrisc.org/docs/untether-v0.2/fpga-demo/ (2a) GNU cross-compiler toolchain. https://github.com/lowRISC/riscv-gnu-toolchain +Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv (2b) Berkley Bootloader (bbl) https://github.com/lowrisc/riscv-pk.git +Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv + Used to boot the kernel and mount the root filesystem on FPGAs and QEMU. diff --git a/stage2-riscv-pk/riscv-pk.spec b/stage2-riscv-pk/riscv-pk.spec new file mode 100644 index 0000000..d6b26b0 --- /dev/null +++ b/stage2-riscv-pk/riscv-pk.spec @@ -0,0 +1,56 @@ +%global debug_package %{nil} + +%global commit 927979c5af6a69360b5dd61d3b17cd06ae73d1ac +%global shortcommit 927979c5 + +Name: riscv-pk +Version: 0 +Release: 0.1.git%{shortcommit}%{?dist} +Summary: RISC-V proxy kernel (pk) and boot loader (bbl) +License: BSD + +URL: https://github.com/lowRISC/riscv-pk +Source0: https://github.com/riscv/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz + +BuildRequires: riscv-gnu-toolchain + + +%description +This is the RISC-V fork of the GNU cross-compiler toolchain. It +includes binutils and GCC. + + +%prep +%setup -q -n %{name}-%{commit} + + +%build +mkdir build +pushd build +# Setting RUN to /bin/true prevents pk from looking for the 'spike' +# RISC-V cycle-accurate emulator, which would be needed to run tests +# but we don't care about here. +../configure --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --host=riscv64-unknown-elf RUN=/bin/true + +make +popd + + +%install +pushd build +make install DESTDIR=$RPM_BUILD_ROOT +popd + + +%files +%doc README.md LICENSE +%{_bindir}/bbl +%{_bindir}/dummy_payload +%{_bindir}/pk +%{_includedir}/riscv-pk +%{_prefix}/lib/riscv-pk + + +%changelog -- 1.8.3.1