[systemd-commits] 2 commits - src/boot

Kay Sievers kay at kemper.freedesktop.org
Sun Mar 1 04:19:02 PST 2015


 src/boot/efi/boot.c |   65 ++--------------------------------------------------
 1 file changed, 3 insertions(+), 62 deletions(-)

New commits:
commit 9d3dec15ae8ac6153038c9b994e6c4fc22045180
Author: Kay Sievers <kay at vrfy.org>
Date:   Sat Feb 28 12:21:25 2015 +0100

    boot: efi - ignore .conf snippets starting with "auto-"

diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 1f2b6a7..3f8140e 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1171,11 +1171,14 @@ static VOID config_load(Config *config, EFI_HANDLE *device, EFI_FILE *root_dir,
                                 continue;
                         if (f->Attribute & EFI_FILE_DIRECTORY)
                                 continue;
+
                         len = StrLen(f->FileName);
                         if (len < 6)
                                 continue;
                         if (StriCmp(f->FileName + len - 5, L".conf") != 0)
                                 continue;
+                        if (StrnCmp(f->FileName, L"auto-", 5) == 0)
+                                continue;
 
                         len = file_read(entries_dir, f->FileName, 0, 0, &content);
                         if (len > 0)

commit ea1851b60c6023b62da61ea6dd15db5754d6388c
Author: Kay Sievers <kay at vrfy.org>
Date:   Sat Feb 28 12:15:48 2015 +0100

    boot: efi - remove a couple of Loader* variables

diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index b6ecfa4..1f2b6a7 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -66,7 +66,6 @@ typedef struct {
         CHAR16 *entry_default_pattern;
         CHAR16 *entry_oneshot;
         CHAR16 *options_edit;
-        CHAR16 *entries_auto;
 } Config;
 
 static VOID cursor_left(UINTN *cursor, UINTN *first)
@@ -409,10 +408,6 @@ static VOID print_status(Config *config, CHAR16 *loaded_image_path) {
                 Print(L"LoaderConfigTimeout:    %d\n", i);
         if (config->entry_oneshot)
                 Print(L"LoaderEntryOneShot:     %s\n", config->entry_oneshot);
-        if (efivar_get(L"LoaderDeviceIdentifier", &s) == EFI_SUCCESS) {
-                Print(L"LoaderDeviceIdentifier: %s\n", s);
-                FreePool(s);
-        }
         if (efivar_get(L"LoaderDevicePartUUID", &s) == EFI_SUCCESS) {
                 Print(L"LoaderDevicePartUUID:   %s\n", s);
                 FreePool(s);
@@ -1126,46 +1121,6 @@ static VOID config_entry_add_from_file(Config *config, EFI_HANDLE *device, CHAR1
         }
         FreePool(initrd);
 
-        if (entry->machine_id) {
-                CHAR16 *var;
-
-                /* append additional options from EFI variables for this machine-id */
-                var = PoolPrint(L"LoaderEntryOptions-%s", entry->machine_id);
-                if (var) {
-                        CHAR16 *s;
-
-                        if (efivar_get(var, &s) == EFI_SUCCESS) {
-                                if (entry->options) {
-                                        CHAR16 *s2;
-
-                                        s2 = PoolPrint(L"%s %s", entry->options, s);
-                                        FreePool(entry->options);
-                                        entry->options = s2;
-                                } else
-                                        entry->options = s;
-                        }
-                        FreePool(var);
-                }
-
-                var = PoolPrint(L"LoaderEntryOptionsOneShot-%s", entry->machine_id);
-                if (var) {
-                        CHAR16 *s;
-
-                        if (efivar_get(var, &s) == EFI_SUCCESS) {
-                                if (entry->options) {
-                                        CHAR16 *s2;
-
-                                        s2 = PoolPrint(L"%s %s", entry->options, s);
-                                        FreePool(entry->options);
-                                        entry->options = s2;
-                                } else
-                                        entry->options = s;
-                                efivar_set(var, NULL, TRUE);
-                        }
-                        FreePool(var);
-                }
-        }
-
         entry->device = device;
         entry->file = StrDuplicate(file);
         len = StrLen(entry->file);
@@ -1497,16 +1452,6 @@ static BOOLEAN config_entry_add_loader_auto(Config *config, EFI_HANDLE *device,
         /* do not boot right away into auto-detected entries */
         entry->no_autoselect = TRUE;
 
-        /* export identifiers of automatically added entries */
-        if (config->entries_auto) {
-                CHAR16 *s;
-
-                s = PoolPrint(L"%s %s", config->entries_auto, file);
-                FreePool(config->entries_auto);
-                config->entries_auto = s;
-        } else
-                config->entries_auto = StrDuplicate(file);
-
         return TRUE;
 }
 
@@ -1708,7 +1653,6 @@ static VOID config_free(Config *config) {
         FreePool(config->entry_default_pattern);
         FreePool(config->options_edit);
         FreePool(config->entry_oneshot);
-        FreePool(config->entries_auto);
 }
 
 EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
@@ -1746,13 +1690,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
         /* export the device path this image is started from */
         device_path = DevicePathFromHandle(loaded_image->DeviceHandle);
         if (device_path) {
-                CHAR16 *str;
                 EFI_DEVICE_PATH *path, *paths;
 
-                str = DevicePathToStr(device_path);
-                efivar_set(L"LoaderDeviceIdentifier", str, FALSE);
-                FreePool(str);
-
                 paths = UnpackDevicePath(device_path);
                 for (path = paths; !IsDevicePathEnd(path); path = NextDevicePathNode(path)) {
                         HARDDRIVE_DEVICE_PATH *drive;
@@ -1798,7 +1737,6 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
         config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
                                      L"auto-efi-default", '\0', L"EFI Default Loader", L"\\EFI\\Boot\\boot" EFI_MACHINE_TYPE_NAME ".efi");
         config_entry_add_osx(&config);
-        efivar_set(L"LoaderEntriesAuto", config.entries_auto, FALSE);
 
         if (efivar_get_raw(&global_guid, L"OsIndicationsSupported", &b, &size) == EFI_SUCCESS) {
                 UINT64 osind = (UINT64)*b;



More information about the systemd-commits mailing list