minitdir=etc/minit

install_minit()
{
	if [ -d $base/package/*/minit/inits/$1 ] ; then
	  echo "Installing minit config ..."
	  [ -d $root/$minitdir/$1 ] || mkdir $root/$minitdir/$1
	  for x in $(cd $base/package/*/minit/inits;
	             find $1 ! -path '*/.*'  -type f); do
		src="$base/package/*/minit/inits/$x"
		trg="$root/$minitdir/$x"

		mkdir -p `dirname $trg`
		if [[ $x = */run ]] && grep '^ln -s' $src; then
			rm -f $trg ; `cat $src` $trg
		else
			cp -fv $src $trg
			chmod +x $trg
		fi
	  done
	else
	  abort "No minit config known for $1"
	fi
}