1
0
mirror of https://github.com/systemd/systemd synced 2026-04-24 16:04:51 +02:00

Compare commits

..

18 Commits

Author SHA1 Message Date
Mariusz Tkaczyk
3a3b022d2c shutdown: get only active md arrays.
Current md_list_get() implementation filters all block devices, started from
"md*". This is ambiguous because list could contain:
- partitions created upon md device (mdXpY)
- external metadata container- specific type of md array.

For partitions there is no issue, because they aren't handle STOP_ARRAY
ioctl sent later. It generates misleading errors only.

Second case is more problematic because containers are not locked in kernel.
They are stopped even if container member array is active. For that reason
reboot or shutdown flow could be blocked because metadata manager cannot be
restarted after switch root on shutdown.

Add filters to remove partitions and containers from md_list. Partitions
can be excluded by DEVTYPE. Containers are determined by MD_LEVEL
property, we are excluding all with "container" value.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
2022-04-06 21:56:40 +01:00
Luca Boccassi
31cd2dd906 core: taint if /usr is unmerged
9afd5e7b975e8051c011ff9c07c95e80bd954469 introduced a build-time
taint, introduce a runtime one as well, in preparation for
removing support for unmerged-usr in a future release
2022-04-06 21:54:14 +01:00
Frantisek Sumsal
124d293268
Merge pull request #22996 from yuwata/test-sfdisk-lock
test: use "udevadm lock" more
2022-04-06 20:47:12 +00:00
Yu Watanabe
70a3ce51f3 test: drop unnecessary use of loop device
To avoid inferences with udevd.
2022-04-07 01:44:39 +09:00
Yu Watanabe
bc6bd62c0e test: use udevadm lock when partitioning block devices
We can use `sfdisk --lock` for these cases, but some CI environments
have old sfdisk which does not support `--lock` option.
2022-04-07 01:42:44 +09:00
Lennart Poettering
5645b4976e update TODO 2022-04-06 18:37:51 +02:00
Yu Watanabe
3452ae90ea test: --initialized=yes is the default for udevadm wait 2022-04-07 00:40:33 +09:00
Yu Watanabe
76b53bf54b
Merge pull request #22993 from keszybz/refactor-manager_taint_string()
Refactor manager_taint_string()
2022-04-07 00:36:45 +09:00
Zbigniew Jędrzejewski-Szmek
adbe000e3d hwdb: drop boilerplate about match patterns being unstable
We've had this text since the beginning, but in fact the patterns must be
stable in order for people to create local hwdb entries. And we support that
and can't change the match patterns without being very careful. So let's just
drop the text.
2022-04-06 23:16:39 +09:00
Daan De Meyer
cae7c28272 analyze: Fix verify exit status regression
Previously, systemd-analyze verify would return 0 even if warnings
were raised during analysis of the specified units or their
dependencies. With 3cc3dc7, verify was changed to return 1 when
warnings were raised.

