#!/usr/bin/env /lib/runit/invoke-run
#Copyright: 2026 Aitor <aitor@genuen.org>
#License: CC0-1.0
#Comment: stage-2 oneshot in 01-core; waits for vdev control then seed+promote
#Comment: finish downs; shutdown companion is vdev-coldplug.sh-stop
#Comment: env from stage-1 boot-run; KMS is stage-1 (20-vdev-boot-vga-kms.sh)

set -eu
exec 2>&1
if [ -r /run/vdev/env ]; then
	# shellcheck disable=SC1091
	. /run/vdev/env
elif [ -r /lib/vdev/vdev-env.sh ]; then
	# shellcheck disable=SC1091
	. /lib/vdev/vdev-env.sh
else
	exit 0
fi
exec /lib/vdev/vdev-coldplug-boot.sh
