build-vm, tar2fs: handle multiple kernels either

This was crucial for e2k rescue image supporting
multiple CPU versions but can be useful elsewhere.
This commit is contained in:
Michael Shigorin 2018-04-10 14:01:46 +03:00
parent 4743947ea5
commit 650e92bf7f
2 changed files with 5 additions and 4 deletions

View File

@ -227,10 +227,12 @@ esac
# NB: don't stick BOOTFS here, it has slightly different semantics
pushd $ROOTFS/boot
if [ -s .origver ]; then
read KVER < .origver
while read kver; do
chroot "$ROOTFS" make-initrd -k "$kver"
done < .origver
else
fatal "unable to deduce kernel version"
fi
[ -n "$KVER" ] || fatal "unable to deduce kernel version"
chroot "$ROOTFS" make-initrd -k "$KVER"
rm -f .origver
# ...target device too

View File

@ -5,7 +5,6 @@
kver="$(rpm -qa 'kernel-image*' \
--qf '%{installtime} %{version}-%{name}-%{release}\n' \
| sort -n \
| tail -n 1 \
| cut -f 2 -d ' ' \
| sed 's/kernel-image-//')"