1
0
mirror of https://github.com/systemd/systemd synced 2026-03-25 16:25:04 +01:00

Compare commits

...

8 Commits

Author SHA1 Message Date
Yu Watanabe
2960889a2c mount-util: fix typo
Follow-up for 273c6bc045fdfa50c693d0b88ec2a4cbc9258329.
2025-12-15 11:20:29 +09:00
Yu Watanabe
82e3f6c5f9
sysext: Fix config file section docs and --root= (#40063) 2025-12-15 09:45:29 +09:00
Yu Watanabe
93378148d4 tree-wide: normalize comment style 2025-12-15 08:50:13 +09:00
0x06
8e20b9a79d
hwdb: Fix ACCEL_MOUNT_MATRIX for Lenovo Ideapad MIIX 310-ICR (#40067)
Tested with monitor-sensor on bvr1HCN44WW
2025-12-15 07:19:10 +09:00
David Santamaría Rogado
a0a64f6b67
hwdb: sensor: Remove Lenovo IdeaPad Duet 3 accel mount matrix (#40075)
Same case as IdeaPad D330, matrix applied to solve issues in wayland
compositors when is not the way because correct data is send by the
sensor.

As described in #39529, let's remove the matrix.
2025-12-15 07:16:10 +09:00
David Santamaría Rogado
6855c4a7f7
hwdb: sensor: Add HP OmniBook Ultra Flip 14 accel mount matrix (#40076)
HP OmniBook Ultra Flip Laptop 14-fh0xxx tilt is inverted by default so
screen tilt-face down is up and vice versa, invert the axis then.
2025-12-15 07:14:00 +09:00
Kai Lueke
4938777695 man/sysext.conf: Fix section name to match code
The code uses SysExt and ConfExt for section names but the docs use
Sysext and Confext.
Align the docs with the code.
2025-12-12 21:54:47 +09:00
Kai Lueke
f351668cbe sysext: Fix config file support with --root=
Config files for --root= weren't picked up as expected because the
--root= flag got parsed after the config file.
Switch the order of config file and CLI flag parsing while letting the
CLI flags overwrite things set by the config files by tracking state
during parsing.
2025-12-12 21:50:45 +09:00
434 changed files with 2004 additions and 1913 deletions

View File

@ -628,6 +628,10 @@ sensor:modalias:platform:lis3lv02d:dmi:*svn*Hewlett-Packard*:*
sensor:modalias:platform:lis3lv02d:dmi:*svn*HP*:*
ACCEL_LOCATION=base
# HP OmniBook Ultra Flip Laptop 14-fh0xxx
sensor:modalias:platform:HID-SENSOR-200073:dmi:*:svnHP:pnHPOmniBookUltraFlipLaptop14-fh0xxx:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, 1, 0; 0, 0, -1
sensor:modalias:acpi:SMO8500*:dmi:*:svnHewlett-Packard:pnHPStream7Tablet:*
sensor:modalias:acpi:SMO8500*:dmi:*:svnHewlett-Packard:pnHPStream8Tablet:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
@ -764,7 +768,7 @@ sensor:modalias:acpi:SMO8500*:dmi:bvnLENOVO:*:pvrMIIX300-*:*
# a portrait LCD panel, versions with bvr 1HCN3?WW have a landscape panel
sensor:modalias:acpi:KIOX000A*:dmi:bvnLENOVO:bvr1HCN4?WW:*:svnLENOVO:pn80SG:*
sensor:modalias:acpi:KIOX000A*:dmi:bvnLENOVO:bvr1HCN2?WW:*:svnLENOVO:pn80SG:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, -1
# IdeaPad Miix 310 BIOS version bvr1HCN3?WW (variant 3)
sensor:modalias:acpi:KIOX000A*:dmi:bvnLENOVO:bvr1HCN3?WW:*:svnLENOVO:pn80SG:*
@ -799,11 +803,6 @@ sensor:modalias:i2c:bmc150_accel:dmi:*:svnLENOVO:*:pvrLenovoYoga300-11IBR:*
sensor:modalias:acpi:ACCL0001*:dmi:*:svnLENOVO:pn60072:pvr851*:*
ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1
# IdeaPad Duet 3 10IGL5 (82AT) and 10IGL5-LTE (82HK)
sensor:modalias:acpi:SMO8B30*:dmi:*:svnLENOVO*:pn82AT:*
sensor:modalias:acpi:SMO8B30*:dmi:*:svnLENOVO*:pn82HK:*
ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1
#########################################
# LINX
#########################################

View File

@ -54,8 +54,8 @@
<refsect1>
<title>Options</title>
<para>The following options are understood in both the <literal>[Sysext]</literal> and
<literal>[Confext]</literal> sections:</para>
<para>The following options are understood in both the <literal>[SysExt]</literal> and
<literal>[ConfExt]</literal> sections:</para>
<refsect2>
<title>Section Options</title>

View File

@ -11,8 +11,7 @@
* ---------------------------------------------------------
* The base header defines the length of full header, fwid and payload.
* The fwid is a NUL terminated string.
* The payload contains the actual efi firmware.
*/
* The payload contains the actual efi firmware. */
typedef struct EfiFwHeader {
uint32_t magic; /* magic number that defines Efifw */
uint32_t header_len; /* total length of header including all attributes */

View File

@ -2604,7 +2604,7 @@ static int can_mount_proc(void) {
if (n != 0) /* on success we should have read 0 bytes */
return -EIO;
r = wait_for_terminate_and_check("(sd-proc-check)", TAKE_PID(pid), 0 /* flags= */);
r = wait_for_terminate_and_check("(sd-proc-check)", TAKE_PID(pid), /* flags= */ 0);
if (r < 0)
return log_debug_errno(r, "Failed to wait for (sd-proc-check) child process to terminate: %m");
if (r != EXIT_SUCCESS) /* If something strange happened with the child, let's consider this fatal, too */

View File

@ -73,7 +73,7 @@ static int load_key_file(
static const char *integrity_algorithm_select(const void *key_file_buf) {
/* To keep a bit of sanity for end users, the subset of integrity
algorithms we support will match what is used in integritysetup */
* algorithms we support will match what is used in integritysetup */
if (arg_integrity_algorithm) {
if (streq(arg_integrity_algorithm, "hmac-sha256"))
return DM_HMAC_256;

View File

@ -1858,7 +1858,8 @@ static int run_context_reconnect(RunContext *c) {
"org.freedesktop.systemd1.Unit",
"Ref",
&error,
/* ret_reply = */ NULL, NULL);
/* ret_reply= */ NULL,
/* types= */ NULL);
if (r < 0) {
/* Hmm, the service manager probably hasn't finished reexecution just yet? Try again later. */
if (bus_error_is_connection(&error) || bus_error_is_unknown_service(&error))

View File

@ -59,8 +59,7 @@ int read_fiemap(int fd, struct fiemap **ret) {
/* XFS filesystem has incorrect implementation of fiemap ioctl and
* returns extents for only one block-group at a time, so we need
* to handle it manually, starting the next fiemap call from the end
* of the last extent
*/
* of the last extent. */
while (fiemap_start < fiemap_length) {
*fiemap = (struct fiemap) {
.fm_start = fiemap_start,

View File

@ -1430,7 +1430,7 @@ int mount_fd_clone(int mount_fd, bool recursive, int *replacement_fd) {
assert(mount_fd >= 0);
/* If the input mount fd is supposed to remain clonable after calling this function, call it as
/* If the input mount fd is supposed to remain cloneable after calling this function, call it as
* follows: mount_fd_clone(mount_fd, recursive, &mount_fd). */
/* Clone a detached mount (that may be owned by a foreign mountns, e.g. mountfsd's). For this to

View File

@ -93,8 +93,10 @@ static bool arg_force = false;
static bool arg_no_reload = false;
static int arg_noexec = -1;
static ImagePolicy *arg_image_policy = NULL;
static bool arg_image_policy_set = false; /* Tracks initialization */
static bool arg_varlink = false;
static MutableMode arg_mutable = MUTABLE_NO;
static bool arg_mutable_set = false; /* Tracks initialization */
static const char *arg_overlayfs_mount_options = NULL;
/* Is set to IMAGE_CONFEXT when systemd is called with the confext functionality instead of the default */
@ -163,10 +165,13 @@ static int parse_mutable_mode(const char *p) {
static DEFINE_CONFIG_PARSE_ENUM(config_parse_mutable_mode, mutable_mode, MutableMode);
static int parse_config_file(ImageClass image_class) {
_cleanup_(image_policy_freep) ImagePolicy *config_image_policy = NULL;
MutableMode config_mutable = MUTABLE_NO;
const char *section = image_class == IMAGE_SYSEXT ? "SysExt" : "ConfExt";
const char *sections = image_class == IMAGE_SYSEXT ? "SysExt\0" : "ConfExt\0";
const ConfigTableItem items[] = {
{ section, "Mutable", config_parse_mutable_mode, 0, &arg_mutable },
{ section, "ImagePolicy", config_parse_image_policy, 0, &arg_image_policy },
{ section, "Mutable", config_parse_mutable_mode, 0, &config_mutable },
{ section, "ImagePolicy", config_parse_image_policy, 0, &config_image_policy },
{}
};
_cleanup_free_ char *config_file = NULL;
@ -179,7 +184,7 @@ static int parse_config_file(ImageClass image_class) {
r = config_parse_standard_file_with_dropins_full(
arg_root,
config_file,
image_class == IMAGE_SYSEXT ? "SysExt\0" : "ConfExt\0",
sections,
config_item_table_lookup, items,
CONFIG_PARSE_WARN,
/* userdata= */ NULL,
@ -188,6 +193,17 @@ static int parse_config_file(ImageClass image_class) {
if (r < 0)
return r;
/* Because this runs after parse_argv we only overwrite when things aren't set yet. */
if (!arg_mutable_set) {
arg_mutable = config_mutable;
arg_mutable_set = true;
}
if (!arg_image_policy_set) {
arg_image_policy = TAKE_PTR(config_image_policy);
arg_image_policy_set = true;
}
return 0;
}
@ -2592,6 +2608,9 @@ static int parse_argv(int argc, char *argv[]) {
r = parse_image_policy_argument(optarg, &arg_image_policy);
if (r < 0)
return r;
/* When the CLI flag is given we initialize even if NULL
* so that the config file entry won't overwrite it */
arg_image_policy_set = true;
break;
case ARG_NOEXEC:
@ -2618,6 +2637,7 @@ static int parse_argv(int argc, char *argv[]) {
if (r < 0)
return log_error_errno(r, "Failed to parse argument to --mutable=: %s", optarg);
arg_mutable = r;
arg_mutable_set = true;
break;
case '?':
@ -2646,8 +2666,10 @@ static int parse_env(void) {
if (r < 0)
log_warning("Failed to parse %s environment variable value '%s'. Ignoring.",
image_class_info[arg_image_class].mode_env, env_var);
else
else {
arg_mutable = r;
arg_mutable_set = true;
}
}
env_var = secure_getenv(image_class_info[arg_image_class].opts_env);
@ -2691,16 +2713,18 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return r;
/* Parse configuration file */
r = parse_config_file(arg_image_class);
if (r < 0)
log_warning_errno(r, "Failed to parse global config file, ignoring: %m");
/* Parse command line */
r = parse_argv(argc, argv);
if (r <= 0)
return r;
/* Parse configuration file after argv because it needs --root=.
* The config entries will not overwrite values set already by
* env/argv because we track initialization. */
r = parse_config_file(arg_image_class);
if (r < 0)
log_warning_errno(r, "Failed to parse global config file, ignoring: %m");
if (arg_varlink) {
_cleanup_(sd_varlink_server_unrefp) sd_varlink_server *varlink_server = NULL;

View File

@ -163,6 +163,24 @@ prepare_extension_image_with_matching_id_like() {
prepend_trap "rm -rf ${ext_dir@Q}"
}
prepare_extension_image_raw() {
local root=${1:-}
local hierarchy=${2:?}
local ext_dir ext_release name
name="test-extension"
ext_dir="$root/var/lib/extensions/$name"
ext_release="$ext_dir/usr/lib/extension-release.d/extension-release.$name"
mkdir -p "${ext_release%/*}"
echo "ID=_any" >"$ext_release"
mkdir -p "$ext_dir/$hierarchy"
touch "$ext_dir$hierarchy/preexisting-file-in-extension-image"
mksquashfs "$ext_dir" "$ext_dir.raw" -all-root -noappend -quiet
rm -rf "$ext_dir"
prepend_trap "rm -rf ${ext_dir@Q}.raw"
}
prepare_extension_mutable_dir() {
local dir=${1:?}
@ -1170,6 +1188,57 @@ fi
rm "${fake_root}/etc/initrd-release"
)
( init_trap
: "Check config file support for --root="
fake_root=${roots_dir:+"$roots_dir/config-file"}
hierarchy=/opt
extension_data_dir="$fake_root/var/lib/extensions.mutable$hierarchy"
[[ "$FSTYPE" == "fuseblk" ]] && exit 0
if [ "$roots_dir" = "" ]; then
echo >&2 "Skipping test when --root= is not used"
exit 0
fi
prepare_root "$fake_root" "$hierarchy"
prepare_extension_image_raw "$fake_root" "$hierarchy"
prepare_extension_mutable_dir "$extension_data_dir"
prepare_read_only_hierarchy "$fake_root" "$hierarchy"
mkdir -p "$fake_root/etc/systemd/"
{ echo "[SysExt]" ; echo "Mutable=auto" ; } > "$fake_root/etc/systemd/sysext.conf"
# Config file should be picked up with --root= set
run_systemd_sysext "$fake_root" merge
MNTOPT=$(findmnt "$fake_root$hierarchy" --first-only --direction backward --raw --noheadings -o VFS-OPTIONS | grep -o rw || true)
if [ "$MNTOPT" != "rw" ]; then
echo >&2 "Merge did not pick up mutable setting from config file"
exit 1
fi
extension_verify_after_merge "$fake_root" "$hierarchy" -e -h -u
run_systemd_sysext "$fake_root" unmerge
# CLI arg should be able to overwrite config file
run_systemd_sysext "$fake_root" merge --mutable=no
MNTOPT=$(findmnt "$fake_root$hierarchy" --first-only --direction backward --raw --noheadings -o VFS-OPTIONS | grep -o ro || true)
if [ "$MNTOPT" != "ro" ]; then
echo >&2 "Merge did not pick up CLI arg to overwrite mutable setting from config file"
exit 1
fi
extension_verify_after_merge "$fake_root" "$hierarchy" -e -h
run_systemd_sysext "$fake_root" unmerge
{ echo "[SysExt]" ; echo "ImagePolicy=root=signed+absent:usr=signed+absent" ; } > "$fake_root/etc/systemd/sysext.conf"
# Config file should be picked up with --root= set
if run_systemd_sysext "$fake_root" merge; then
echo >&2 "Merge did not fail with strict image policy in config file"
exit 1
fi
# CLI arg should be able to overwrite config file
run_systemd_sysext "$fake_root" merge --image-policy="*"
extension_verify_after_merge "$fake_root" "$hierarchy" -e -h
run_systemd_sysext "$fake_root" unmerge
)
} # End of run_sysext_tests