mkimage-profiles/features.in/build-vm/image-scripts.d/07-kernel
Michael Shigorin 650e92bf7f build-vm, tar2fs: handle multiple kernels either
This was crucial for e2k rescue image supporting
multiple CPU versions but can be useful elsewhere.
2018-05-21 22:50:00 +03:00

20 lines
635 B
Bash
Executable File

#!/bin/sh
# predictable file locations make bootloader configuration simple;
# this script relates to features.in/stage2/stage1/scripts.d/81-make-initfs
kver="$(rpm -qa 'kernel-image*' \
--qf '%{installtime} %{version}-%{name}-%{release}\n' \
| sort -n \
| cut -f 2 -d ' ' \
| sed 's/kernel-image-//')"
[ -n "$kver" ] || { echo "** unable to deduce kernel version" >&2; exit 1; }
cd /boot
echo "$kver" > .origver # for tar2fs
# NB: e2k kernel builds "image" instead of "vmlinuz"
[ -f vmlinuz-$kver ] && ln -s vmlinuz-$kver vmlinuz ||:
ln -s initrd-$kver.img initrd.img # missing at this stage
: