commit 8a877c3776a338aedac96fcbedad846c16d65779 Author: David Abdurachmanov Date: Tue Nov 13 10:54:01 2018 +0100 Initial commit We don't have our own look aside cache to store sources thus let's try to ship tarball (small) within the repo. Signed-off-by: David Abdurachmanov diff --git a/6ebd0f2a46255d0c76dad3c05b16c1d154795d26.tar.gz b/6ebd0f2a46255d0c76dad3c05b16c1d154795d26.tar.gz new file mode 100644 index 0000000..bb758cd Binary files /dev/null and b/6ebd0f2a46255d0c76dad3c05b16c1d154795d26.tar.gz differ diff --git a/fedora-bbl.spec b/fedora-bbl.spec new file mode 100644 index 0000000..71a46a1 --- /dev/null +++ b/fedora-bbl.spec @@ -0,0 +1,73 @@ +# Disable debug packages, we don't need them. +%global debug_package %{nil} + +Name: fedora-bbl +# The last part is short hash +Version: 2018.11.13.6ebd0f2 +Release: 1%{?dist} +Summary: Berkeley Boot Loader (BBL) with embedded Fedora kernel + +License: BSD +URL: https://github.com/riscv/riscv-pk + +# Download tarball, e.g.: +# https://github.com/riscv/riscv-pk/archive/%full_commit.tar.gz +%global full_commit 6ebd0f2a46255d0c76dad3c05b16c1d154795d26 +Source0: https://github.com/riscv/riscv-pk/archive/%{full_commit}.tar.gz + +BuildRequires: kernel-core +BuildRequires: gcc +BuildRequires: binutils +BuildRequires: findutils +BuildRequires: grep +BuildRequires: coreutils + + +%description +Berkeley Boot Loader (BBL) with embedded Fedora kernel (vmlinuz) image. +It is used for booting on RISC-V 64-bit (riscv64) systems. + +%prep +%autosetup -n riscv-pk-%{full_commit} + + +%build +mkdir -p build +pushd build + +# Find Fedora kernel image in /boot +vmlinuz=$(find /boot | grep vmlinuz | grep -v -E '(rescue|hmac)') +if [[ "$vmlinuz" = *$'\n'* ]]; then + echo "We expected to find a single file!" + exit 1 +fi + +echo "BBL payload: $vmlinuz" + +../configure \ + --enable-logo \ + --with-payload=$vmlinuz + +%make_build +popd + + +%install +pushd build +# Find Fedora kernel image in /boot and extract version +vmlinuz=$(find /boot | grep vmlinuz | grep -v -E '(rescue|hmac)') +vmlinuz_version=$(echo "$vmlinuz" | cut -d'-' -f2-) + +mkdir -p %{buildroot}/boot +cp bbl %{buildroot}/boot/bbl-${vmlinuz_version} +popd + + +%files +%license LICENSE LICENSE.Batten LICENSE.riscv_logo.txt +%doc README.md +/boot/bbl-* + +%changelog +* Tue Nov 13 2018 David Abdurachmanov 2018.11.13.6ebd0f2-1 +- Add new package