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
|
|
|
|
|
2024-09-27 15:04:13 +03:00
|
|
|
# Only run if the initrd generator is booster
|
2024-09-27 14:57:54 +03:00
|
|
|
[ "${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
|
|
|
|
|
2024-09-27 15:23:23 +03:00
|
|
|
booster "$([ "${KERNEL_INSTALL_VERBOSE}" = 1 ] && echo --verbose)" build --force --kernel-version="${KERNEL_VERSION}" "${KERNEL_INSTALL_STAGING_AREA}/initrd" || exit 1
|