]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #26119 from kraxel/uki.install
authorLuca Boccassi <bluca@debian.org>
Wed, 8 Mar 2023 21:25:25 +0000 (21:25 +0000)
committerGitHub <noreply@github.com>
Wed, 8 Mar 2023 21:25:25 +0000 (21:25 +0000)
kernel-install: improve uki handling

1  2 
src/kernel-install/kernel-install.in

index c722dc0f77ea57dafa973081c15432916d03456f,25884fc0e234b8321782dd3686a2dfb0aa79d5f8..2c59648afc144352f037ba7c753ae4ce275f1460
  
  if [ -z "$ENTRY_TOKEN" ]; then
      ENTRY_TOKEN="$MACHINE_ID"
 -    [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
 -        echo "No entry-token candidate matched, using \"$ENTRY_TOKEN\" from machine-id"
 +    log_verbose "No entry-token candidate matched, using \"$ENTRY_TOKEN\" from machine-id"
  fi
  
- if [ -z "$layout" ]; then
+ export KERNEL_INSTALL_IMAGE_TYPE=""
+ if [ -f "$1" ]; then
+     KERNEL_INSTALL_IMAGE_TYPE="$(bootctl kernel-identify "$1" 2>/dev/null || echo "unknown")"
+ fi
+ if [ "$layout" = "auto" ] || [ -z "$layout" ]; then
      # No layout configured by the administrator. Let's try to figure it out
      # automatically from metadata already contained in $BOOT_ROOT.
-     if [ -e "$BOOT_ROOT/loader/entries.srel" ]; then
+     if [ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]; then
+         layout="uki"
+         log_verbose "Kernel image is UKI, using layout=$layout"
+     elif [ -e "$BOOT_ROOT/loader/entries.srel" ]; then
          read -r ENTRIES_SREL <"$BOOT_ROOT/loader/entries.srel"
          if [ "$ENTRIES_SREL" = "type1" ]; then
              # The loader/entries.srel file clearly indicates that the installed