mirror of
https://github.com/systemd/systemd
synced 2026-03-17 18:44:46 +01:00
Compare commits
6 Commits
f7047b8c1c
...
311fddcd8d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
311fddcd8d | ||
|
|
1d69e36c44 | ||
|
|
1ef107cb22 | ||
|
|
80ab99d4d2 | ||
|
|
af88aa17c7 | ||
|
|
2102511f4a |
@ -813,6 +813,8 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPEliteBook*:*
|
||||
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPElite*x360*:*
|
||||
# HP Elite Dragonfly
|
||||
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPEliteDragonfly*:*
|
||||
# HP EliteBoard
|
||||
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPEliteBoard*:*
|
||||
# HP ProBook 440 G2
|
||||
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP440G2:*
|
||||
# HP ProBook
|
||||
|
||||
@ -588,11 +588,12 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>RestartSteps=</varname></term>
|
||||
<listitem><para>Configures the number of steps to take to increase the interval
|
||||
<listitem><para>Configures the number of exponential steps to take to increase the interval
|
||||
of auto-restarts from <varname>RestartSec=</varname> to <varname>RestartMaxDelaySec=</varname>.
|
||||
Takes a positive integer or 0 to disable it. Defaults to 0.</para>
|
||||
|
||||
<para>This setting is effective only if <varname>RestartMaxDelaySec=</varname> is also set.</para>
|
||||
<para>This setting is effective only if <varname>RestartMaxDelaySec=</varname> is also set and
|
||||
<varname>RestartSec=</varname> is not zero.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v254"/></listitem>
|
||||
</varlistentry>
|
||||
@ -604,7 +605,8 @@
|
||||
in the same format as <varname>RestartSec=</varname>, or <literal>infinity</literal>
|
||||
to disable the setting. Defaults to <literal>infinity</literal>.</para>
|
||||
|
||||
<para>This setting is effective only if <varname>RestartSteps=</varname> is also set.</para>
|
||||
<para>This setting is effective only if <varname>RestartSteps=</varname> is also set and
|
||||
<varname>RestartSec=</varname> is not zero.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v254"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include "export-vars.h"
|
||||
#include "graphics.h"
|
||||
#include "initrd.h"
|
||||
#include "iovec-util-fundamental.h"
|
||||
#include "line-edit.h"
|
||||
#include "measure.h"
|
||||
#include "memory-util-fundamental.h"
|
||||
@ -2690,7 +2691,7 @@ static EFI_STATUS call_image_start(
|
||||
return log_error_status(err, "Error loading %ls: %m", entry->devicetree);
|
||||
}
|
||||
|
||||
err = initrd_register(PHYSICAL_ADDRESS_TO_POINTER(initrd_pages.addr), initrd_size, &initrd_handle);
|
||||
err = initrd_register(&IOVEC_MAKE(PHYSICAL_ADDRESS_TO_POINTER(initrd_pages.addr), initrd_size), &initrd_handle);
|
||||
if (err != EFI_SUCCESS)
|
||||
return log_error_status(err, "Error registering initrd: %m");
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "initrd.h"
|
||||
#include "iovec-util-fundamental.h"
|
||||
#include "proto/device-path.h"
|
||||
#include "proto/load-file.h"
|
||||
#include "util.h"
|
||||
@ -11,8 +12,7 @@
|
||||
/* extend LoadFileProtocol */
|
||||
struct initrd_loader {
|
||||
EFI_LOAD_FILE_PROTOCOL load_file;
|
||||
const void *address;
|
||||
size_t length;
|
||||
struct iovec data;
|
||||
};
|
||||
|
||||
/* static structure for LINUX_INITRD_MEDIA device path
|
||||
@ -52,23 +52,21 @@ static EFIAPI EFI_STATUS initrd_load_file(
|
||||
return EFI_UNSUPPORTED;
|
||||
|
||||
loader = (struct initrd_loader *) this;
|
||||
|
||||
if (loader->length == 0 || !loader->address)
|
||||
if (!iovec_is_set(&loader->data))
|
||||
return EFI_NOT_FOUND;
|
||||
|
||||
if (!buffer || *buffer_size < loader->length) {
|
||||
*buffer_size = loader->length;
|
||||
if (!buffer || *buffer_size < loader->data.iov_len) {
|
||||
*buffer_size = loader->data.iov_len;
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
memcpy(buffer, loader->address, loader->length);
|
||||
*buffer_size = loader->length;
|
||||
memcpy(buffer, loader->data.iov_base, loader->data.iov_len);
|
||||
*buffer_size = loader->data.iov_len;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS initrd_register(
|
||||
const void *initrd_address,
|
||||
size_t initrd_length,
|
||||
const struct iovec *initrd,
|
||||
EFI_HANDLE *ret_initrd_handle) {
|
||||
|
||||
EFI_STATUS err;
|
||||
@ -78,7 +76,10 @@ EFI_STATUS initrd_register(
|
||||
|
||||
assert(ret_initrd_handle);
|
||||
|
||||
if (!initrd_address || initrd_length == 0)
|
||||
/* If no initrd is specified we'll not install any. This avoids registration of the protocol for that
|
||||
* case, leaving it open for something else. */
|
||||
|
||||
if (!iovec_is_set(initrd))
|
||||
return EFI_SUCCESS;
|
||||
|
||||
/* check if a LINUX_INITRD_MEDIA_GUID DevicePath is already registered.
|
||||
@ -92,8 +93,7 @@ EFI_STATUS initrd_register(
|
||||
loader = xnew(struct initrd_loader, 1);
|
||||
*loader = (struct initrd_loader) {
|
||||
.load_file.LoadFile = initrd_load_file,
|
||||
.address = initrd_address,
|
||||
.length = initrd_length
|
||||
.data = *initrd,
|
||||
};
|
||||
|
||||
/* create a new handle and register the LoadFile2 protocol with the InitrdMediaPath on it */
|
||||
|
||||
@ -4,8 +4,7 @@
|
||||
#include "efi.h"
|
||||
|
||||
EFI_STATUS initrd_register(
|
||||
const void *initrd_address,
|
||||
size_t initrd_length,
|
||||
const struct iovec *initrd,
|
||||
EFI_HANDLE *ret_initrd_handle);
|
||||
|
||||
EFI_STATUS initrd_unregister(EFI_HANDLE initrd_handle);
|
||||
|
||||
@ -96,7 +96,7 @@ static EFI_STATUS load_via_boot_services(
|
||||
}
|
||||
|
||||
_cleanup_(cleanup_initrd) EFI_HANDLE initrd_handle = NULL;
|
||||
err = initrd_register(initrd->iov_base, initrd->iov_len, &initrd_handle);
|
||||
err = initrd_register(initrd, &initrd_handle);
|
||||
if (err != EFI_SUCCESS)
|
||||
return log_error_status(err, "Error registering initrd: %m");
|
||||
|
||||
@ -315,7 +315,7 @@ EFI_STATUS linux_exec(
|
||||
}
|
||||
|
||||
_cleanup_(cleanup_initrd) EFI_HANDLE initrd_handle = NULL;
|
||||
err = initrd_register(initrd->iov_base, initrd->iov_len, &initrd_handle);
|
||||
err = initrd_register(initrd, &initrd_handle);
|
||||
if (err != EFI_SUCCESS)
|
||||
return log_error_status(err, "Error registering initrd: %m");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user