combustion/combustion.rules
Ignaz Forster 651ee08f24 Accepting request 835192 from home:favogt:combustion
- Overhaul configuration fetching:
  * Add udev rules to wait for either ignition, combustion or
    fw_cfg drives
  * Allow combustion.firstboot in addition to ignition.firstboot
  M combustion
  A combustion-prepare.service
  M combustion.service
  M module-setup.sh
- Bump version to 0.2

OBS-URL: https://build.opensuse.org/request/show/835192
OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/combustion?expand=0&rev=7
2020-09-18 07:12:39 +00:00

28 lines
1.4 KiB
Plaintext

# SPDX-FileCopyrightText: 2020 SUSE LLC
# SPDX-License-Identifier: GPL-2.0-only
# These rules are needed to work around two systemd limitations:
# - It's not possible to wait for one of multiple devices to appear
# - ConditionKernelCommandLine is evaluated after Wants/After,
# so it waits for the devices unnecessarily
# Introduce a dev-combustion-config.device unit as alias to the actual device(s).
# This is only used for the .service dependencies.
# Filesystems with either combustion or ignition as label
ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_LABEL}=="combustion", ENV{SYSTEMD_ALIAS}+="/dev/combustion/config"
ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_LABEL}=="ignition", ENV{SYSTEMD_ALIAS}+="/dev/combustion/config"
# QEMU fw_cfg blob with key opt/org.opensuse.combustion
ACTION=="add", SUBSYSTEM=="opt", ENV{DEVPATH}=="/firmware/qemu_fw_cfg/by_name/opt/org.opensuse.combustion", ENV{SYSTEMD_ALIAS}+="/dev/combustion/config", TAG+="systemd"
# If combustion won't run, alias it to /dev/null to avoid waiting
ACTION=="add", SUBSYSTEM=="mem", ENV{DEVPATH}=="/devices/virtual/mem/null", GOTO="combustion_dev_null"
GOTO="combustion_end"
LABEL="combustion_dev_null"
# IMPORT has to be on its own as it returns success or not, even with "="...
IMPORT{cmdline}="ignition.firstboot"
IMPORT{cmdline}="combustion.firstboot"
ENV{ignition.firstboot}!="1", ENV{combustion.firstboot}!="1", ENV{SYSTEMD_ALIAS}+="/dev/combustion/config", TAG+="systemd"
LABEL="combustion_end"