CHAR16 *file;
CHAR16 *title_show;
CHAR16 *title;
- CHAR16 *title_version;
- CHAR16 *title_machine;
+ CHAR16 *version;
+ CHAR16 *machine_id;
EFI_HANDLE *device;
enum loader_type type;
CHAR16 *loader;
Print(L"LoaderEntryDefault: %s\n", s);
FreePool(s);
}
+
Print(L"\n--- press key ---\n\n");
uefi_call_wrapper(BS->WaitForEvent, 3, 1, &ST->ConIn->WaitForKey, &index);
uefi_call_wrapper(ST->ConIn->Reset, 2, ST->ConIn, FALSE);
for (i = 0; i < config->entry_count; i++) {
ConfigEntry *entry;
EFI_DEVICE_PATH *device_path;
+ CHAR16 *str;
entry = config->entries[i];
Print(L"config entry: %d/%d\n", i+1, config->entry_count);
Print(L"title show '%s'\n", entry->title_show);
if (entry->title)
Print(L"title '%s'\n", entry->title);
- if (entry->title_version)
- Print(L"title version '%s'\n", entry->title_version);
- if (entry->title_machine)
- Print(L"title machine '%s'\n", entry->title_machine);
+ if (entry->version)
+ Print(L"version '%s'\n", entry->version);
+ if (entry->machine_id)
+ Print(L"machine-id '%s'\n", entry->machine_id);
device_path = DevicePathFromHandle(entry->device);
if (device_path) {
- UINT16 *str;
-
str = DevicePathToStr(device_path);
Print(L"device handle '%s'\n", DevicePathToStr(device_path));
FreePool(str);
static VOID config_entry_free(ConfigEntry *entry) {
FreePool(entry->title_show);
FreePool(entry->title);
- FreePool(entry->title_machine);
+ FreePool(entry->machine_id);
FreePool(entry->loader);
FreePool(entry->options);
}
CHAR8 *key, *value;
UINTN len;
CHAR16 *initrd = NULL;
+ CHAR16 *str;
entry = AllocateZeroPool(sizeof(ConfigEntry));
continue;
}
- if (strcmpa((CHAR8 *)"title-version", key) == 0) {
- FreePool(entry->title_version);
- entry->title_version = stra_to_str(value);
+ if (strcmpa((CHAR8 *)"version", key) == 0) {
+ FreePool(entry->version);
+ entry->version = stra_to_str(value);
continue;
}
- if (strcmpa((CHAR8 *)"title-machine", key) == 0) {
- FreePool(entry->title_machine);
- entry->title_machine = stra_to_str(value);
+ if (strcmpa((CHAR8 *)"machine-id", key) == 0) {
+ FreePool(entry->machine_id);
+ entry->machine_id = stra_to_str(value);
continue;
}
if (!config->entries[i]->non_unique)
continue;
- if (!config->entries[i]->title_version)
+ if (!config->entries[i]->version)
continue;
- s = PoolPrint(L"%s (%s)", config->entries[i]->title_show, config->entries[i]->title_version);
+ s = PoolPrint(L"%s (%s)", config->entries[i]->title_show, config->entries[i]->version);
FreePool(config->entries[i]->title_show);
config->entries[i]->title_show = s;
config->entries[i]->non_unique = FALSE;
/* add machine-id to non-unique titles */
for (i = 0; i < config->entry_count; i++) {
CHAR16 *s;
+ CHAR16 *m;
if (!config->entries[i]->non_unique)
continue;
- if (!config->entries[i]->title_machine)
+ if (!config->entries[i]->machine_id)
continue;
- s = PoolPrint(L"%s (%s)", config->entries[i]->title_show, config->entries[i]->title_machine);
+ m = StrDuplicate(config->entries[i]->machine_id);
+ m[8] = '\0';
+ s = PoolPrint(L"%s (%s)", config->entries[i]->title_show, m);
FreePool(config->entries[i]->title_show);
config->entries[i]->title_show = s;
config->entries[i]->non_unique = FALSE;
+ FreePool(m);
}
unique = TRUE;
InitializeLib(image, sys_table);
efivar_set(L"LoaderVersion", L"gummiboot " stringify(VERSION), FALSE);
efivar_set_ticks(L"LoaderTicksInit", ticks);
-
err = uefi_call_wrapper(BS->OpenProtocol, 6, image, &LoadedImageProtocol, &loaded_image,
image, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(err)) {
#!/bin/bash
-# This is a script to be called automatically by new-kernel-pkg as
-# /etc/kernel/postinst.d/loader-postinst.sh
+# This script is called automatically by new-kernel-pkg as
+# /etc/kernel/postinst.d/loader-postinst.sh (Fedora)
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
[[ $INITRD_IMAGE ]] && cp --preserve "$INITRD_IMAGE" "${EFI_DIR}/${ID}/${MACHINE_ID}/"
{
- echo "title $PRETTY_NAME"
- echo "title-version $KERNEL_VERSION"
- echo "title-machine ${MACHINE_ID:0:8}"
- echo "options $BOOT_OPTIONS"
- echo "linux /$ID/$MACHINE_ID/${KERNEL_IMAGE##*/}"
- [[ $INITRD_IMAGE ]] && echo "initrd /${ID}/${MACHINE_ID}/${INITRD_IMAGE##*/}"
+ echo "title $PRETTY_NAME"
+ echo "version $KERNEL_VERSION"
+ echo "machine-id $MACHINE_ID"
+ echo "options $BOOT_OPTIONS"
+ echo "linux /$ID/$MACHINE_ID/${KERNEL_IMAGE##*/}"
+ [[ $INITRD_IMAGE ]] && echo "initrd /${ID}/${MACHINE_ID}/${INITRD_IMAGE##*/}"
} > "${EFI_DIR}/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf"
if ! [[ -f ${EFI_DIR}/loader/loader.conf ]]; then