From: Luca Boccassi Date: Fri, 6 Dec 2024 23:46:12 +0000 (+0000) Subject: kernel-install: install addons in 90-uki-copy.install if they are present X-Git-Tag: v258-rc1~1443 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=75ee025c5de5d753dc1d8a28f8780247f5a887ae;p=thirdparty%2Fsystemd.git kernel-install: install addons in 90-uki-copy.install if they are present mkosi now has a kernel-install plugin to build addons, mkosi-addon. If there are addons in .extra.d/ install them too to the ESP. --- diff --git a/src/kernel-install/90-uki-copy.install b/src/kernel-install/90-uki-copy.install index 04bf5d1752f..e34c8dcdcf7 100755 --- a/src/kernel-install/90-uki-copy.install +++ b/src/kernel-install/90-uki-copy.install @@ -73,6 +73,8 @@ else UKI_FILE="$UKI_DIR/$ENTRY_TOKEN-$KERNEL_VERSION.efi" fi +ADDON_DIR="$UKI_DIR/$ENTRY_TOKEN-$KERNEL_VERSION.efi.extra.d" + # If there is a UKI named uki.efi on the staging area use that, if not use what # was passed in as $KERNEL_IMAGE but insist it has a .efi extension if [ -f "$KERNEL_INSTALL_STAGING_AREA/uki.efi" ]; then @@ -81,6 +83,14 @@ if [ -f "$KERNEL_INSTALL_STAGING_AREA/uki.efi" ]; then echo "Error: could not copy '$KERNEL_INSTALL_STAGING_AREA/uki.efi' to '$UKI_FILE'." >&2 exit 1 } + for f in "$KERNEL_INSTALL_STAGING_AREA/uki.efi.extra.d"/*; do + [ -f "$f" ] || continue + [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $f as $ADDON_DIR/$(basename "$f")" + install -D -m 0644 "$f" "$ADDON_DIR/$(basename "$f")" || { + echo "Error: could not copy '$f' to '$ADDON_DIR/$(basename "$f")'." >&2 + exit 1 + } + done elif [ -n "$KERNEL_IMAGE" ]; then [ -f "$KERNEL_IMAGE" ] || { echo "Error: UKI '$KERNEL_IMAGE' not a file." >&2 @@ -95,6 +105,14 @@ elif [ -n "$KERNEL_IMAGE" ]; then echo "Error: could not copy '$KERNEL_IMAGE' to '$UKI_FILE'." >&2 exit 1 } + for f in "$KERNEL_IMAGE.extra.d"/* "$KERNEL_INSTALL_STAGING_AREA/uki.efi.extra.d"/*; do + [ -f "$f" ] || continue + [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $f as $ADDON_DIR/$(basename "$f")" + install -D -m 0644 "$f" "$ADDON_DIR/$(basename "$f")" || { + echo "Error: could not copy '$f' to '$ADDON_DIR/$(basename "$f")'." >&2 + exit 1 + } + done else [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "No UKI available. Nothing to do." exit 0