This commit changes the default mode to _RECURSIVE_ERRORS_INVALID
so that verify returns zero again by default when warnings are
raised.
2022-04-06 23:16:02 +09:00
Yu Watanabe
2f88f2936c README: rawhide -> Rawhide 2022-04-06 23:14:21 +09:00
Yu Watanabe
588453b8b4
README: add rawhide SELinux build status (#22997)
Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
2022-04-06 14:13:10 +00:00
Yu Watanabe
2eeabd4489
Merge pull request #22983 from yuwata/login-use-symlinks-under-static_node-tags
login: shorten code a bit
2022-04-06 23:11:56 +09:00
Yu Watanabe
a9e832092a udev: add a brief comment about the origin of the filters
I am not sure whether the original discussions are correct or not.
This is just for adding references for future verification for the
filters.
2022-04-06 15:28:44 +02:00
Zbigniew Jędrzejewski-Szmek
e5f2d77b48 basic/strv: fix typos and confusion whether we are escaping or unescaping 2022-04-06 15:26:05 +02:00
Zbigniew Jędrzejewski-Szmek
226281b36d Add new test-manager.c and "test" manager_taint_string()
It seems it doesn't fit well anywhere else.
2022-04-06 15:26:05 +02:00
Zbigniew Jędrzejewski-Szmek
83fe5d8a78 manager: rework manager_taint_string()
When I see stpcpy, my brain bleeds. This function was too complicated
for it's own good.
2022-04-06 12:55:57 +02:00
Yu Watanabe
e992fd18a8 login: shorten code a bit
The symlinks under /run/udev/static_node-tags are pointing to the
corresponding device nodes. Let's read the symlinks.
2022-04-06 19:38:27 +09:00
23 changed files with 143 additions and 112 deletions

7
README
View File

@ -353,6 +353,13 @@ WARNINGS and TAINT FLAGS:
For more information on this issue consult
https://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken
systemd will warn if the filesystem is not usr-merged (i.e.: /bin, /sbin
and /lib* are not symlinks to their counterparts under /usr). Taint flag
'unmerged-usr' will be set when this condition is detected.
For more information on this issue consult
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge
systemd requires that the /run mount point exists. systemd also
requires that /var/run is a symlink to /run. Taint flag 'var-run-bad'
will be set when this condition is detected.

View File

@ -13,6 +13,7 @@ System and Service Manager
[![CentOS CI - CentOS 8](https://jenkins-systemd.apps.ocp.ci.centos.org/buildStatus/icon?subject=CentOS%20CI%20-%20CentOS%208&job=upstream-centos8)](https://jenkins-systemd.apps.ocp.ci.centos.org/job/upstream-centos8/)<br/>
[![CentOS CI - Arch](https://jenkins-systemd.apps.ocp.ci.centos.org/buildStatus/icon?subject=CentOS%20CI%20-%20Arch&job=upstream-vagrant-archlinux)](https://jenkins-systemd.apps.ocp.ci.centos.org/job/upstream-vagrant-archlinux/)<br/>
[![CentOS CI - Arch (sanitizers)](https://jenkins-systemd.apps.ocp.ci.centos.org/buildStatus/icon?subject=CentOS%20CI%20-%20Arch%20(sanitizers)&job=upstream-vagrant-archlinux-sanitizers)](https://jenkins-systemd.apps.ocp.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/)<br/>
[![CentOS CI - Rawhide (SELinux)](https://jenkins-systemd.apps.ocp.ci.centos.org/buildStatus/icon?subject=CentOS%20CI%20-%20Rawhide%20(SELinux)&job=upstream-vagrant-rawhide-selinux)](https://jenkins-systemd.apps.ocp.ci.centos.org/view/Upstream/job/upstream-vagrant-rawhide-selinux/)<br/>
[![Fossies codespell report](https://fossies.org/linux/test/systemd-main.tar.gz/codespell.svg)](https://fossies.org/linux/test/systemd-main.tar.gz/codespell.html)</br>
[![Coverage Status](https://coveralls.io/repos/github/systemd/systemd/badge.svg?branch=main)](https://coveralls.io/github/systemd/systemd?branch=main)</br>
[![Packaging status](https://repology.org/badge/tiny-repos/systemd.svg)](https://repology.org/project/systemd/versions)

7
TODO
View File

@ -78,6 +78,13 @@ Janitorial Clean-ups:
Features:
* get_color_mode() should probably check the $COLORTERM environment variable
which most terminal environments appear to set.
* firstboot: maybe just default to C.UTF-8 locale if nothing is set, so that we
don't query this unnecessarily in entirely uninitialized
containers. (i.e. containers with empty /etc).
* systemd creds hookup with qemu fw_cfg. (Quite possibly might not need any
code at all, given the fw_cfg stuff are just files, but we should then
document how to use it). Goal: provide symmetric ways to pass creds to nspawn

View File

@ -3,11 +3,6 @@
# The lookup keys are composed in:
# 60-evdev.rules
#
# Note: The format of the "evdev:" prefix match key is a contract between the
# rules file and the hardware data, it might change in later revisions to
# support more or better matches, it is not necessarily expected to be a stable
# ABI.
#
# Match string formats:
# evdev:<modalias>
# evdev:name:<device name>:dmi:<dmi string>

View File

@ -3,11 +3,6 @@
# The lookup keys are composed in:
# 60-input-id.rules
#
# Note: The format of the "input-id:" prefix match key is a contract between
# the rules file and the hardware data, it might change in later revisions to
# support more or better matches, it is not necessarily expected to be a stable
# ABI.
#
# Match string formats:
# id-input:modalias:<modalias>
#

View File

@ -13,11 +13,6 @@
# The lookup keys are composed in:
# 60-evdev.rules
#
# Note: The format of the "evdev:" prefix match key is a contract between the
# rules file and the hardware data, it might change in later revisions to
# support more or better matches, it is not necessarily expected to be a stable
# ABI.
#
# Supported hardware matches are:
# - Generic input devices match:
# evdev:input:bZZZZvYYYYpXXXXeWWWW-VVVV

View File

@ -3,11 +3,6 @@
# The lookup keys are composed in:
# 60-sensor.rules
#
# Note: The format of the "sensor:" prefix match key is a contract between the
# rules file and the hardware data, it might change in later revisions to
# support more or better matches, it is not necessarily expected to be a stable
# ABI.
#
# Match string formats:
# sensor:modalias:<parent modalias pattern>:dmi:<dmi pattern>
#

View File

@ -6,11 +6,6 @@
# The lookup keys are composed in:
# 70-mouse.rules
#
# Note: The format of the "mouse:" prefix match key is a contract between the
# rules file and the hardware data, it might change in later revisions to
# support more or better matches, it is not necessarily expected to be a stable
# ABI.
#
# Match key format:
# mouse:<subsystem>:v<vid>p<pid>:name:<name>:
#

View File

@ -7,10 +7,6 @@
# The lookup keys are composed in:
# 60-evdev.rules
#
# Note: The format of the "evdev:" prefix match key is a contract between the
# rules file and the hardware data, it might change in later revisions to
# support more or better matches, it is not necessarily a stable ABI.
#
# Supported hardware matches are:
# - Generic input devices match:
# evdev:input:bZZZZvYYYYpXXXXeWWWW-VVVV

View File

@ -819,10 +819,12 @@ $ systemd-analyze verify /tmp/source:alias.service
<listitem><para>Control verification of units and their dependencies and whether
<command>systemd-analyze verify</command> exits with a non-zero process exit status or not. With
<command>yes</command>, return a non-zero process exit status when warnings arise during verification
of either the specified unit or any of its associated dependencies. This is the default. With
<command>no</command>, return a non-zero process exit status when warnings arise during verification
of only the specified unit. With <command>one</command>, return a non-zero process exit status when
warnings arise during verification of either the specified unit or its immediate dependencies. </para></listitem>
of either the specified unit or any of its associated dependencies. With <command>no</command>,
return a non-zero process exit status when warnings arise during verification of only the specified
unit. With <command>one</command>, return a non-zero process exit status when warnings arise during
verification of either the specified unit or its immediate dependencies. If this option is not
specified, zero is returned as the exit status regardless whether warnings arise during verification
or not.</para></listitem>
</varlistentry>
<varlistentry>

View File

@ -90,7 +90,7 @@ PagerFlags arg_pager_flags = 0;
BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
const char *arg_host = NULL;
LookupScope arg_scope = LOOKUP_SCOPE_SYSTEM;
RecursiveErrors arg_recursive_errors = RECURSIVE_ERRORS_YES;
RecursiveErrors arg_recursive_errors = _RECURSIVE_ERRORS_INVALID;
bool arg_man = true;
bool arg_generators = false;
char *arg_root = NULL;

View File

@ -351,7 +351,7 @@ int strv_split_colon_pairs(char ***t, const char *s) {
return (int) n;
}
char* strv_join_full(char * const *l, const char *separator, const char *prefix, bool unescape_separators) {
char* strv_join_full(char * const *l, const char *separator, const char *prefix, bool escape_separator) {
char *r, *e;
size_t n, k, m;
@ -361,7 +361,7 @@ char* strv_join_full(char * const *l, const char *separator, const char *prefix,
k = strlen(separator);
m = strlen_ptr(prefix);
if (unescape_separators) /* If there separator is multi-char, we won't know how to escape it. */
if (escape_separator) /* If the separator was multi-char, we wouldn't know how to escape it. */
assert(k == 1);
n = 0;
@ -369,7 +369,7 @@ char* strv_join_full(char * const *l, const char *separator, const char *prefix,
if (s != l)
n += k;
bool needs_escaping = unescape_separators && strchr(*s, separator[0]);
bool needs_escaping = escape_separator && strchr(*s, *separator);
n += m + strlen(*s) * (1 + needs_escaping);
}
@ -386,11 +386,11 @@ char* strv_join_full(char * const *l, const char *separator, const char *prefix,
if (prefix)
e = stpcpy(e, prefix);
bool needs_escaping = unescape_separators && strchr(*s, separator[0]);
bool needs_escaping = escape_separator && strchr(*s, *separator);
if (needs_escaping)
for (size_t i = 0; (*s)[i]; i++) {
if ((*s)[i] == separator[0])
if ((*s)[i] == *separator)
*(e++) = '\\';
*(e++) = (*s)[i];
}

View File

@ -101,7 +101,7 @@ static inline char** strv_split_newlines(const char *s) {
* string in the vector is an empty string. */
int strv_split_colon_pairs(char ***t, const char *s);
char* strv_join_full(char * const *l, const char *separator, const char *prefix, bool escape_separtor);
char* strv_join_full(char * const *l, const char *separator, const char *prefix, bool escape_separator);
static inline char *strv_join(char * const *l, const char *separator) {
return strv_join_full(l, separator, NULL, false);
}

View File

@ -4370,71 +4370,58 @@ static int short_uid_range(const char *path) {
return !uid_range_covers(p, n, 0, 65535);
}
char *manager_taint_string(Manager *m) {
_cleanup_free_ char *destination = NULL, *overflowuid = NULL, *overflowgid = NULL;
struct utsname uts;
char *buf, *e;
int r;
/* Returns a "taint string", e.g. "local-hwclock:var-run-bad". Only things that are detected at
* runtime should be tagged here. For stuff that is set during compilation, emit a warning in the
char* manager_taint_string(const Manager *m) {
/* Returns a "taint string", e.g. "local-hwclock:var-run-bad". Only things that are detected at
* runtime should be tagged here. For stuff that is known during compilation, emit a warning in the
* configuration phase. */
assert(m);
buf = new(char, sizeof("split-usr:"
"cgroups-missing:"
"cgroupsv1:"
"local-hwclock:"
"var-run-bad:"
"overflowuid-not-65534:"
"overflowgid-not-65534:"
"old-kernel:"
"short-uid-range:"
"short-gid-range:"));
if (!buf)
return NULL;
e = buf;
buf[0] = 0;
const char* stage[12] = {};
size_t n = 0;
if (m->taint_usr)
e = stpcpy(e, "split-usr:");
stage[n++] = "split-usr";
_cleanup_free_ char *usrbin = NULL;
if (readlink_malloc("/bin", &usrbin) < 0 || !PATH_IN_SET(usrbin, "usr/bin", "/usr/bin"))
stage[n++] = "unmerged-usr";
if (access("/proc/cgroups", F_OK) < 0)
e = stpcpy(e, "cgroups-missing:");
stage[n++] = "cgroups-missing";
if (cg_all_unified() == 0)
e = stpcpy(e, "cgroupsv1:");
stage[n++] = "cgroupsv1";
if (clock_is_localtime(NULL) > 0)
e = stpcpy(e, "local-hwclock:");
stage[n++] = "local-hwclock";
r = readlink_malloc("/var/run", &destination);
if (r < 0 || !PATH_IN_SET(destination, "../run", "/run"))
e = stpcpy(e, "var-run-bad:");
_cleanup_free_ char *destination = NULL;
if (readlink_malloc("/var/run", &destination) < 0 ||
!PATH_IN_SET(destination, "../run", "/run"))
stage[n++] = "var-run-bad";
r = read_one_line_file("/proc/sys/kernel/overflowuid", &overflowuid);
if (r >= 0 && !streq(overflowuid, "65534"))
e = stpcpy(e, "overflowuid-not-65534:");
r = read_one_line_file("/proc/sys/kernel/overflowgid", &overflowgid);
if (r >= 0 && !streq(overflowgid, "65534"))
e = stpcpy(e, "overflowgid-not-65534:");
_cleanup_free_ char *overflowuid = NULL, *overflowgid = NULL;
if (read_one_line_file("/proc/sys/kernel/overflowuid", &overflowuid) >= 0 &&
!streq(overflowuid, "65534"))
stage[n++] = "overflowuid-not-65534";
if (read_one_line_file("/proc/sys/kernel/overflowgid", &overflowgid) >= 0 &&
!streq(overflowgid, "65534"))
stage[n++] = "overflowgid-not-65534";
struct utsname uts;
assert_se(uname(&uts) >= 0);
if (strverscmp_improved(uts.release, KERNEL_BASELINE_VERSION) < 0)
e = stpcpy(e, "old-kernel:");
stage[n++] = "old-kernel";
if (short_uid_range("/proc/self/uid_map") > 0)
e = stpcpy(e, "short-uid-range:");
stage[n++] = "short-uid-range";
if (short_uid_range("/proc/self/gid_map") > 0)
e = stpcpy(e, "short-gid-range:");
stage[n++] = "short-gid-range";
/* remove the last ':' */
if (e != buf)
e[-1] = 0;
assert(n < ELEMENTSOF(stage) - 1); /* One extra for NULL terminator */
return buf;
return strv_join((char**) stage, ":");
}
void manager_ref_console(Manager *m) {

View File

@ -551,7 +551,7 @@ int manager_ref_uid(Manager *m, uid_t uid, bool clean_ipc);
void manager_unref_gid(Manager *m, gid_t gid, bool destroy_now);
int manager_ref_gid(Manager *m, gid_t gid, bool clean_ipc);
char *manager_taint_string(Manager *m);
char* manager_taint_string(const Manager *m);
void manager_ref_console(Manager *m);
void manager_unref_console(Manager *m);

View File

@ -201,7 +201,7 @@ $D/zzz7 : start= 6291416, size= 98304, type=0FC63DAF-8483-4772-8E79-3D
EOF
LOOP="$(losetup -P --show --find "$D/zzz")"
"${udevadm:?}" wait --timeout 60 --initialized=yes --settle "${LOOP:?}"
"${udevadm:?}" wait --timeout 60 --settle "${LOOP:?}"
VOLUME="test-repart-$RANDOM"

View File

@ -9,9 +9,9 @@
#include "device-util.h"
#include "devnode-acl.h"
#include "dirent-util.h"
#include "escape.h"
#include "fd-util.h"
#include "format-util.h"
#include "fs-util.h"
#include "set.h"
#include "string-util.h"
#include "util.h"
@ -195,21 +195,18 @@ int devnode_acl_all(const char *seat,
dir = opendir("/run/udev/static_node-tags/uaccess");
if (dir) {
FOREACH_DIRENT(de, dir, return -errno) {
_cleanup_free_ char *unescaped_devname = NULL;
ssize_t l;
l = cunescape(de->d_name, UNESCAPE_RELAX, &unescaped_devname);
if (l < 0)
return l;
n = path_join("/dev", unescaped_devname);
if (!n)
return -ENOMEM;
r = readlinkat_malloc(dirfd(dir), de->d_name, &n);
if (r == -ENOENT)
continue;
if (r < 0) {
log_debug_errno(r,
"Unable to read symlink '/run/udev/static_node-tags/uaccess/%s', ignoring: %m",
de->d_name);
continue;
}
log_debug("Found static node %s for seat %s", n, seat);
r = set_consume(nodes, n);
if (r == -EEXIST)
continue;
if (r < 0)
return r;
}

View File

@ -352,9 +352,14 @@ static int md_list_get(MountPoint **head) {
if (r < 0)
return r;
/* Filter out partitions. */
r = sd_device_enumerator_add_match_property(e, "DEVTYPE", "disk");
if (r < 0)
return r;
FOREACH_DEVICE(e, d) {
_cleanup_free_ char *p = NULL;
const char *dn;
const char *dn, *md_level;
MountPoint *m;
dev_t devnum;
@ -362,6 +367,17 @@ static int md_list_get(MountPoint **head) {
sd_device_get_devname(d, &dn) < 0)
continue;
r = sd_device_get_property_value(d, "MD_LEVEL", &md_level);
if (r < 0) {
log_warning_errno(r, "Failed to get MD_LEVEL property for %s, ignoring: %m", dn);
continue;
}
/* MD "containers" are a special type of MD devices, used for external metadata.
* Since it doesn't provide RAID functionality in itself we don't need to stop it. */
if (streq(md_level, "container"))
continue;
p = strdup(dn);
if (!p)
return -ENOMEM;

View File

@ -56,6 +56,12 @@ tests += [
libblkid],
core_includes],
[files('test-manager.c'),
[libcore,
libshared],
[],
core_includes],
[files('test-emergency-action.c'),
[libcore,
libshared],

29
src/test/test-manager.c Normal file
View File

@ -0,0 +1,29 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "manager.h"
#include "tests.h"
TEST(manager_taint_string) {
Manager m = {};
_cleanup_free_ char *a = manager_taint_string(&m);
assert_se(a);
log_debug("taint string w/o split-usr: '%s'", a);
/* split-usr is the only one that is cached in Manager, so we know it's not present.
* The others are queried dynamically, so we'd need to duplicate the logic here
* to test for them. Let's do just one. */
assert_se(!strstr(a, "split-usr"));
if (cg_all_unified() == 0)
assert_se(strstr(a, "cgroupsv1"));
else
assert_se(!strstr(a, "cgroupsv1"));
m.taint_usr = true;
_cleanup_free_ char *b = manager_taint_string(&m);
assert_se(b);
log_debug("taint string w/ split-usr: '%s'", b);
assert_se(strstr(b, "split-usr"));
}
DEFINE_TEST_MAIN(LOG_DEBUG);

View File

@ -442,6 +442,12 @@ static int device_get_whole_disk(sd_device *dev, sd_device **ret_device, const c
if (r < 0)
return log_device_debug_errno(dev, r, "Failed to get sysname: %m");
/* Exclude the following devices:
* For "dm-", see the comment added by e918a1b5a94f270186dca59156354acd2a596494.
* For "md", see the commit message of 2e5b17d01347d3c3118be2b8ad63d20415dbb1f0,
* but not sure the assumption is still valid even when partitions are created on the md
* devices, surprisingly which seems to be possible, see PR #22973.
* For "drbd", see the commit message of fee854ee8ccde0cd28e0f925dea18cce35f3993d. */
if (STARTSWITH_SET(val, "dm-", "md", "drbd"))
goto irrelevant;

View File

@ -173,20 +173,22 @@ rm -r /tmp/testsuite-58.3-defs/
# testcase for #21817
mkdir -p /tmp/testsuite-58-issue-21817-defs/
truncate -s 100m /var/tmp/testsuite-58-issue-21817.img
LOOP=$(losetup -P --show -f /var/tmp/testsuite-58-issue-21817.img)
udevadm wait --timeout 60 --initialized=yes --settle "${LOOP:?}"
printf 'size=50M,type=%s\n,\n' "${root_guid}" | sfdisk -X gpt "$LOOP"
sfdisk /var/tmp/testsuite-58-issue-21817.img <<EOF
label: gpt
size=50M, type=${root_guid}
,
EOF
cat >/tmp/testsuite-58-issue-21817-defs/test.conf <<EOF
[Partition]
Type=root
EOF
systemd-repart --pretty=yes --definitions /tmp/testsuite-58-issue-21817-defs/ "$LOOP"
sfdisk --dump "$LOOP" | tee /tmp/testsuite-58-issue-21817.dump
losetup -d "$LOOP"
systemd-repart --pretty=yes --definitions /tmp/testsuite-58-issue-21817-defs/ --dry-run=no /var/tmp/testsuite-58-issue-21817.img
sfdisk --dump /var/tmp/testsuite-58-issue-21817.img | tee /tmp/testsuite-58-issue-21817.dump
grep -qiF "p1 : start= 2048, size= 102400, type=${root_guid}," /tmp/testsuite-58-issue-21817.dump
grep -qiF "/var/tmp/testsuite-58-issue-21817.img1 : start= 2048, size= 102400, type=${root_guid}," /tmp/testsuite-58-issue-21817.dump
# Accept both unpadded (pre-v2.38 util-linux) and padded (v2.38+ util-linux) sizes
grep -qE "p2 : start= 104448, size= (100319| 98304)," /tmp/testsuite-58-issue-21817.dump
grep -qE "/var/tmp/testsuite-58-issue-21817.img2 : start= 104448, size= (100319| 98304)," /tmp/testsuite-58-issue-21817.dump
rm /var/tmp/testsuite-58-issue-21817.img /tmp/testsuite-58-issue-21817.dump
rm -r /tmp/testsuite-58-issue-21817-defs/
@ -216,7 +218,7 @@ EOF
truncate -s 100m "/tmp/testsuite-58-sector-$1.img"
LOOP=$(losetup -b "$1" -P --show -f "/tmp/testsuite-58-sector-$1.img" )
udevadm wait --timeout 60 --initialized=yes --settle "${LOOP:?}"
udevadm wait --timeout 60 --settle "${LOOP:?}"
systemd-repart --pretty=yes --definitions=/tmp/testsuite-58-sector/ --seed=750b6cd5c4ae4012a15e7be3c29e6a47 --empty=require --dry-run=no "$LOOP"
rm -rf /tmp/testsuite-58-sector
sfdisk --verify "$LOOP"

View File

@ -168,7 +168,7 @@ $(printf 'name="test%d", size=2M\n' {1..50})
EOF
# Initial partition table
sfdisk -q -X gpt "$blockdev" <"$partscript"
udevadm lock --device="$blockdev" sfdisk -q -X gpt "$blockdev" <"$partscript"
# Delete the partitions, immediately recreate them, wait for udev to settle
# down, and then check if we have any dangling symlinks in /dev/disk/. Rinse
@ -177,8 +177,8 @@ EOF
# On unpatched udev versions the delete-recreate cycle may trigger a race
# leading to dead symlinks in /dev/disk/
for i in {1..100}; do
sfdisk -q --delete "$blockdev"
sfdisk -q -X gpt "$blockdev" <"$partscript"
udevadm lock --device="$blockdev" sfdisk -q --delete "$blockdev"
udevadm lock --device="$blockdev" sfdisk -q -X gpt "$blockdev" <"$partscript"
if ((i % 10 == 0)); then
udevadm wait --settle --timeout=30 "$blockdev"
@ -281,7 +281,7 @@ testcase_btrfs_basic() {
echo "Multiple devices: using partitions, data: single, metadata: raid1"
uuid="deadbeef-dead-dead-beef-000000000001"
label="btrfs_mpart"
sfdisk --wipe=always "${devices[0]}" <<EOF
udevadm lock --device="${devices[0]}" sfdisk --wipe=always "${devices[0]}" <<EOF
label: gpt
name="diskpart1", size=85M