Skip to content

Commit

Permalink
chore: Notify of more than 1 qualified kernel before initramfs image …
Browse files Browse the repository at this point in the history
…variable
  • Loading branch information
fiftydinar authored Dec 15, 2024
1 parent 8281891 commit 3024ac6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/initramfs/initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fi

KERNEL_MODULES_PATH="/usr/lib/modules"
readarray -t QUALIFIED_KERNEL < <(find "${KERNEL_MODULES_PATH}" -mindepth 1 -maxdepth 1 -type d -printf "%f\n")
INITRAMFS_IMAGE="${KERNEL_MODULES_PATH}/${QUALIFIED_KERNEL[*]}/initramfs.img"

if [[ "${#QUALIFIED_KERNEL[@]}" -gt 1 ]]; then
echo "ERROR: There are several versions of kernel's initramfs."
Expand All @@ -37,6 +36,8 @@ if [[ "${#QUALIFIED_KERNEL[@]}" -gt 1 ]]; then
exit 1
fi

INITRAMFS_IMAGE="${KERNEL_MODULES_PATH}/${QUALIFIED_KERNEL[*]}/initramfs.img"

echo "Starting initramfs regeneration for kernel version: ${QUALIFIED_KERNEL[*]}"

"${DRACUT}" --no-hostonly --kver "${QUALIFIED_KERNEL[*]}" --reproducible -v --add ostree -f "${INITRAMFS_IMAGE}"
Expand Down

0 comments on commit 3024ac6

Please sign in to comment.