gentoo-overlay/sys-kernel/booster/files/kernel-install-52-booster.i...

16 lines
574 B
Plaintext
Raw Normal View History

2024-09-27 14:57:54 +03:00
#!/bin/sh
COMMAND="${1:?}"
KERNEL_VERSION="${2:?}"
# Do not attempt to create initramfs if the supplied image is already a UKI
[ "${KERNEL_INSTALL_IMAGE_TYPE}" = "uki" ] && exit 0
# Only run if the initrd generator is ugrd
[ "${KERNEL_INSTALL_INITRD_GENERATOR}" = "booster" ] || exit 0
# only run when the COMMAND is add, and fewer than 5 arguments are passed
[ "${COMMAND}" = "add" ] && [ "${#}" -lt 5 ] || exit 0
booster "$([ "${KERNEL_INSTALL_VERBOSE}" = 1 ] && echo --verbose)" --kernel-version="${KERNEL_VERSION}" "${KERNEL_INSTALL_STAGING_AREA}/initrd" || exit 1