]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
EFI stub: add StubInfo if non-existant
authorДамјан Георгиевски <gdamjan@gmail.com>
Mon, 15 Jan 2018 17:08:11 +0000 (18:08 +0100)
committerДамјан Георгиевски <gdamjan@gmail.com>
Mon, 15 Jan 2018 17:08:11 +0000 (18:08 +0100)
currently if a stub image is directly booted, bootctl reports:
```
Current Loader:
      Product: n/a
          ESP: /dev/disk/by-partuuid/b0a0807d-0592-40e9-adac-3bb724e9e305
         File: └─/EFI/Secure/secure-boot-4.14.8+.efi
```

Let's add a StubInfo which will be displayed by bootctl too (in a later
patch).

src/boot/efi/stub.c

index cf525790864f0e4a64e664070c20fe485a5e2b95..ff45cebd456931ea3cd5d270088d0266a06ddcb6 100644 (file)
@@ -124,6 +124,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
                 FreePool(loader_firmware_type);
         }
 
+        /* add StubInfo */
+        if (efivar_get_raw(&global_guid, L"StubInfo", &b, &size) != EFI_SUCCESS)
+                efivar_set(L"StubInfo", L"systemd-stub " PACKAGE_VERSION, FALSE);
 
         if (szs[3] > 0)
                 graphics_splash((UINT8 *)((UINTN)loaded_image->ImageBase + addrs[3]), szs[3], NULL);