Revert BLS changes

We use grubby-deprecated instead of grubby same as ARMv7. U-boot or/and
extlinux does not support BLS. We plan to use u-boot for booting on riscv64.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
This commit is contained in:
David Abdurachmanov 2019-01-18 13:50:31 +01:00
parent 420cb51711
commit 4ce7d6ed02
Signed by: davidlt
GPG Key ID: 7108702C938B13C1
1 changed files with 21 additions and 20 deletions

View File

@ -3,8 +3,8 @@
Name: fedora-bbl
# The last part is short hash
Version: 2019.01.16.66c13fd
Release: 2%{?dist}
Version: 2019.01.18.66c13fd
Release: 1%{?dist}
Summary: Berkeley Boot Loader (BBL) with embedded Fedora kernel
License: BSD
@ -15,12 +15,14 @@ URL: https://github.com/riscv/riscv-pk
%global full_commit 66c13fd4a9c1c2eda51df35ddc13e095469faec7
Source0: https://github.com/riscv/riscv-pk/archive/%{full_commit}.tar.gz
BuildRequires: kernel-core
BuildRequires: systemd-udev
BuildRequires: grubby-deprecated
BuildRequires: gcc
BuildRequires: binutils
BuildRequires: findutils
BuildRequires: grep
BuildRequires: coreutils
BuildRequires: kernel-core
%description
@ -36,20 +38,17 @@ mkdir -p build
pushd build
# Find Fedora kernel image in /boot
# This expects to find a single kernel-core package installed in chroot!
machine_id=$(cat /etc/machine-id)
kernel_vra=$(rpm -q --queryformat='%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}.%{ARCH}' kernel-core)
kernel_image="/boot/$machine_id/$kernel_vra/linux"
if [ ! -f "$kernel_image" ]; then
echo "Could not find kernel image!"
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: $kernel_image"
echo "BBL payload: $vmlinuz"
../configure \
--enable-logo \
--with-payload=$kernel_image
--with-payload=$vmlinuz
%make_build
popd
@ -57,24 +56,26 @@ 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
cp bbl %{buildroot}/boot/bbl-${vmlinuz_version}
popd
%files
%license LICENSE LICENSE.Batten LICENSE.riscv_logo.txt
%doc README.md
/boot/bbl
%post
machine_id=$(cat /etc/machine-id)
kernel_vra=$(rpm -q --queryformat='%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}.%{ARCH}' kernel-core)
images_dir="/boot/$machine_id/$kernel_vra"
cp -f /boot/bbl "/boot/$machine_id/$kernel_vra/bbl"
rm -f /boot/bbl
/boot/bbl-*
%changelog
* Fri Jan 18 2019 David Abdurachmanov <david.abdurachmanov@gmail.com> 2019.01.16.66c13fd-1
- Revert BLS (we use grubby-deprecated instead of grubby, same as ARMv7). This will be
needed for u-boot.
- Add systemd-udev and grubby to ensure that /boot is populated in chroot.
* Wed Jan 16 2019 David Abdurachmanov <david.abdurachmanov@gmail.com> 2019.01.16.66c13fd-2
- Introduce %post to move BBL into proper directory (/boot/machine_id/kernel_version/bbl)