mirror of
https://github.com/systemd/systemd
synced 2026-04-23 15:34:50 +02:00
Compare commits
12 Commits
00b29ca143
...
60f53dd5cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60f53dd5cc | ||
|
|
ff8619791a | ||
|
|
4d5dacbef3 | ||
|
|
b312236919 | ||
|
|
77d45f1f83 | ||
|
|
14acae357b | ||
|
|
a8c122c4cb | ||
|
|
5cad4c70e3 | ||
|
|
16568fd336 | ||
|
|
dba8ef106e | ||
|
|
3b9d38f5c8 | ||
|
|
94f7ee9770 |
19
NEWS
19
NEWS
@ -23,14 +23,6 @@ CHANGES WITH 251 in spe:
|
||||
and backward compatibility broken instead on the assumption that
|
||||
nobody can be affected given the current state of this interface.
|
||||
|
||||
* Service monitor environment variables will only be passed to
|
||||
OnFailure=/OnSuccess= handlers if exactly one unit lists the handler
|
||||
unit as OnFailure=/OnSuccess=. In addition, $MONITOR_METADATA is no
|
||||
longer used, and instead separate variables are set:
|
||||
$MONITOR_SERVICE_RESULT, $MONITOR_EXIT_CODE, $MONITOR_EXIT_STATUS,
|
||||
$MONITOR_INVOCATION_ID and $MONITOR_UNIT. For cases when a single
|
||||
handler needs to watch multiple units, use a templated handler.
|
||||
|
||||
* All kernels supported by systemd mix RDRAND (or similar) into the
|
||||
entropy pool at early boot. This means that on those systems, even if
|
||||
/dev/urandom is not yet initialized, it still returns bytes that that
|
||||
@ -47,7 +39,7 @@ CHANGES WITH 251 in spe:
|
||||
|
||||
* sd-boot will now measure the kernel command line into TPM PCR 12
|
||||
rather than PCR 8. This improves usefulness of the measurements on
|
||||
sytems where sd-boot is chainloaded from Grub. Grub measures all
|
||||
systems where sd-boot is chainloaded from Grub. Grub measures all
|
||||
commands its executes into PCR 8, which makes it very hard to use
|
||||
reasonably, hence separate ourselves from that and use PCR 12
|
||||
instead, which is what certain Ubuntu editions already do. To retain
|
||||
@ -174,6 +166,13 @@ CHANGES WITH 251 in spe:
|
||||
they were installed earlier or later than the appropriate version of
|
||||
the library.
|
||||
|
||||
* A new set of service monitor environment variables will be passed to
|
||||
OnFailure=/OnSuccess= handlers, but only if exactly one unit lists the
|
||||
handler unit as OnFailure=/OnSuccess=. The variables are:
|
||||
$MONITOR_SERVICE_RESULT, $MONITOR_EXIT_CODE, $MONITOR_EXIT_STATUS,
|
||||
$MONITOR_INVOCATION_ID and $MONITOR_UNIT. For cases when a single
|
||||
handler needs to watch multiple units, use a templated handler.
|
||||
|
||||
* A new ExtensionDirectories= setting allows system extensions to be
|
||||
loaded from a directory. (It is similar to ExtensionImages=, but
|
||||
takes a path to a directory, instead of an image.)
|
||||
@ -193,7 +192,7 @@ CHANGES WITH 251 in spe:
|
||||
* A new unit systemd-networkd-wait-online@<interface>.service can be
|
||||
used to wait for a specific interface to be up.
|
||||
|
||||
* systemd-resolved is started ealier (in sysinit.target), so it
|
||||
* systemd-resolved is started earlier (in sysinit.target), so it
|
||||
available earlier and will also be started in the initrd if installed
|
||||
there.
|
||||
|
||||
|
||||
@ -233,8 +233,7 @@ endif
|
||||
update_man_rules = custom_target(
|
||||
'update-man-rules',
|
||||
output : 'update-man-rules',
|
||||
command : [sh, '-c',
|
||||
'cd @0@ && '.format(project_build_root) +
|
||||
'python3 @0@/tools/update-man-rules.py $(find @0@ -wholename "*/man/*.xml") >t && '.format(project_source_root) +
|
||||
'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
|
||||
command : [update_man_rules_py,
|
||||
'@0@/man/*.xml'.format(project_source_root),
|
||||
'@0@/rules/meson.build'.format(meson.current_source_dir())],
|
||||
depends : custom_entities_ent)
|
||||
|
||||
@ -2629,10 +2629,10 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
|
||||
<term><varname>BootServerAddress=</varname></term>
|
||||
|
||||
<listitem>
|
||||
<para>Takes an IPv4 address of the boot server used by e.g. PXE boot systems. When specified,
|
||||
the address is set to the <literal>siaddr</literal> field of the DHCP message header. See
|
||||
<ulink url="https://www.rfc-editor.org/rfc/rfc2131.html">RFC 2131</ulink> for more details.
|
||||
Defaults to unset.</para>
|
||||
<para>Takes an IPv4 address of the boot server used by e.g. PXE boot systems. When specified, this
|
||||
address is sent in the <option>siaddr</option> field of the DHCP message header. See <ulink
|
||||
url="https://www.rfc-editor.org/rfc/rfc2131.html">RFC 2131</ulink> for more details. Defaults to
|
||||
unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -2640,13 +2640,13 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
|
||||
<term><varname>BootServerName=</varname></term>
|
||||
|
||||
<listitem>
|
||||
<para>Takes a name of the boot server used by e.g. PXE boot systems. When specified, the
|
||||
server name is set to the DHCP option 66. See
|
||||
<ulink url="https://www.rfc-editor.org/rfc/rfc2132.html">RFC 2132</ulink> for more details.
|
||||
Defaults to unset.</para>
|
||||
<para>Note that typically one of
|
||||
<varname>BootServerName=</varname>/<varname>BootServerAddress=</varname> is sufficient to be
|
||||
set, but both can be set too, if desired.</para>
|
||||
<para>Takes a name of the boot server used by e.g. PXE boot systems. When specified, this name is
|
||||
sent in the DHCP option 66 ("TFTP server name"). See <ulink
|
||||
url="https://www.rfc-editor.org/rfc/rfc2132.html">RFC 2132</ulink> for more details. Defaults to
|
||||
unset.</para>
|
||||
|
||||
<para>Note that typically setting one of <varname>BootServerName=</varname> or
|
||||
<varname>BootServerAddress=</varname> is sufficient, but both can be set too, if desired.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -2654,10 +2654,10 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
|
||||
<term><varname>BootFilename=</varname></term>
|
||||
|
||||
<listitem>
|
||||
<para>Takes a path or URL to a file loaded by e.g. a PXE boot loader. The specified path is
|
||||
set to the DHCP option 67. See
|
||||
<ulink url="https://www.rfc-editor.org/rfc/rfc2132.html">RFC 2132</ulink> for more details.
|
||||
Defaults to unset.</para>
|
||||
<para>Takes a path or URL to a file loaded by e.g. a PXE boot loader. When specified, this path is
|
||||
sent in the DHCP option 67 ("Bootfile name"). See <ulink
|
||||
url="https://www.rfc-editor.org/rfc/rfc2132.html">RFC 2132</ulink> for more details. Defaults to
|
||||
unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@ -1803,6 +1803,7 @@ make_directive_index_py = find_program('tools/make-directive-index.py')
|
||||
make_man_index_py = find_program('tools/make-man-index.py')
|
||||
meson_render_jinja2 = find_program('tools/meson-render-jinja2.py')
|
||||
update_dbus_docs_py = find_program('tools/update-dbus-docs.py')
|
||||
update_man_rules_py = find_program('tools/update-man-rules.py')
|
||||
update_hwdb_sh = find_program('tools/update-hwdb.sh')
|
||||
update_hwdb_autosuspend_sh = find_program('tools/update-hwdb-autosuspend.sh')
|
||||
update_syscall_tables_sh = find_program('tools/update-syscall-tables.sh')
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
BEGIN{
|
||||
print "static const char* const errno_names[] = { "
|
||||
}
|
||||
!/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ {
|
||||
!/(EDEADLOCK|EWOULDBLOCK|ENOTSUP)/ {
|
||||
printf " [%s] = \"%s\",\n", $1, $1
|
||||
}
|
||||
END{
|
||||
|
||||
@ -1086,17 +1086,25 @@ int open_mkdir_at(int dirfd, const char *path, int flags, mode_t mode) {
|
||||
|
||||
int openat_report_new(int dirfd, const char *pathname, int flags, mode_t mode, bool *ret_newly_created) {
|
||||
unsigned attempts = 7;
|
||||
|
||||
/* Just like openat(), but adds one thing: optionally returns whether we created the file anew or if
|
||||
* it already existed before. This is only relevant of O_CREAT is set without O_EXCL, and thus will
|
||||
* shortcut to openat() otherwise */
|
||||
|
||||
if (!FLAGS_SET(flags, O_CREAT) || FLAGS_SET(flags, O_EXCL) || !ret_newly_created)
|
||||
return RET_NERRNO(openat(dirfd, pathname, flags, mode));
|
||||
|
||||
for (;;) {
|
||||
int fd;
|
||||
|
||||
/* Just like openat(), but adds one thing: optionally returns whether we created the file anew or if
|
||||
* it already existed before. This is only relevant if O_CREAT is set without O_EXCL, and thus will
|
||||
* shortcut to openat() otherwise */
|
||||
|
||||
if (!ret_newly_created)
|
||||
return RET_NERRNO(openat(dirfd, pathname, flags, mode));
|
||||
|
||||
if (!FLAGS_SET(flags, O_CREAT) || FLAGS_SET(flags, O_EXCL)) {
|
||||
fd = openat(dirfd, pathname, flags, mode);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
*ret_newly_created = FLAGS_SET(flags, O_CREAT);
|
||||
return fd;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
/* First, attempt to open without O_CREAT/O_EXCL, i.e. open existing file */
|
||||
fd = openat(dirfd, pathname, flags & ~(O_CREAT | O_EXCL), mode);
|
||||
if (fd >= 0) {
|
||||
@ -1116,7 +1124,7 @@ int openat_report_new(int dirfd, const char *pathname, int flags, mode_t mode, b
|
||||
return -errno;
|
||||
|
||||
/* Hmm, so now we got EEXIST? So it apparently exists now? If so, let's try to open again
|
||||
* without the two flags. But let's not spin forever, hnce put a limit on things */
|
||||
* without the two flags. But let's not spin forever, hence put a limit on things */
|
||||
|
||||
if (--attempts == 0) /* Give up eventually, somebody is playing with us */
|
||||
return -EEXIST;
|
||||
|
||||
@ -53,7 +53,7 @@ typedef struct {
|
||||
CHAR16 *id; /* The unique identifier for this entry (typically the filename of the file defining the entry) */
|
||||
CHAR16 *title_show; /* The string to actually display (this is made unique before showing) */
|
||||
CHAR16 *title; /* The raw (human readable) title string of the entry (not necessarily unique) */
|
||||
CHAR16 *sort_key; /* The string to use as primary sory key, usually ID= from os-release, possibly suffixed */
|
||||
CHAR16 *sort_key; /* The string to use as primary sort key, usually ID= from os-release, possibly suffixed */
|
||||
CHAR16 *version; /* The raw (human readable) version string of the entry */
|
||||
CHAR16 *machine_id;
|
||||
EFI_HANDLE *device;
|
||||
|
||||
@ -1163,12 +1163,12 @@ static int lock_image_fd(int image_fd, const char *ip) {
|
||||
|
||||
if (flock(image_fd, LOCK_EX|LOCK_NB) < 0) {
|
||||
|
||||
if (errno == EWOULDBLOCK)
|
||||
if (errno == EAGAIN)
|
||||
log_error_errno(errno, "Image file '%s' already locked, can't use.", ip);
|
||||
else
|
||||
log_error_errno(errno, "Failed to lock image file '%s': %m", ip);
|
||||
|
||||
return errno != EWOULDBLOCK ? -errno : -EADDRINUSE; /* Make error recognizable */
|
||||
return errno != EAGAIN ? -errno : -EADDRINUSE; /* Make error recognizable */
|
||||
}
|
||||
|
||||
log_info("Successfully locked image file '%s'.", ip);
|
||||
|
||||
@ -217,28 +217,26 @@ static int get_child_nodes(
|
||||
const char *prefix,
|
||||
struct node *n,
|
||||
unsigned flags,
|
||||
OrderedSet **_s,
|
||||
OrderedSet **ret,
|
||||
sd_bus_error *error) {
|
||||
|
||||
OrderedSet *s = NULL;
|
||||
_cleanup_ordered_set_free_free_ OrderedSet *s = NULL;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(prefix);
|
||||
assert(n);
|
||||
assert(_s);
|
||||
assert(ret);
|
||||
|
||||
s = ordered_set_new(&string_hash_ops);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
r = add_subtree_to_set(bus, prefix, n, flags, s, error);
|
||||
if (r < 0) {
|
||||
ordered_set_free_free(s);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
*_s = s;
|
||||
*ret = TAKE_PTR(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1499,8 +1497,7 @@ static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
|
||||
if (streq(path, "/"))
|
||||
parent = NULL;
|
||||
else {
|
||||
e = strrchr(path, '/');
|
||||
assert(e);
|
||||
assert_se(e = strrchr(path, '/'));
|
||||
|
||||
p = strndupa_safe(path, MAX(1, e - path));
|
||||
|
||||
|
||||
@ -1018,6 +1018,24 @@ TEST(openat_report_new) {
|
||||
assert_se(fd >= 0);
|
||||
fd = safe_close(fd);
|
||||
assert_se(!b);
|
||||
|
||||
fd = openat_report_new(AT_FDCWD, j, O_RDWR, 0666, &b);
|
||||
assert_se(fd >= 0);
|
||||
fd = safe_close(fd);
|
||||
assert_se(!b);
|
||||
|
||||
fd = openat_report_new(AT_FDCWD, j, O_RDWR|O_CREAT|O_EXCL, 0666, &b);
|
||||
assert_se(fd == -EEXIST);
|
||||
|
||||
assert_se(unlink(j) >= 0);
|
||||
|
||||
fd = openat_report_new(AT_FDCWD, j, O_RDWR, 0666, &b);
|
||||
assert_se(fd == -ENOENT);
|
||||
|
||||
fd = openat_report_new(AT_FDCWD, j, O_RDWR|O_CREAT|O_EXCL, 0666, &b);
|
||||
assert_se(fd >= 0);
|
||||
fd = safe_close(fd);
|
||||
assert_se(b);
|
||||
}
|
||||
|
||||
static int intro(void) {
|
||||
|
||||
@ -4,58 +4,39 @@ from argparse import ArgumentParser
|
||||
from pathlib import Path
|
||||
from subprocess import run, PIPE
|
||||
|
||||
|
||||
def extract_interfaces_xml(output_dir, executable):
|
||||
list_interfaces_process = run(
|
||||
proc = run(
|
||||
args=[executable.absolute(), '--bus-introspect', 'list'],
|
||||
stdout=PIPE,
|
||||
check=True,
|
||||
universal_newlines=True,
|
||||
)
|
||||
universal_newlines=True)
|
||||
|
||||
interfaces_lines = list_interfaces_process.stdout.splitlines()
|
||||
|
||||
interface_names = [x.split()[1] for x in interfaces_lines]
|
||||
interface_names = (x.split()[1] for x in proc.stdout.splitlines())
|
||||
|
||||
for interface_name in interface_names:
|
||||
interface_introspection_run = run(
|
||||
proc = run(
|
||||
args=[executable.absolute(), '--bus-introspect', interface_name],
|
||||
stdout=PIPE,
|
||||
check=True,
|
||||
universal_newlines=True,
|
||||
)
|
||||
universal_newlines=True)
|
||||
|
||||
interface_file_name = output_dir / (interface_name + '.xml')
|
||||
with open(interface_file_name, mode='w') as f:
|
||||
f.write(interface_introspection_run.stdout)
|
||||
interface_file_name.write_text(proc.stdout)
|
||||
interface_file_name.chmod(0o644)
|
||||
|
||||
|
||||
def iterate_executables(output_dir, executables):
|
||||
output_dir.mkdir(mode=0o755, exist_ok=True)
|
||||
|
||||
for exe in executables:
|
||||
extract_interfaces_xml(output_dir, exe)
|
||||
|
||||
|
||||
def main():
|
||||
parser = ArgumentParser()
|
||||
|
||||
parser.add_argument(
|
||||
'output',
|
||||
type=Path,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'executables',
|
||||
type=Path,
|
||||
parser.add_argument('output',
|
||||
type=Path)
|
||||
parser.add_argument('executables',
|
||||
nargs='+',
|
||||
)
|
||||
type=Path)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
iterate_executables(args.output, args.executables)
|
||||
|
||||
args.output.mkdir(exist_ok=True)
|
||||
for exe in args.executables:
|
||||
extract_interfaces_xml(args.output, exe)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@ -3,9 +3,10 @@
|
||||
|
||||
from __future__ import print_function
|
||||
import collections
|
||||
import glob
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import pprint
|
||||
from os.path import basename
|
||||
from xml_helper import xml_parse
|
||||
|
||||
def man(page, number):
|
||||
@ -56,7 +57,8 @@ manpages = ['''
|
||||
|
||||
MESON_FOOTER = '''\
|
||||
]
|
||||
# Really, do not edit.'''
|
||||
# Really, do not edit.
|
||||
'''
|
||||
|
||||
def make_mesonfile(rules, dist_files):
|
||||
# reformat rules as
|
||||
@ -76,13 +78,20 @@ def make_mesonfile(rules, dist_files):
|
||||
return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER))
|
||||
|
||||
if __name__ == '__main__':
|
||||
pages = sys.argv[1:]
|
||||
source_glob = sys.argv[1]
|
||||
target = Path(sys.argv[2])
|
||||
|
||||
pages = glob.glob(source_glob)
|
||||
pages = (p for p in pages
|
||||
if basename(p) not in {
|
||||
if Path(p).name not in {
|
||||
'systemd.directives.xml',
|
||||
'systemd.index.xml',
|
||||
'directives-template.xml'})
|
||||
|
||||
rules = create_rules(pages)
|
||||
dist_files = (basename(p) for p in pages)
|
||||
print(make_mesonfile(rules, dist_files))
|
||||
dist_files = (Path(p).name for p in pages)
|
||||
text = make_mesonfile(rules, dist_files)
|
||||
|
||||
tmp = target.with_suffix('.tmp')
|
||||
tmp.write_text(text)
|
||||
tmp.rename(target)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user