mkimage-profiles/features.in/build-vm/image-scripts.d/17-kernel
2020-05-01 23:49:57 +07:00

33 lines
937 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
[ -n "$GLOBAL_KFLAVOURS" ] ||
{ echo "** KFLAVOURS is empty" >&2; exit 0; }
kver=
echo $GLOBAL_KFLAVOURS
for KFLAVOUR in $GLOBAL_KFLAVOURS; do
kver+=" $(rpm -qa 'kernel-image*' \
--qf '%{version}-%{name}-%{release}\n' \
| grep "$KFLAVOUR" \
| sed 's/kernel-image-//')"
done
[ ! -z "${kver#"${kver%%[! ]*}"}" ] ||
{ echo "** unable to deduce kernel version" >&2; exit 1; }
cd /boot
for KVER in $kver; do
make-initrd -N -k "$KVER" AUTODETECT= \
FEATURES+="$GLOBAL_VM_INITRDFEATURES" \
MODULES_TRY_ADD+="$GLOBAL_VM_INITRDMODULES" \
|| { echo "** Error: make-initrd failed" >&2; exit 1; }
done
# 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
: