summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/systemd.net-naming-scheme.xml2
-rw-r--r--src/boot/efi/boot.c13
-rw-r--r--src/shared/install.c5
3 files changed, 18 insertions, 2 deletions
diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml
index 91ad57df03..419fed62ea 100644
--- a/man/systemd.net-naming-scheme.xml
+++ b/man/systemd.net-naming-scheme.xml
@@ -42,7 +42,7 @@
<citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Available naming schemes are described below.</para>
- <para>After the udev proprties have been generated, appropriate udev rules may be used to actually rename
+ <para>After the udev properties have been generated, appropriate udev rules may be used to actually rename
devices based on those properties. See the description of <varname>NamePolicy=</varname> and
<varname>MACAddressPolicy=</varname> in
<citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index fb7abd1f38..849c3c63b6 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1300,6 +1300,7 @@ static VOID config_entry_bump_counters(
static VOID config_entry_add_from_file(
Config *config,
EFI_HANDLE *device,
+ EFI_FILE *root_dir,
CHAR16 *path,
CHAR16 *file,
CHAR8 *content,
@@ -1310,6 +1311,8 @@ static VOID config_entry_add_from_file(
UINTN pos = 0;
CHAR8 *key, *value;
UINTN len;
+ EFI_STATUS err;
+ EFI_FILE_HANDLE handle;
_cleanup_freepool_ CHAR16 *initrd = NULL;
entry = AllocatePool(sizeof(ConfigEntry));
@@ -1406,6 +1409,14 @@ static VOID config_entry_add_from_file(
return;
}
+ /* check existence */
+ err = uefi_call_wrapper(root_dir->Open, 5, root_dir, &handle, entry->loader, EFI_FILE_MODE_READ, 0ULL);
+ if (EFI_ERROR(err)) {
+ config_entry_free(entry);
+ return;
+ }
+ uefi_call_wrapper(handle->Close, 1, handle);
+
/* add initrd= to options */
if (entry->type == LOADER_LINUX && initrd) {
if (entry->options) {
@@ -1503,7 +1514,7 @@ static VOID config_load_entries(
err = file_read(entries_dir, f->FileName, 0, 0, &content, NULL);
if (!EFI_ERROR(err))
- config_entry_add_from_file(config, device, L"\\loader\\entries", f->FileName, content, loaded_image_path);
+ config_entry_add_from_file(config, device, root_dir, L"\\loader\\entries", f->FileName, content, loaded_image_path);
}
uefi_call_wrapper(entries_dir->Close, 1, entries_dir);
}
diff --git a/src/shared/install.c b/src/shared/install.c
index c38daee231..14dfd331d5 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1188,6 +1188,11 @@ static int config_parse_default_instance(
if (r < 0)
return r;
+ if (isempty(printed)) {
+ i->default_instance = mfree(i->default_instance);
+ return 0;
+ }
+
if (!unit_instance_is_valid(printed))
return -EINVAL;