1
0
mirror of https://github.com/systemd/systemd synced 2026-03-17 18:44:46 +01:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
311fddcd8d
man/systemd.service: Expand docs on RestartSteps (#40309) 2026-01-15 11:41:17 +01:00
Mike Yuan
1d69e36c44
boot/initrd: fix typo
Follow-up for 80ab99d4d200c29727b573df6bccc49cc9dca6a4
2026-01-15 11:36:13 +01:00
Dirk Su
1ef107cb22 hwdb: add HP EliteBoard Mic mute key mapping 2026-01-15 11:34:14 +01:00
Lennart Poettering
80ab99d4d2 efi: use 'struct iovec' more, pass initrds down with it 2026-01-15 11:32:33 +01:00
Matthijs Kooijman
af88aa17c7 man/systemd.service: Note RestartSteps only works with RestartSec= set
Setting Restart=0 seems reasonable to have no delay on the first
restart, if you do not realize this is impossible with an exponential
restart. So explicitly mention that RestartSec must be set.
2026-01-08 23:46:05 +01:00
Matthijs Kooijman
2102511f4a man/systemd.service: Note RestartSteps are exponential 2026-01-08 23:34:03 +01:00
6 changed files with 25 additions and 21 deletions

View File

@ -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

View File

@ -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>

View File

@ -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");
}

View File

@ -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 */

View File

@ -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);

View File

@ -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");