#!/bin/bash
#%stage: setup
#%depends: plymouth
#%programs: /usr/bin/plymouth /usr/sbin/plymouthd /usr/bin/readlink
#%dontshow

ply_init_is_systemd()
{
	local d="$init"
	[ -n "$d" ] || return 1
	if [ -L "/root$d" ]; then
		d=`readlink "/root$d"`
	fi
	[ "${d##*/}" = systemd ] || return 1
	return 0
}

if ply_init_is_systemd; then
	plymouth update-root-fs --new-root-dir=/root
else
	echo "init $init is not systemd, terminate plymouth"
	plymouth quit
fi
