mirror of
https://github.com/systemd/systemd
synced 2026-03-26 08:44:55 +01:00
Compare commits
2 Commits
ac752f1eff
...
ca1d2ae5d6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca1d2ae5d6 | ||
|
|
a40f4ba1a8 |
@ -2443,12 +2443,6 @@ static EFI_STATUS initrd_prepare(
|
|||||||
size_t size = 0, padded_size = 0;
|
size_t size = 0, padded_size = 0;
|
||||||
|
|
||||||
STRV_FOREACH(i, entry->initrd) {
|
STRV_FOREACH(i, entry->initrd) {
|
||||||
_cleanup_free_ char16_t *o = options;
|
|
||||||
if (o)
|
|
||||||
options = xasprintf("%ls initrd=%ls", o, *i);
|
|
||||||
else
|
|
||||||
options = xasprintf("initrd=%ls", *i);
|
|
||||||
|
|
||||||
_cleanup_file_close_ EFI_FILE *handle = NULL;
|
_cleanup_file_close_ EFI_FILE *handle = NULL;
|
||||||
err = root->Open(root, &handle, *i, EFI_FILE_MODE_READ, 0);
|
err = root->Open(root, &handle, *i, EFI_FILE_MODE_READ, 0);
|
||||||
if (err != EFI_SUCCESS)
|
if (err != EFI_SUCCESS)
|
||||||
@ -2459,6 +2453,15 @@ static EFI_STATUS initrd_prepare(
|
|||||||
if (err != EFI_SUCCESS)
|
if (err != EFI_SUCCESS)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
if (info->FileSize == 0) /* Automatically skip over empty files */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_cleanup_free_ char16_t *o = options;
|
||||||
|
if (o)
|
||||||
|
options = xasprintf("%ls initrd=%ls", o, *i);
|
||||||
|
else
|
||||||
|
options = xasprintf("initrd=%ls", *i);
|
||||||
|
|
||||||
size_t inc = info->FileSize;
|
size_t inc = info->FileSize;
|
||||||
|
|
||||||
if (!INC_SAFE(&padded_size, ALIGN4(inc)))
|
if (!INC_SAFE(&padded_size, ALIGN4(inc)))
|
||||||
@ -2466,6 +2469,14 @@ static EFI_STATUS initrd_prepare(
|
|||||||
assert_se(INC_SAFE(&size, *(i + 1) ? ALIGN4(inc) : inc));
|
assert_se(INC_SAFE(&size, *(i + 1) ? ALIGN4(inc) : inc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Skip if no valid initrd files */
|
||||||
|
if (padded_size == 0) {
|
||||||
|
*ret_options = NULL;
|
||||||
|
*ret_initrd_pages = (Pages) {};
|
||||||
|
*ret_initrd_size = 0;
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
_cleanup_pages_ Pages pages = xmalloc_initrd_pages(padded_size);
|
_cleanup_pages_ Pages pages = xmalloc_initrd_pages(padded_size);
|
||||||
uint8_t *p = PHYSICAL_ADDRESS_TO_POINTER(pages.addr);
|
uint8_t *p = PHYSICAL_ADDRESS_TO_POINTER(pages.addr);
|
||||||
|
|
||||||
|
|||||||
@ -641,6 +641,7 @@ static void manager_set_defaults(Manager *m) {
|
|||||||
m->cache_from_localhost = false;
|
m->cache_from_localhost = false;
|
||||||
m->stale_retention_usec = 0;
|
m->stale_retention_usec = 0;
|
||||||
m->refuse_record_types = set_free(m->refuse_record_types);
|
m->refuse_record_types = set_free(m->refuse_record_types);
|
||||||
|
m->resolv_conf_stat = (struct stat) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
static int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
|
static int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user