Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[Unit]
Description=Mount OSTree /sysroot
Description=Ignition OSTree: Mount (firstboot) /sysroot
# These dependencies should match the "other" in
# ignition-ostree-mount-subsequent-sysroot.service
DefaultDependencies=false
# If root is specified, then systemd's generator will win
ConditionKernelCommandLine=!root
ConditionKernelCommandLine=ostree
ConditionPathExists=!/run/ostree-live

# There can be only one, Highlander style
Conflicts=ignition-ostree-mount-subsequent-sysroot.service
Before=initrd-root-fs.target
After=ignition-disks.service
# These have an explicit dependency on After=sysroot.mount today
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Unit]
Description=CoreOS: Mount (subsequent) /sysroot
# These dependencies should match the "other" in
# ignition-ostree-mount-firsboot-sysroot.service
DefaultDependencies=false
# If root is specified, then systemd's generator will win
ConditionKernelCommandLine=!root
ConditionKernelCommandLine=ostree
ConditionPathExists=!/run/ostree-live
# There can be only one, Highlander style
Conflicts=ignition-ostree-mount-firstboot-sysroot.service
# And in contrast to the firstboot, we expect
# the root device to be ready.
Requires=dev-disk-by\x2dlabel-root.device
After=dev-disk-by\x2dlabel-root.device
Before=initrd-root-fs.target
# This has an explicit dependency on After=sysroot.mount today
Before=ostree-prepare-root.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/ignition-ostree-mount-sysroot
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,26 @@ depends() {
}

install_ignition_unit() {
unit=$1; shift
local unit=$1; shift
local target=${1:-complete}
inst_simple "$moddir/$unit" "$systemdsystemunitdir/$unit"
ln_r "../$unit" "$systemdsystemunitdir/ignition-complete.target.requires/$unit"
local targetpath="$systemdsystemunitdir/ignition-${target}.target.requires/"
mkdir -p "${initdir}/${targetpath}"
ln_r "../$unit" "${targetpath}/${unit}"
}

install() {
inst_multiple \
systemd-sysusers \
systemd-tmpfiles

mkdir -p "$initdir/$systemdsystemunitdir/ignition-complete.target.requires"
for x in mount populate; do
install_ignition_unit ignition-ostree-${x}-var.service
inst_script "$moddir/ignition-ostree-${x}-var.sh" "/usr/sbin/ignition-ostree-${x}-var"
done

install_ignition_unit ignition-ostree-mount-var.service
inst_script "$moddir/ignition-ostree-mount-var.sh" \
"/usr/sbin/ignition-ostree-mount-var"

install_ignition_unit ignition-ostree-populate-var.service
inst_script "$moddir/ignition-ostree-populate-var.sh" \
"/usr/sbin/ignition-ostree-populate-var"

install_ignition_unit ignition-ostree-mount-sysroot.service
install_ignition_unit ignition-ostree-mount-firstboot-sysroot.service
install_ignition_unit ignition-ostree-mount-subsequent-sysroot.service subsequent
inst_script "$moddir/ignition-ostree-mount-sysroot.sh" \
"/usr/sbin/ignition-ostree-mount-sysroot"
}