From fab442dfed60de21d9056b0267d1f6cb24e43738 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Fri, 30 Aug 2019 14:14:01 -0700 Subject: [PATCH] Do not use U-Boot files to find the latest kernel We have moved to booti from bootm (wrapped kernel) and thus old U-Boot scripts and files are no more available. Detect kernel file and version directly from the filesystem based on modification time. Signed-off-by: David Abdurachmanov --- opensbi-unstable.spec | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/opensbi-unstable.spec b/opensbi-unstable.spec index 1d833fc..0da478d 100644 --- a/opensbi-unstable.spec +++ b/opensbi-unstable.spec @@ -92,29 +92,13 @@ done # BUILD: kernel pushd fedora-builds/kernel -# Use klist.txt to find the latest installed kernel -[ -f /etc/sysconfig/uboot ] && . /etc/sysconfig/uboot - -ubootDir=${UBOOT_DIR:-"/boot"} -ubootKList=${UBOOT_KLIST:-"klist.txt"} - -if [ ! -f $ubootDir/$ubootKList ]; then - echo "U-Boot klist was not found! Cannot locate latest installed kernel image!" - exit 1 -fi - -latestKernel="/lib/modules/$(tail -n1 "$ubootDir/$ubootKList")/vmlinuz" +latestKernel=$(ls -1t /lib/modules/*/vmlinuz | head -n1) file "$latestKernel" echo "Payload: $latestKernel" -# Kernel is built with Image.gz target, we need to unpack before embedding it -# into OpenSBI -cp "$latestKernel" Image.gz -gunzip Image.gz - -make PLATFORM=qemu/virt FW_PAYLOAD_PATH="$PWD/Image" +make PLATFORM=qemu/virt FW_PAYLOAD_PATH="$latestKernel" #make docs # BUILD: kernel @@ -162,13 +146,7 @@ mv %{buildroot}/platform %{buildroot}%{_datadir}/%{name}/ #mv %{buildroot}/docs/refman.pdf %{buildroot}%{_pkgdocdir}/ #rm -rf %{buildroot}/docs -# Use klist.txt to find the latest installed kernel -[ -f /etc/sysconfig/uboot ] && . /etc/sysconfig/uboot - -ubootDir=${UBOOT_DIR:-"/boot"} -ubootKList=${UBOOT_KLIST:-"klist.txt"} -latestKernelVersion=$(tail -n1 "$ubootDir/$ubootKList") - +latestKernelVersion=$(ls -1t /lib/modules/*/vmlinuz | head -n1 | cut -d'/' -f4) mkdir -p %{buildroot}/boot/opensbi/unstable cp build/platform/qemu/virt/firmware/fw_jump.elf \