mkimage-profiles/features.in/build-vm/image-scripts.d/07-kernel
Anton Midyukov 0fe6b1ee7d build-vm: 07-kernel: all initrd modules are optional
The problem at hand is that different kernels can have
varying module sets, and it makes sense to put four of
those at once sometimes; so avoid silly build breakage.
2019-09-16 21:21:39 +03:00

26 lines
818 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
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
: