Compare commits
18 Commits
5fc51a8223
...
b23728ec9f
Author | SHA1 | Date |
---|---|---|
Plan C | b23728ec9f | |
Ikey Doherty | 677bb0555a | |
Lennart Poettering | ae6ad21e0b | |
Zbigniew Jędrzejewski-Szmek | c1afa2ed39 | |
Zbigniew Jędrzejewski-Szmek | 7efbe21850 | |
Zbigniew Jędrzejewski-Szmek | e4b2cea32a | |
Zbigniew Jędrzejewski-Szmek | c91e3116f4 | |
Zbigniew Jędrzejewski-Szmek | 04aa6fa8cd | |
Zbigniew Jędrzejewski-Szmek | 4cc73cf9c1 | |
Zbigniew Jędrzejewski-Szmek | 1b584f38a8 | |
Zbigniew Jędrzejewski-Szmek | 0f5cea0212 | |
Zbigniew Jędrzejewski-Szmek | af4c7dc269 | |
Zbigniew Jędrzejewski-Szmek | b7be416f55 | |
Zbigniew Jędrzejewski-Szmek | 839bdf2505 | |
Zbigniew Jędrzejewski-Szmek | c87d0661a0 | |
Zbigniew Jędrzejewski-Szmek | 9f927e46ac | |
Zbigniew Jędrzejewski-Szmek | ae6c598791 | |
Zbigniew Jędrzejewski-Szmek | 37b6a5dff5 |
|
@ -202,11 +202,17 @@ if dbus_docs.length() > 0
|
|||
custom_target(
|
||||
'update-dbus-docs',
|
||||
output : 'update-dbus-docs',
|
||||
command : ['python3',
|
||||
'@0@/tools/update-dbus-docs.py'.format(project_source_root),
|
||||
command : [update_dbus_docs_py,
|
||||
'--build-dir=@0@'.format(project_build_root),
|
||||
'@INPUT@'],
|
||||
input : dbus_docs)
|
||||
|
||||
if conf.get('DEVELOPER_MODE') == 1
|
||||
test('dbus-docs-fresh',
|
||||
update_dbus_docs_py,
|
||||
args : ['--build-dir=@0@'.format(project_build_root),
|
||||
'--test'] + dbus_docs)
|
||||
endif
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
|
|
@ -2567,6 +2567,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b RemoveIPC = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(say) SetCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(ss) LoadCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as SupplementaryGroups = ['...', ...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s PAMName = '...';
|
||||
|
@ -2673,6 +2677,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s KeyringMode = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProtectProc = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProcSubset = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b ProtectHostname = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s NetworkNamespacePath = '...';
|
||||
|
@ -3068,6 +3076,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
|||
|
||||
<!--property RemoveIPC is not documented!-->
|
||||
|
||||
<!--property SetCredential is not documented!-->
|
||||
|
||||
<!--property LoadCredential is not documented!-->
|
||||
|
||||
<!--property SupplementaryGroups is not documented!-->
|
||||
|
||||
<!--property PAMName is not documented!-->
|
||||
|
@ -3172,6 +3184,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
|||
|
||||
<!--property KeyringMode is not documented!-->
|
||||
|
||||
<!--property ProtectProc is not documented!-->
|
||||
|
||||
<!--property ProcSubset is not documented!-->
|
||||
|
||||
<!--property ProtectHostname is not documented!-->
|
||||
|
||||
<!--property NetworkNamespacePath is not documented!-->
|
||||
|
@ -3616,6 +3632,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="RemoveIPC"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SetCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="LoadCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SupplementaryGroups"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="PAMName"/>
|
||||
|
@ -3722,6 +3742,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="KeyringMode"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectProc"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProcSubset"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectHostname"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="NetworkNamespacePath"/>
|
||||
|
@ -4236,6 +4260,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b RemoveIPC = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(say) SetCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(ss) LoadCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as SupplementaryGroups = ['...', ...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s PAMName = '...';
|
||||
|
@ -4342,6 +4370,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s KeyringMode = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProtectProc = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProcSubset = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b ProtectHostname = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s NetworkNamespacePath = '...';
|
||||
|
@ -4757,6 +4789,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
|
|||
|
||||
<!--property RemoveIPC is not documented!-->
|
||||
|
||||
<!--property SetCredential is not documented!-->
|
||||
|
||||
<!--property LoadCredential is not documented!-->
|
||||
|
||||
<!--property SupplementaryGroups is not documented!-->
|
||||
|
||||
<!--property PAMName is not documented!-->
|
||||
|
@ -4861,6 +4897,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
|
|||
|
||||
<!--property KeyringMode is not documented!-->
|
||||
|
||||
<!--property ProtectProc is not documented!-->
|
||||
|
||||
<!--property ProcSubset is not documented!-->
|
||||
|
||||
<!--property ProtectHostname is not documented!-->
|
||||
|
||||
<!--property NetworkNamespacePath is not documented!-->
|
||||
|
@ -5303,6 +5343,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="RemoveIPC"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SetCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="LoadCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SupplementaryGroups"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="PAMName"/>
|
||||
|
@ -5409,6 +5453,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="KeyringMode"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectProc"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProcSubset"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectHostname"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="NetworkNamespacePath"/>
|
||||
|
@ -5859,6 +5907,10 @@ node /org/freedesktop/systemd1/unit/home_2emount {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b RemoveIPC = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(say) SetCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(ss) LoadCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as SupplementaryGroups = ['...', ...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s PAMName = '...';
|
||||
|
@ -5965,6 +6017,10 @@ node /org/freedesktop/systemd1/unit/home_2emount {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s KeyringMode = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProtectProc = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProcSubset = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b ProtectHostname = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s NetworkNamespacePath = '...';
|
||||
|
@ -6310,6 +6366,10 @@ node /org/freedesktop/systemd1/unit/home_2emount {
|
|||
|
||||
<!--property RemoveIPC is not documented!-->
|
||||
|
||||
<!--property SetCredential is not documented!-->
|
||||
|
||||
<!--property LoadCredential is not documented!-->
|
||||
|
||||
<!--property SupplementaryGroups is not documented!-->
|
||||
|
||||
<!--property PAMName is not documented!-->
|
||||
|
@ -6414,6 +6474,10 @@ node /org/freedesktop/systemd1/unit/home_2emount {
|
|||
|
||||
<!--property KeyringMode is not documented!-->
|
||||
|
||||
<!--property ProtectProc is not documented!-->
|
||||
|
||||
<!--property ProcSubset is not documented!-->
|
||||
|
||||
<!--property ProtectHostname is not documented!-->
|
||||
|
||||
<!--property NetworkNamespacePath is not documented!-->
|
||||
|
@ -6778,6 +6842,10 @@ node /org/freedesktop/systemd1/unit/home_2emount {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="RemoveIPC"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SetCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="LoadCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SupplementaryGroups"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="PAMName"/>
|
||||
|
@ -6884,6 +6952,10 @@ node /org/freedesktop/systemd1/unit/home_2emount {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="KeyringMode"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectProc"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProcSubset"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectHostname"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="NetworkNamespacePath"/>
|
||||
|
@ -7453,6 +7525,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b RemoveIPC = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(say) SetCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly a(ss) LoadCredential = [...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly as SupplementaryGroups = ['...', ...];
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s PAMName = '...';
|
||||
|
@ -7559,6 +7635,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
|
|||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s KeyringMode = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProtectProc = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s ProcSubset = '...';
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly b ProtectHostname = ...;
|
||||
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
|
||||
readonly s NetworkNamespacePath = '...';
|
||||
|
@ -7890,6 +7970,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
|
|||
|
||||
<!--property RemoveIPC is not documented!-->
|
||||
|
||||
<!--property SetCredential is not documented!-->
|
||||
|
||||
<!--property LoadCredential is not documented!-->
|
||||
|
||||
<!--property SupplementaryGroups is not documented!-->
|
||||
|
||||
<!--property PAMName is not documented!-->
|
||||
|
@ -7994,6 +8078,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
|
|||
|
||||
<!--property KeyringMode is not documented!-->
|
||||
|
||||
<!--property ProtectProc is not documented!-->
|
||||
|
||||
<!--property ProcSubset is not documented!-->
|
||||
|
||||
<!--property ProtectHostname is not documented!-->
|
||||
|
||||
<!--property NetworkNamespacePath is not documented!-->
|
||||
|
@ -8344,6 +8432,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="RemoveIPC"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SetCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="LoadCredential"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="SupplementaryGroups"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="PAMName"/>
|
||||
|
@ -8450,6 +8542,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
|
|||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="KeyringMode"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectProc"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProcSubset"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="ProtectHostname"/>
|
||||
|
||||
<variablelist class="dbus-property" generated="True" extra-ref="NetworkNamespacePath"/>
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
|
||||
<refsynopsisdiv>
|
||||
<para><filename>systemd-backlight@.service</filename></para>
|
||||
<para><filename>/usr/lib/systemd/systemd-backlight</filename></para>
|
||||
<para><filename>/usr/lib/systemd/systemd-backlight</filename> save [backlight|leds]:DEVICE</para>
|
||||
<para><filename>/usr/lib/systemd/systemd-backlight</filename> load [backlight|leds]:DEVICE</para>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
|
|
|
@ -38,6 +38,9 @@ relative_source_path = run_command('realpath',
|
|||
project_source_root).stdout().strip()
|
||||
conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
|
||||
|
||||
conf.set10('DEVELOPER_MODE', get_option('mode') == 'developer',
|
||||
description : 'enable additional checks only suitable in development')
|
||||
|
||||
want_ossfuzz = get_option('oss-fuzz')
|
||||
want_libfuzzer = get_option('llvm-fuzz')
|
||||
if want_ossfuzz + want_libfuzzer > 1
|
||||
|
@ -1634,6 +1637,7 @@ make_directive_index_py = find_program('tools/make-directive-index.py')
|
|||
make_man_index_py = find_program('tools/make-man-index.py')
|
||||
syscall_names_update_sh = find_program('tools/syscall-names-update.sh')
|
||||
xml_helper_py = find_program('tools/xml_helper.py')
|
||||
update_dbus_docs_py = find_program('tools/update-dbus-docs.py')
|
||||
|
||||
############################################################
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
option('version-tag', type : 'string',
|
||||
description : 'override the git version string')
|
||||
|
||||
option('mode', type : 'combo', choices : ['default', 'developer'],
|
||||
description : 'enable additional checks suitable for systemd development')
|
||||
|
||||
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||
description : '''/bin, /sbin aren't symlinks into /usr''')
|
||||
option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||
|
|
|
@ -13,11 +13,36 @@
|
|||
#include "main-func.h"
|
||||
#include "mkdir.h"
|
||||
#include "parse-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "terminal-util.h"
|
||||
#include "reboot-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "util.h"
|
||||
|
||||
static int help(void) {
|
||||
_cleanup_free_ char *link = NULL;
|
||||
int r;
|
||||
|
||||
r = terminal_urlify_man("systemd-backlight", "8", &link);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
printf("%s save [backlight|leds]:DEVICE\n"
|
||||
"%s load [backlight|leds]:DEVICE\n"
|
||||
"\n%sSave and restore backlight brightness at shutdown and boot.%s\n\n"
|
||||
" save Save current brightness\n"
|
||||
" load Set brightness to be the previously saved value\n"
|
||||
"\nSee the %s for details.\n"
|
||||
, program_invocation_short_name
|
||||
, program_invocation_short_name
|
||||
, ansi_highlight(), ansi_normal()
|
||||
, link
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int find_pci_or_platform_parent(sd_device *device, sd_device **ret) {
|
||||
const char *subsystem, *sysname, *value;
|
||||
sd_device *parent;
|
||||
|
@ -334,6 +359,9 @@ static int run(int argc, char *argv[]) {
|
|||
|
||||
log_setup_service();
|
||||
|
||||
if (strv_contains(strv_skip(argv, 1), "--help"))
|
||||
return help();
|
||||
|
||||
if (argc != 3)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "This program requires two arguments.");
|
||||
|
||||
|
|
|
@ -6,31 +6,34 @@
|
|||
/* 3a101b8de0d39403b2c7e5c23fd0b005668acf48 (3.16) */
|
||||
#ifndef CAP_AUDIT_READ
|
||||
# define CAP_AUDIT_READ 37
|
||||
|
||||
#undef CAP_LAST_CAP
|
||||
#define CAP_LAST_CAP CAP_AUDIT_READ
|
||||
#endif
|
||||
|
||||
/* 980737282232b752bb14dab96d77665c15889c36 (5.8) */
|
||||
#ifndef CAP_PERFMON
|
||||
# define CAP_PERFMON 38
|
||||
|
||||
#undef CAP_LAST_CAP
|
||||
#define CAP_LAST_CAP CAP_PERFMON
|
||||
#endif
|
||||
|
||||
/* a17b53c4a4b55ec322c132b6670743612229ee9c (5.8) */
|
||||
#ifndef CAP_BPF
|
||||
# define CAP_BPF 39
|
||||
|
||||
#undef CAP_LAST_CAP
|
||||
#define CAP_LAST_CAP CAP_BPF
|
||||
#endif
|
||||
|
||||
/* 124ea650d3072b005457faed69909221c2905a1f (5.9) */
|
||||
#ifndef CAP_CHECKPOINT_RESTORE
|
||||
# define CAP_CHECKPOINT_RESTORE 40
|
||||
|
||||
#undef CAP_LAST_CAP
|
||||
#define CAP_LAST_CAP CAP_CHECKPOINT_RESTORE
|
||||
#endif
|
||||
|
||||
#define SYSTEMD_CAP_LAST_CAP CAP_CHECKPOINT_RESTORE
|
||||
|
||||
#ifdef CAP_LAST_CAP
|
||||
# if CAP_LAST_CAP > SYSTEMD_CAP_LAST_CAP
|
||||
# if DEVELOPER_MODE && defined(TEST_CAPABILITY_C)
|
||||
# warning "The capability list here is outdated"
|
||||
# endif
|
||||
# else
|
||||
# undef CAP_LAST_CAP
|
||||
# endif
|
||||
#endif
|
||||
#ifndef CAP_LAST_CAP
|
||||
# define CAP_LAST_CAP SYSTEMD_CAP_LAST_CAP
|
||||
#endif
|
||||
|
|
|
@ -915,20 +915,19 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (action == DEVICE_ACTION_CHANGE)
|
||||
if (!IN_SET(action, DEVICE_ACTION_ADD, DEVICE_ACTION_REMOVE, DEVICE_ACTION_MOVE))
|
||||
device_propagate_reload_by_sysfs(m, sysfs);
|
||||
|
||||
/* A change event can signal that a device is becoming ready, in particular if
|
||||
* the device is using the SYSTEMD_READY logic in udev
|
||||
* so we need to reach the else block of the following if, even for change events */
|
||||
/* A change event can signal that a device is becoming ready, in particular if the device is using
|
||||
* the SYSTEMD_READY logic in udev so we need to reach the else block of the following if, even for
|
||||
* change events */
|
||||
if (action == DEVICE_ACTION_REMOVE) {
|
||||
r = swap_process_device_remove(m, dev);
|
||||
if (r < 0)
|
||||
log_device_warning_errno(dev, r, "Failed to process swap device remove event, ignoring: %m");
|
||||
|
||||
/* If we get notified that a device was removed by
|
||||
* udev, then it's completely gone, hence unset all
|
||||
* found bits */
|
||||
/* If we get notified that a device was removed by udev, then it's completely gone, hence
|
||||
* unset all found bits */
|
||||
device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT|DEVICE_FOUND_SWAP);
|
||||
|
||||
} else if (device_is_ready(dev)) {
|
||||
|
@ -944,13 +943,10 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
|
|||
/* The device is found now, set the udev found bit */
|
||||
device_update_found_by_sysfs(m, sysfs, DEVICE_FOUND_UDEV, DEVICE_FOUND_UDEV);
|
||||
|
||||
} else {
|
||||
/* The device is nominally around, but not ready for
|
||||
* us. Hence unset the udev bit, but leave the rest
|
||||
* around. */
|
||||
|
||||
} else
|
||||
/* The device is nominally around, but not ready for us. Hence unset the udev bit, but leave
|
||||
* the rest around. */
|
||||
device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_UDEV);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1+ */
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define TEST_CAPABILITY_C
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "capability-util.h"
|
||||
#include "errno-util.h"
|
||||
|
|
|
@ -350,7 +350,7 @@ int main(int argc, char *argv[]) {
|
|||
assert_se(set_unit_path(test_path) >= 0);
|
||||
assert_se(runtime_dir = setup_fake_runtime_dir());
|
||||
|
||||
for (const test_function_t *test = tests; test && *test; test++) {
|
||||
for (const test_function_t *test = tests; *test; test++) {
|
||||
Manager *m = NULL;
|
||||
int r;
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ test_create_image() {
|
|||
instmods dm_verity =md
|
||||
install_dmevent
|
||||
generate_module_dependencies
|
||||
inst_binary sfdisk
|
||||
inst_binary losetup
|
||||
|
||||
BASICTOOLS=(
|
||||
|
@ -41,7 +40,7 @@ test_create_image() {
|
|||
mkdir -p $initdir
|
||||
setup_basic_dirs
|
||||
install_basic_tools
|
||||
inst /usr/lib/os-release
|
||||
cp $os_release $initdir/usr/lib/os-release
|
||||
ln -s ../usr/lib/os-release $initdir/etc/os-release
|
||||
echo MARKER=1 >> $initdir/usr/lib/os-release
|
||||
mksquashfs $initdir $oldinitdir/usr/share/minimal.raw
|
||||
|
|
|
@ -9,7 +9,8 @@ mkdir -p "$root"
|
|||
mkdir "$root/bin"
|
||||
cp $(type -P busybox) "$root/bin"
|
||||
|
||||
ID_LIKE=$(awk -F= '$1=="ID_LIKE" { print $2 ;}' /etc/os-release)
|
||||
os_release=$(test -e /etc/os-release && echo /etc/os-release || echo /usr/lib/os-release)
|
||||
ID_LIKE=$(awk -F= '$1=="ID_LIKE" { print $2 ;}' $os_release)
|
||||
if [[ "$ID_LIKE" = *"suse"* ]]; then
|
||||
mkdir -p "$root/lib"
|
||||
mkdir -p "$root/lib64"
|
||||
|
|
|
@ -4,9 +4,10 @@
|
|||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export PATH
|
||||
|
||||
LOOKS_LIKE_DEBIAN=$(source /etc/os-release && [[ "$ID" = "debian" || " $ID_LIKE " = *" debian "* ]] && echo yes || :)
|
||||
LOOKS_LIKE_ARCH=$(source /etc/os-release && [[ "$ID" = "arch" || " $ID_LIKE " = *" arch "* ]] && echo yes || :)
|
||||
LOOKS_LIKE_SUSE=$(source /etc/os-release && [[ " $ID_LIKE " = *" suse "* ]] && echo yes || :)
|
||||
os_release=$(test -e /etc/os-release && echo /etc/os-release || echo /usr/lib/os-release)
|
||||
LOOKS_LIKE_DEBIAN=$(source $os_release && [[ "$ID" = "debian" || " $ID_LIKE " = *" debian "* ]] && echo yes || :)
|
||||
LOOKS_LIKE_ARCH=$(source $os_release && [[ "$ID" = "arch" || " $ID_LIKE " = *" arch "* ]] && echo yes || :)
|
||||
LOOKS_LIKE_SUSE=$(source $os_release && [[ " $ID_LIKE " = *" suse "* ]] && echo yes || :)
|
||||
KERNEL_VER=${KERNEL_VER-$(uname -r)}
|
||||
KERNEL_MODS="/lib/modules/$KERNEL_VER/"
|
||||
QEMU_TIMEOUT="${QEMU_TIMEOUT:-infinity}"
|
||||
|
@ -639,7 +640,8 @@ install_dmevent() {
|
|||
}
|
||||
|
||||
install_systemd() {
|
||||
# install compiled files
|
||||
ddebug "Install compiled systemd"
|
||||
|
||||
local _ninja_bin=$(type -P ninja || type -P ninja-build)
|
||||
if [[ -z "$_ninja_bin" ]]; then
|
||||
dfatal "ninja was not found"
|
||||
|
@ -648,9 +650,6 @@ install_systemd() {
|
|||
(set -x; DESTDIR=$initdir "$_ninja_bin" -C $BUILD_DIR install)
|
||||
# remove unneeded documentation
|
||||
rm -fr $initdir/usr/share/{man,doc}
|
||||
# we strip binaries since debug symbols increase binaries size a lot
|
||||
# and it could fill the available space
|
||||
strip_binaries
|
||||
|
||||
[[ "$LOOKS_LIKE_SUSE" ]] && setup_suse
|
||||
|
||||
|
@ -940,7 +939,7 @@ install_config_files() {
|
|||
inst /etc/shells
|
||||
inst_any /etc/nsswitch.conf /usr/etc/nsswitch.conf
|
||||
inst /etc/pam.conf || :
|
||||
inst /etc/os-release
|
||||
inst_any /etc/os-release /usr/lib/os-release
|
||||
inst /etc/localtime
|
||||
# we want an empty environment
|
||||
> $initdir/etc/environment
|
||||
|
|
|
@ -28,22 +28,24 @@ cp /usr/share/minimal.* "${image_dir}/"
|
|||
image="${image_dir}/minimal"
|
||||
roothash="$(cat ${image}.roothash)"
|
||||
|
||||
os_release=$(test -e /etc/os-release && echo /etc/os-release || echo /usr/lib/os-release)
|
||||
|
||||
systemd-dissect --json=short ${image}.raw | grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"fstype":"squashfs","architecture":null,"verity":"external"'
|
||||
systemd-dissect ${image}.raw | grep -q -F "MARKER=1"
|
||||
systemd-dissect ${image}.raw | grep -q -F -f /usr/lib/os-release
|
||||
systemd-dissect ${image}.raw | grep -q -F -f $os_release
|
||||
|
||||
mv ${image}.verity ${image}.fooverity
|
||||
mv ${image}.roothash ${image}.foohash
|
||||
systemd-dissect --json=short ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"fstype":"squashfs","architecture":null,"verity":"external"'
|
||||
systemd-dissect ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F "MARKER=1"
|
||||
systemd-dissect ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F -f /usr/lib/os-release
|
||||
systemd-dissect ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F -f $os_release
|
||||
mv ${image}.fooverity ${image}.verity
|
||||
mv ${image}.foohash ${image}.roothash
|
||||
|
||||
mkdir -p ${image_dir}/mount ${image_dir}/mount2
|
||||
systemd-dissect --mount ${image}.raw ${image_dir}/mount
|
||||
cat ${image_dir}/mount/usr/lib/os-release | grep -q -F -f /usr/lib/os-release
|
||||
cat ${image_dir}/mount/etc/os-release | grep -q -F -f /usr/lib/os-release
|
||||
cat ${image_dir}/mount/usr/lib/os-release | grep -q -F -f $os_release
|
||||
cat ${image_dir}/mount/etc/os-release | grep -q -F -f $os_release
|
||||
cat ${image_dir}/mount/usr/lib/os-release | grep -q -F "MARKER=1"
|
||||
# Verity volume should be shared (opened only once)
|
||||
systemd-dissect --mount ${image}.raw ${image_dir}/mount2
|
||||
|
@ -118,11 +120,11 @@ VERITY_UUID=$(systemd-id128 -u show $(tail -c 32 ${image}.roothash) -u | tail -n
|
|||
systemd-dissect --json=short --root-hash ${roothash} ${image}.gpt | grep -q '{"rw":"ro","designator":"root","partition_uuid":"'$ROOT_UUID'","fstype":"squashfs","architecture":"x86-64","verity":"yes","node":'
|
||||
systemd-dissect --json=short --root-hash ${roothash} ${image}.gpt | grep -q '{"rw":"ro","designator":"root-verity","partition_uuid":"'$VERITY_UUID'","fstype":"DM_verity_hash","architecture":"x86-64","verity":null,"node":'
|
||||
systemd-dissect --root-hash ${roothash} ${image}.gpt | grep -q -F "MARKER=1"
|
||||
systemd-dissect --root-hash ${roothash} ${image}.gpt | grep -q -F -f /usr/lib/os-release
|
||||
systemd-dissect --root-hash ${roothash} ${image}.gpt | grep -q -F -f $os_release
|
||||
|
||||
systemd-dissect --root-hash ${roothash} --mount ${image}.gpt ${image_dir}/mount
|
||||
cat ${image_dir}/mount/usr/lib/os-release | grep -q -F -f /usr/lib/os-release
|
||||
cat ${image_dir}/mount/etc/os-release | grep -q -F -f /usr/lib/os-release
|
||||
cat ${image_dir}/mount/usr/lib/os-release | grep -q -F -f $os_release
|
||||
cat ${image_dir}/mount/etc/os-release | grep -q -F -f $os_release
|
||||
cat ${image_dir}/mount/usr/lib/os-release | grep -q -F "MARKER=1"
|
||||
umount ${image_dir}/mount
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: LGPL-2.1+
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
import sys
|
||||
import os
|
||||
|
@ -14,8 +15,6 @@ PARSER = etree.XMLParser(no_network=True,
|
|||
strip_cdata=False,
|
||||
resolve_entities=False)
|
||||
|
||||
PRINT_ERRORS = True
|
||||
|
||||
class NoCommand(Exception):
|
||||
pass
|
||||
|
||||
|
@ -37,7 +36,7 @@ def print_method(declarations, elem, *, prefix, file, is_signal=False):
|
|||
argname = arg.get('name')
|
||||
|
||||
if argname is None:
|
||||
if PRINT_ERRORS:
|
||||
if opts.print_errors:
|
||||
print(f'method {name}: argument {num+1} has no name', file=sys.stderr)
|
||||
argname = 'UNNAMED'
|
||||
|
||||
|
@ -120,9 +119,11 @@ def document_has_elem_with_text(document, elem, item_repr):
|
|||
else:
|
||||
return False
|
||||
|
||||
def check_documented(document, declarations):
|
||||
def check_documented(document, declarations, stats):
|
||||
missing = []
|
||||
for klass, items in declarations.items():
|
||||
stats['total'] += len(items)
|
||||
|
||||
for item in items:
|
||||
if klass == 'method':
|
||||
elem = 'function'
|
||||
|
@ -137,10 +138,12 @@ def check_documented(document, declarations):
|
|||
assert False, (klass, item)
|
||||
|
||||
if not document_has_elem_with_text(document, elem, item_repr):
|
||||
if PRINT_ERRORS:
|
||||
if opts.print_errors:
|
||||
print(f'{klass} {item} is not documented :(')
|
||||
missing.append((klass, item))
|
||||
|
||||
stats['missing'] += len(missing)
|
||||
|
||||
return missing
|
||||
|
||||
def xml_to_text(destination, xml, *, only_interface=None):
|
||||
|
@ -165,7 +168,7 @@ def xml_to_text(destination, xml, *, only_interface=None):
|
|||
|
||||
return file.getvalue(), declarations, interfaces
|
||||
|
||||
def subst_output(document, programlisting):
|
||||
def subst_output(document, programlisting, stats):
|
||||
executable = programlisting.get('executable', None)
|
||||
if executable is None:
|
||||
# Not our thing
|
||||
|
@ -174,7 +177,7 @@ def subst_output(document, programlisting):
|
|||
node = programlisting.get('node')
|
||||
interface = programlisting.get('interface')
|
||||
|
||||
argv = [f'{build_dir}/{executable}', f'--bus-introspect={interface}']
|
||||
argv = [f'{opts.build_dir}/{executable}', f'--bus-introspect={interface}']
|
||||
print(f'COMMAND: {shlex.join(argv)}')
|
||||
|
||||
try:
|
||||
|
@ -189,7 +192,7 @@ def subst_output(document, programlisting):
|
|||
programlisting.text = '\n' + new_text + ' '
|
||||
|
||||
if declarations:
|
||||
missing = check_documented(document, declarations)
|
||||
missing = check_documented(document, declarations, stats)
|
||||
parent = programlisting.getparent()
|
||||
|
||||
# delete old comments
|
||||
|
@ -253,9 +256,11 @@ def process(page):
|
|||
if xml.tag != 'refentry':
|
||||
return
|
||||
|
||||
stats = collections.Counter()
|
||||
|
||||
pls = xml.findall('.//programlisting')
|
||||
for pl in pls:
|
||||
subst_output(xml, pl)
|
||||
subst_output(xml, pl, stats)
|
||||
|
||||
out_text = etree.tostring(xml, encoding='unicode')
|
||||
# massage format to avoid some lxml whitespace handling idiosyncrasies
|
||||
|
@ -264,20 +269,44 @@ def process(page):
|
|||
out_text[out_text.find('<refentryinfo'):] +
|
||||
'\n')
|
||||
|
||||
if not opts.test:
|
||||
with open(page, 'w') as out:
|
||||
out.write(out_text)
|
||||
|
||||
return dict(stats=stats, outdated=(out_text != src))
|
||||
|
||||
def parse_args():
|
||||
p = argparse.ArgumentParser()
|
||||
p.add_argument('--test', action='store_true',
|
||||
help='only verify that everything is up2date')
|
||||
p.add_argument('--build-dir', default='build')
|
||||
p.add_argument('pages', nargs='+')
|
||||
opts = p.parse_args()
|
||||
opts.print_errors = not opts.test
|
||||
return opts
|
||||
|
||||
if __name__ == '__main__':
|
||||
pages = sys.argv[1:]
|
||||
opts = parse_args()
|
||||
|
||||
if pages[0].startswith('--build-dir='):
|
||||
build_dir = pages[0].partition('=')[2]
|
||||
pages = pages[1:]
|
||||
else:
|
||||
build_dir = 'build'
|
||||
if not os.path.exists(f'{opts.build_dir}/systemd'):
|
||||
exit(f"{opts.build_dir}/systemd doesn't exist. Use --build-dir=.")
|
||||
|
||||
if not os.path.exists(f'{build_dir}/systemd'):
|
||||
exit(f"{build_dir}/systemd doesn't exist. Use --build-dir=.")
|
||||
stats = {page.split('/')[-1] : process(page) for page in opts.pages}
|
||||
|
||||
for page in pages:
|
||||
process(page)
|
||||
# Let's print all statistics at the end
|
||||
mlen = max(len(page) for page in stats)
|
||||
total = sum((item['stats'] for item in stats.values()), start=collections.Counter())
|
||||
total = 'total', dict(stats=total, outdated=False)
|
||||
outdated = []
|
||||
for page, info in sorted(stats.items()) + [total]:
|
||||
m = info['stats']['missing']
|
||||
t = info['stats']['total']
|
||||
p = page + ':'
|
||||
c = 'OUTDATED' if info['outdated'] else ''
|
||||
if c:
|
||||
outdated.append(page)
|
||||
print(f'{p:{mlen + 1}} {t - m}/{t} {c}')
|
||||
|
||||
if opts.test and outdated:
|
||||
exit(f'Outdated pages: {", ".join(outdated)}\n'
|
||||
f'Hint: ninja -C {opts.build_dir} man/update-dbus-docs')
|
||||
|
|
Loading…
Reference in New Issue