core: add Manager::honor_device_enumeration flag

When system manager is started first time or after switching root,
then the udev's device tag data do not exist yet.
So, let's not honor the enumeration results.

Fixes #11997.
This commit is contained in:
Yu Watanabe
2019-03-15 19:47:43 +09:00
parent 49052946c9
commit c6e892bc0e
3 changed files with 26 additions and 1 deletions
+5 -1
View File
@@ -666,9 +666,13 @@ static void device_found_changed(Device *d, DeviceFound previous, DeviceFound no
}
static void device_update_found_one(Device *d, DeviceFound found, DeviceFound mask) {
Manager *m;
assert(d);
if (MANAGER_IS_RUNNING(UNIT(d)->manager)) {
m = UNIT(d)->manager;
if (MANAGER_IS_RUNNING(m) && (m->honor_device_enumeration || MANAGER_IS_USER(m))) {
DeviceFound n, previous;
/* When we are already running, then apply the new mask right-away, and trigger state changes