diskimage-builder/elements/fedora-minimal/install.d/99-ramdisk

18 lines
402 B
Plaintext
Raw Normal View History

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
initrd=$(find /boot -name initrd)
kernel_version=$(rpm -qa | grep kernel | sort | head -n 1 | cut -d '-' -f 2,3)
if [ -n "$initrd" -a $(echo "$initrd" | wc -l) -eq 1 ]; then
cp $initrd /boot/initrd-$kernel_version.img
else
echo "Zero or multiple initrds found. This should not happen."
exit 1
fi