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 <david.abdurachmanov@sifive.com>
This commit is contained in:
parent
a232dac507
commit
fab442dfed
@ -92,29 +92,13 @@ done
|
|||||||
# BUILD: kernel
|
# BUILD: kernel
|
||||||
pushd fedora-builds/kernel
|
pushd fedora-builds/kernel
|
||||||
|
|
||||||
# Use klist.txt to find the latest installed kernel
|
latestKernel=$(ls -1t /lib/modules/*/vmlinuz | head -n1)
|
||||||
[ -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"
|
|
||||||
|
|
||||||
file "$latestKernel"
|
file "$latestKernel"
|
||||||
|
|
||||||
echo "Payload: $latestKernel"
|
echo "Payload: $latestKernel"
|
||||||
|
|
||||||
# Kernel is built with Image.gz target, we need to unpack before embedding it
|
make PLATFORM=qemu/virt FW_PAYLOAD_PATH="$latestKernel"
|
||||||
# into OpenSBI
|
|
||||||
cp "$latestKernel" Image.gz
|
|
||||||
gunzip Image.gz
|
|
||||||
|
|
||||||
make PLATFORM=qemu/virt FW_PAYLOAD_PATH="$PWD/Image"
|
|
||||||
#make docs
|
#make docs
|
||||||
|
|
||||||
# BUILD: kernel
|
# BUILD: kernel
|
||||||
@ -162,13 +146,7 @@ mv %{buildroot}/platform %{buildroot}%{_datadir}/%{name}/
|
|||||||
#mv %{buildroot}/docs/refman.pdf %{buildroot}%{_pkgdocdir}/
|
#mv %{buildroot}/docs/refman.pdf %{buildroot}%{_pkgdocdir}/
|
||||||
#rm -rf %{buildroot}/docs
|
#rm -rf %{buildroot}/docs
|
||||||
|
|
||||||
# Use klist.txt to find the latest installed kernel
|
latestKernelVersion=$(ls -1t /lib/modules/*/vmlinuz | head -n1 | cut -d'/' -f4)
|
||||||
[ -f /etc/sysconfig/uboot ] && . /etc/sysconfig/uboot
|
|
||||||
|
|
||||||
ubootDir=${UBOOT_DIR:-"/boot"}
|
|
||||||
ubootKList=${UBOOT_KLIST:-"klist.txt"}
|
|
||||||
latestKernelVersion=$(tail -n1 "$ubootDir/$ubootKList")
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p %{buildroot}/boot/opensbi/unstable
|
mkdir -p %{buildroot}/boot/opensbi/unstable
|
||||||
cp build/platform/qemu/virt/firmware/fw_jump.elf \
|
cp build/platform/qemu/virt/firmware/fw_jump.elf \
|
||||||
|
Loading…
Reference in New Issue
Block a user