mirror of
https://github.com/systemd/systemd
synced 2025-11-21 01:34:44 +01:00
Compare commits
No commits in common. "2fbfbfc5fad59031d0351e600c058b3ad218c338" and "1df624422a23b28d0a18ae60af50a95c51c6d43a" have entirely different histories.
2fbfbfc5fa
...
1df624422a
2
.github/workflows/mkosi.yml
vendored
2
.github/workflows/mkosi.yml
vendored
@ -137,7 +137,7 @@ jobs:
|
|||||||
sanitizers: ""
|
sanitizers: ""
|
||||||
llvm: 0
|
llvm: 0
|
||||||
cflags: "-Og"
|
cflags: "-Og"
|
||||||
relabel: yes
|
relabel: no
|
||||||
vm: 0
|
vm: 0
|
||||||
no_qemu: 0
|
no_qemu: 0
|
||||||
no_kvm: 0
|
no_kvm: 0
|
||||||
|
|||||||
@ -61,7 +61,6 @@ Packages=
|
|||||||
libdw-devel
|
libdw-devel
|
||||||
libdw1
|
libdw1
|
||||||
libtss2-tcti-device0
|
libtss2-tcti-device0
|
||||||
libz1
|
|
||||||
man
|
man
|
||||||
multipath-tools
|
multipath-tools
|
||||||
ncat
|
ncat
|
||||||
|
|||||||
@ -34,8 +34,6 @@ SUBSYSTEM=="net", IMPORT{builtin}="net_driver"
|
|||||||
SUBSYSTEM=="ptp", GROUP="clock", MODE="0660"
|
SUBSYSTEM=="ptp", GROUP="clock", MODE="0660"
|
||||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK+="ptp_kvm"
|
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK+="ptp_kvm"
|
||||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK+="ptp_hyperv"
|
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK+="ptp_hyperv"
|
||||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="s390 Physical Clock", SYMLINK+="ptp_s390_physical"
|
|
||||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="s390 STCKE Clock", SYMLINK+="ptp_s390_stcke"
|
|
||||||
|
|
||||||
ACTION!="add", GOTO="default_end"
|
ACTION!="add", GOTO="default_end"
|
||||||
|
|
||||||
|
|||||||
@ -1518,40 +1518,30 @@ int path_glob_can_match(const char *pattern, const char *prefix, char **ret) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_SPLIT_BIN
|
|
||||||
static bool dir_is_split(const char *a, const char *b) {
|
|
||||||
int r;
|
|
||||||
|
|
||||||
r = inode_same(a, b, AT_NO_AUTOMOUNT);
|
|
||||||
if (r < 0 && r != -ENOENT) {
|
|
||||||
log_debug_errno(r, "Failed to compare \"%s\" and \"%s\", assuming split directories: %m", a, b);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return r == 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char* default_PATH(void) {
|
const char* default_PATH(void) {
|
||||||
#if HAVE_SPLIT_BIN
|
#if HAVE_SPLIT_BIN
|
||||||
static const char *default_path = NULL;
|
static int split = -1;
|
||||||
|
int r;
|
||||||
|
|
||||||
/* Return one of the three sets of paths:
|
/* Check whether /usr/sbin is not a symlink and return the appropriate $PATH.
|
||||||
* a) split /usr/s?bin, /usr/local/sbin doesn't matter.
|
* On error fall back to the safe value with both directories as configured… */
|
||||||
* b) merged /usr/s?bin, /usr/sbin is a symlink, but /usr/local/sbin is not,
|
|
||||||
* c) fully merged, neither /usr/sbin nor /usr/local/sbin are symlinks,
|
|
||||||
*
|
|
||||||
* On error the fallback to the safe value with both directories as configured is returned.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (default_path)
|
if (split < 0)
|
||||||
return default_path;
|
STRV_FOREACH_PAIR(bin, sbin, STRV_MAKE("/usr/bin", "/usr/sbin",
|
||||||
|
"/usr/local/bin", "/usr/local/sbin")) {
|
||||||
if (dir_is_split("/usr/sbin", "/usr/bin"))
|
r = inode_same(*bin, *sbin, AT_NO_AUTOMOUNT);
|
||||||
return (default_path = DEFAULT_PATH_WITH_FULL_SBIN); /* a */
|
if (r > 0 || r == -ENOENT)
|
||||||
if (dir_is_split("/usr/local/sbin", "/usr/local/bin"))
|
continue;
|
||||||
return (default_path = DEFAULT_PATH_WITH_LOCAL_SBIN); /* b */
|
if (r < 0)
|
||||||
return (default_path = DEFAULT_PATH_WITHOUT_SBIN); /* c */
|
log_debug_errno(r, "Failed to compare \"%s\" and \"%s\", using compat $PATH: %m",
|
||||||
#else
|
*bin, *sbin);
|
||||||
return DEFAULT_PATH_WITHOUT_SBIN;
|
split = true;
|
||||||
#endif
|
break;
|
||||||
|
}
|
||||||
|
if (split < 0)
|
||||||
|
split = false;
|
||||||
|
if (split)
|
||||||
|
return DEFAULT_PATH_WITH_SBIN;
|
||||||
|
#endif
|
||||||
|
return DEFAULT_PATH_WITHOUT_SBIN;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,11 +9,10 @@
|
|||||||
#define PATH_MERGED_BIN(x) x "bin"
|
#define PATH_MERGED_BIN(x) x "bin"
|
||||||
#define PATH_MERGED_BIN_NULSTR(x) x "bin\0"
|
#define PATH_MERGED_BIN_NULSTR(x) x "bin\0"
|
||||||
|
|
||||||
#define DEFAULT_PATH_WITH_FULL_SBIN PATH_SPLIT_BIN("/usr/local/") ":" PATH_SPLIT_BIN("/usr/")
|
#define DEFAULT_PATH_WITH_SBIN PATH_SPLIT_BIN("/usr/local/") ":" PATH_SPLIT_BIN("/usr/")
|
||||||
#define DEFAULT_PATH_WITH_LOCAL_SBIN PATH_SPLIT_BIN("/usr/local/") ":" PATH_MERGED_BIN("/usr/")
|
|
||||||
#define DEFAULT_PATH_WITHOUT_SBIN PATH_MERGED_BIN("/usr/local/") ":" PATH_MERGED_BIN("/usr/")
|
#define DEFAULT_PATH_WITHOUT_SBIN PATH_MERGED_BIN("/usr/local/") ":" PATH_MERGED_BIN("/usr/")
|
||||||
|
|
||||||
#define DEFAULT_PATH_COMPAT DEFAULT_PATH_WITH_FULL_SBIN ":" PATH_SPLIT_BIN("/")
|
#define DEFAULT_PATH_COMPAT PATH_SPLIT_BIN("/usr/local/") ":" PATH_SPLIT_BIN("/usr/") ":" PATH_SPLIT_BIN("/")
|
||||||
|
|
||||||
const char* default_PATH(void);
|
const char* default_PATH(void);
|
||||||
|
|
||||||
|
|||||||
@ -392,8 +392,7 @@ static void timer_enter_waiting(Timer *t, bool time_change) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (v->base == TIMER_CALENDAR) {
|
if (v->base == TIMER_CALENDAR) {
|
||||||
bool rebase_after_boot_time = false;
|
usec_t b, rebased, random_offset = 0;
|
||||||
usec_t b, random_offset = 0;
|
|
||||||
|
|
||||||
if (t->random_offset_usec != 0)
|
if (t->random_offset_usec != 0)
|
||||||
random_offset = timer_get_fixed_delay_hash(t) % t->random_offset_usec;
|
random_offset = timer_get_fixed_delay_hash(t) % t->random_offset_usec;
|
||||||
@ -418,10 +417,8 @@ static void timer_enter_waiting(Timer *t, bool time_change) {
|
|||||||
b = t->last_trigger.realtime;
|
b = t->last_trigger.realtime;
|
||||||
else if (dual_timestamp_is_set(&UNIT(t)->inactive_exit_timestamp))
|
else if (dual_timestamp_is_set(&UNIT(t)->inactive_exit_timestamp))
|
||||||
b = UNIT(t)->inactive_exit_timestamp.realtime - random_offset;
|
b = UNIT(t)->inactive_exit_timestamp.realtime - random_offset;
|
||||||
else {
|
else
|
||||||
b = ts.realtime - random_offset;
|
b = ts.realtime - random_offset;
|
||||||
rebase_after_boot_time = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = calendar_spec_next_usec(v->calendar_spec, b, &v->next_elapse);
|
r = calendar_spec_next_usec(v->calendar_spec, b, &v->next_elapse);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -429,16 +426,14 @@ static void timer_enter_waiting(Timer *t, bool time_change) {
|
|||||||
|
|
||||||
v->next_elapse += random_offset;
|
v->next_elapse += random_offset;
|
||||||
|
|
||||||
if (rebase_after_boot_time) {
|
|
||||||
/* To make the delay due to RandomizedDelaySec= work even at boot, if the scheduled
|
/* To make the delay due to RandomizedDelaySec= work even at boot, if the scheduled
|
||||||
* time has already passed, set the time when systemd first started as the scheduled
|
* time has already passed, set the time when systemd first started as the scheduled
|
||||||
* time. Note that we base this on the monotonic timestamp of the boot, not the
|
* time. Note that we base this on the monotonic timestamp of the boot, not the
|
||||||
* realtime one, since the wallclock might have been off during boot. */
|
* realtime one, since the wallclock might have been off during boot. */
|
||||||
usec_t rebased = map_clock_usec(UNIT(t)->manager->timestamps[MANAGER_TIMESTAMP_USERSPACE].monotonic,
|
rebased = map_clock_usec(UNIT(t)->manager->timestamps[MANAGER_TIMESTAMP_USERSPACE].monotonic,
|
||||||
CLOCK_MONOTONIC, CLOCK_REALTIME);
|
CLOCK_MONOTONIC, CLOCK_REALTIME);
|
||||||
if (v->next_elapse < rebased)
|
if (v->next_elapse < rebased)
|
||||||
v->next_elapse = rebased;
|
v->next_elapse = rebased;
|
||||||
}
|
|
||||||
|
|
||||||
if (!found_realtime)
|
if (!found_realtime)
|
||||||
t->next_elapse_realtime = v->next_elapse;
|
t->next_elapse_realtime = v->next_elapse;
|
||||||
|
|||||||
@ -445,8 +445,8 @@ def main() -> None:
|
|||||||
summary = Summary.get(args)
|
summary = Summary.get(args)
|
||||||
|
|
||||||
# Keep list in sync with TEST-06-SELINUX.sh
|
# Keep list in sync with TEST-06-SELINUX.sh
|
||||||
if args.name == 'TEST-06-SELINUX' and summary.distribution not in ('centos', 'fedora', 'opensuse'):
|
if args.name == 'TEST-06-SELINUX' and summary.distribution not in ('fedora', 'centos'):
|
||||||
print('Skipping TEST-06-SELINUX, only enabled for CentOS/Fedora/openSUSE', file=sys.stderr)
|
print('Skipping TEST-06-SELINUX, only enabled for Fedora/CentOS', file=sys.stderr)
|
||||||
exit(77)
|
exit(77)
|
||||||
|
|
||||||
if shell and not sys.stdin.isatty():
|
if shell and not sys.stdin.isatty():
|
||||||
|
|||||||
@ -4,8 +4,8 @@ set -eux
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
if ! [[ "$ID" =~ centos|fedora|opensuse ]]; then
|
if ! [[ "$ID" =~ centos|fedora ]]; then
|
||||||
echo "Skipping because only CentOS, Fedora and openSUSE support SELinux tests" >>/skipped
|
echo "Skipping because only CentOS and Fedora support SELinux tests" >>/skipped
|
||||||
exit 77
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -15,11 +15,11 @@ set -o pipefail
|
|||||||
. "$(dirname "$0")"/util.sh
|
. "$(dirname "$0")"/util.sh
|
||||||
|
|
||||||
UNIT_NAME="timer-RandomizedDelaySec-$RANDOM"
|
UNIT_NAME="timer-RandomizedDelaySec-$RANDOM"
|
||||||
TARGET_TS="$(date --date="tomorrow 00:10" "+%a %Y-%m-%d %H:%M:%S %Z")"
|
TARGET_TS="$(date --date="tomorrow 00:10")"
|
||||||
TARGET_TS_S="$(date --date="$TARGET_TS" "+%s")"
|
TARGET_TS_S="$(date --date="$TARGET_TS" "+%s")"
|
||||||
# Maximum possible next elapse timestamp: $TARGET_TS (OnCalendar=) + 22 hours (RandomizedDelaySec=)
|
# Maximum possible next elapse timestamp: $TARGET_TS (OnCalendar=) + 22 hours (RandomizedDelaySec=)
|
||||||
MAX_NEXT_ELAPSE_REALTIME_S="$((TARGET_TS_S + 22 * 60 * 60))"
|
MAX_NEXT_ELAPSE_REALTIME_S="$((TARGET_TS_S + 22 * 60 * 60))"
|
||||||
MAX_NEXT_ELAPSE_REALTIME="$(date --date="@$MAX_NEXT_ELAPSE_REALTIME_S" "+%a %Y-%m-%d %H:%M:%S %Z")"
|
MAX_NEXT_ELAPSE_REALTIME="$(date --date="@$MAX_NEXT_ELAPSE_REALTIME_S")"
|
||||||
|
|
||||||
# Let's make sure to return the date & time back to the original state once we're done with our time
|
# Let's make sure to return the date & time back to the original state once we're done with our time
|
||||||
# shenigans. One way to do this would be to use hwclock, but the RTC in VMs can be unreliable or slow to
|
# shenigans. One way to do this would be to use hwclock, but the RTC in VMs can be unreliable or slow to
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user