fedora-bbl/fedora-bbl.spec

74 lines
1.6 KiB
RPMSpec

# 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 <david.abdurachmanov@gmail.com> 2018.11.13.6ebd0f2-1
- Add new package