#!/bin/sh
#
# Usage: eos-live-boot-generator normal-dir [...]
#
# Conditionally adds additional boot dependencies for live boots.
# This script implements systemd.generator(7).

dest_dir="${1:?normal-dir argument missing}"

# Check $proc_cmdline, if set, for testing purposes
if grep -q "\<endless.live_boot\>" "${proc_cmdline:-/proc/cmdline}"; then
	# Don't try to remount the (read-only) root filesystem read-write
	ln -sf /dev/null "$dest_dir/systemd-remount-fs.service"
fi
