mirror of
https://github.com/systemd/systemd.git
synced 2024-11-08 02:57:16 +03:00
bus: drop systemd.kdbus_attach_flags_mask= cmdline
There is no reason to provide our own attach_flags_mask. We can simply rely on kdbus.attach_flags_mask= which is read by the kernel *and* kmod. If it's set, we assume the user wants to override our setting, so we simply skip setting it.
This commit is contained in:
parent
90b99192ad
commit
314808cea4
@ -1741,29 +1741,20 @@ int bus_kernel_fix_attach_mask(void) {
|
|||||||
|
|
||||||
/* By default we don't want any kdbus metadata fields to be
|
/* By default we don't want any kdbus metadata fields to be
|
||||||
* suppressed, hence we reset the kernel mask for it to
|
* suppressed, hence we reset the kernel mask for it to
|
||||||
* (uint64_t) -1. This is overridable via a kernel command
|
* (uint64_t) -1. If the module argument was overwritten by
|
||||||
* line option, however. */
|
* the kernel cmdline, we leave it as is. */
|
||||||
|
|
||||||
r = get_proc_cmdline_key("systemd.kdbus_attach_flags_mask=", &mask);
|
r = get_proc_cmdline_key("kdbus.attach_flags_mask=", &mask);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_warning_errno(r, "Failed to read kernel command line: %m");
|
return log_warning_errno(r, "Failed to read kernel command line: %m");
|
||||||
|
|
||||||
if (mask) {
|
if (r == 0) {
|
||||||
const char *p = mask;
|
|
||||||
|
|
||||||
if (startswith(p, "0x"))
|
|
||||||
p += 2;
|
|
||||||
|
|
||||||
if (sscanf(p, "%" PRIx64, &m) != 1)
|
|
||||||
log_warning("Couldn't parse systemd.kdbus_attach_flags_mask= kernel command line parameter.");
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(buf, "0x%" PRIx64 "\n", m);
|
sprintf(buf, "0x%" PRIx64 "\n", m);
|
||||||
r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf);
|
r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_full_errno(
|
return log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r,
|
||||||
IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r,
|
|
||||||
"Failed to write kdbus attach mask: %m");
|
"Failed to write kdbus attach mask: %m");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user