summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analyze/analyze.c38
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c4
-rw-r--r--src/udev/udev-builtin-path_id.c46
3 files changed, 60 insertions, 28 deletions
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index bce8026f40..d1ff156d12 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -1012,7 +1012,7 @@ static int analyze_time(sd_bus *bus) {
return 0;
}
-static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop, const char *color, char* patterns[]) {
+static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop, const char *color, char* patterns[], char* from_patterns[], char* to_patterns[]) {
_cleanup_strv_free_ char **units = NULL;
char **unit;
int r;
@@ -1024,9 +1024,9 @@ static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop,
match_patterns = strv_fnmatch(patterns, u->id, 0);
- if (!strv_isempty(arg_dot_from_patterns) &&
+ if (!strv_isempty(from_patterns) &&
!match_patterns &&
- !strv_fnmatch(arg_dot_from_patterns, u->id, 0))
+ !strv_fnmatch(from_patterns, u->id, 0))
return 0;
r = bus_get_unit_property_strv(bus, u->unit_path, prop, &units);
@@ -1038,9 +1038,9 @@ static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop,
match_patterns2 = strv_fnmatch(patterns, *unit, 0);
- if (!strv_isempty(arg_dot_to_patterns) &&
+ if (!strv_isempty(to_patterns) &&
!match_patterns2 &&
- !strv_fnmatch(arg_dot_to_patterns, *unit, 0))
+ !strv_fnmatch(to_patterns, *unit, 0))
continue;
if (!strv_isempty(patterns) && !match_patterns && !match_patterns2)
@@ -1052,35 +1052,35 @@ static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop,
return 0;
}
-static int graph_one(sd_bus *bus, const UnitInfo *u, char *patterns[]) {
+static int graph_one(sd_bus *bus, const UnitInfo *u, char *patterns[], char *from_patterns[], char *to_patterns[]) {
int r;
assert(bus);
assert(u);
if (arg_dot == DEP_ORDER ||arg_dot == DEP_ALL) {
- r = graph_one_property(bus, u, "After", "green", patterns);
+ r = graph_one_property(bus, u, "After", "green", patterns, from_patterns, to_patterns);
if (r < 0)
return r;
}
if (arg_dot == DEP_REQUIRE ||arg_dot == DEP_ALL) {
- r = graph_one_property(bus, u, "Requires", "black", patterns);
+ r = graph_one_property(bus, u, "Requires", "black", patterns, from_patterns, to_patterns);
if (r < 0)
return r;
- r = graph_one_property(bus, u, "RequiresOverridable", "black", patterns);
+ r = graph_one_property(bus, u, "RequiresOverridable", "black", patterns, from_patterns, to_patterns);
if (r < 0)
return r;
- r = graph_one_property(bus, u, "RequisiteOverridable", "darkblue", patterns);
+ r = graph_one_property(bus, u, "RequisiteOverridable", "darkblue", patterns, from_patterns, to_patterns);
if (r < 0)
return r;
- r = graph_one_property(bus, u, "Wants", "grey66", patterns);
+ r = graph_one_property(bus, u, "Wants", "grey66", patterns, from_patterns, to_patterns);
if (r < 0)
return r;
- r = graph_one_property(bus, u, "Conflicts", "red", patterns);
+ r = graph_one_property(bus, u, "Conflicts", "red", patterns, from_patterns, to_patterns);
if (r < 0)
return r;
- r = graph_one_property(bus, u, "ConflictedBy", "red", patterns);
+ r = graph_one_property(bus, u, "ConflictedBy", "red", patterns, from_patterns, to_patterns);
if (r < 0)
return r;
}
@@ -1134,6 +1134,8 @@ static int dot(sd_bus *bus, char* patterns[]) {
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_strv_free_ char **expanded_patterns = NULL;
+ _cleanup_strv_free_ char **expanded_from_patterns = NULL;
+ _cleanup_strv_free_ char **expanded_to_patterns = NULL;
int r;
UnitInfo u;
@@ -1141,6 +1143,14 @@ static int dot(sd_bus *bus, char* patterns[]) {
if (r < 0)
return r;
+ r = expand_patterns(bus, arg_dot_from_patterns, &expanded_from_patterns);
+ if (r < 0)
+ return r;
+
+ r = expand_patterns(bus, arg_dot_to_patterns, &expanded_to_patterns);
+ if (r < 0)
+ return r;
+
r = sd_bus_call_method(
bus,
"org.freedesktop.systemd1",
@@ -1163,7 +1173,7 @@ static int dot(sd_bus *bus, char* patterns[]) {
while ((r = bus_parse_unit_info(reply, &u)) > 0) {
- r = graph_one(bus, &u, expanded_patterns);
+ r = graph_one(bus, &u, expanded_patterns, expanded_from_patterns, expanded_to_patterns);
if (r < 0)
return r;
}
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index c97be2dabf..bb821797f1 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -526,9 +526,9 @@ static int add_boot(const char *what) {
what,
"/boot",
"vfat",
- "EFI System Partition Automount",
- false,
+ true,
"umask=0077",
+ "EFI System Partition Automount",
120 * USEC_PER_SEC);
return r;
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
index f529ffcf25..01e2c659ae 100644
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -317,6 +317,39 @@ out:
return parent;
}
+static struct udev_device *handle_scsi_ata(struct udev_device *parent, char **path) {
+ struct udev *udev = udev_device_get_udev(parent);
+ struct udev_device *targetdev;
+ struct udev_device *target_parent;
+ struct udev_device *atadev;
+ const char *port_no;
+
+ assert(parent);
+ assert(path);
+
+ targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
+ if (!targetdev)
+ return NULL;
+
+ target_parent = udev_device_get_parent(targetdev);
+ if (!target_parent)
+ return NULL;
+
+ atadev = udev_device_new_from_subsystem_sysname(udev, "ata_port", udev_device_get_sysname(target_parent));
+ if (!atadev)
+ return NULL;
+
+ port_no = udev_device_get_sysattr_value(atadev, "port_no");
+ if (!port_no) {
+ parent = NULL;
+ goto out;
+ }
+ path_prepend(path, "ata-%s", port_no);
+out:
+ udev_device_unref(atadev);
+ return parent;
+}
+
static struct udev_device *handle_scsi_default(struct udev_device *parent, char **path) {
struct udev_device *hostdev;
int host, bus, target, lun;
@@ -482,19 +515,8 @@ static struct udev_device *handle_scsi(struct udev_device *parent, char **path,
goto out;
}
- /*
- * We do not support the ATA transport class, it uses global counters
- * to name the ata devices which numbers spread across multiple
- * controllers.
- *
- * The real link numbers are not exported. Also, possible chains of ports
- * behind port multipliers cannot be composed that way.
- *
- * Until all that is solved at the kernel level, there are no by-path/
- * links for ATA devices.
- */
if (strstr(name, "/ata") != NULL) {
- parent = NULL;
+ parent = handle_scsi_ata(parent, path);
goto out;
}