#!/bin/sh check() { local _program . $dracutfunctions for _program in iwconfig wpa_supplicant localectl \ chroot systemd-nspawn vncpasswd hostname mcored; do if ! type -P $_program >/dev/null; then derror "Could not find program \"$_program\" required by mcored." return 1 fi done return 255 } depends() { echo busybox systemd network } install() { local __file # add missing users if ! egrep '^lp:' "$initdir@@SYSCONFDIR@@/passwd" 2> /dev/null then egrep '^lp:' @@SYSCONFDIR@@/passwd >> "$initdir@@SYSCONFDIR@@/passwd" fi # add MCORE_UNPRIV_USER if ! egrep '^@@MCORE_UNPRIV_USER@@:' "$initdir@@SYSCONFDIR@@/passwd" 2> /dev/null then egrep '^@@MCORE_UNPRIV_USER@@:' @@SYSCONFDIR@@/passwd >> "$initdir@@SYSCONFDIR@@/passwd" fi # add missing groups if ! egrep '^lp:' "$initdir@@SYSCONFDIR@@/group" 2> /dev/null then egrep '^lp:' @@SYSCONFDIR@@/group >> "$initdir@@SYSCONFDIR@@/group" fi if ! egrep '^@@MCORE_UNPRIV_GROUP@@:' "$initdir@@SYSCONFDIR@@/group" 2> /dev/null then egrep '^@@MCORE_UNPRIV_GROUP@@:' @@SYSCONFDIR@@/group >> "$initdir@@SYSCONFDIR@@/group" fi # other stuff required by mcored dracut_install iwconfig wpa_supplicant chroot systemd-nspawn # mcored config stuff dracut_install hwinfo vncpasswd localectl # mcored # install things which are needed but not provided by our busybox dracut_install find install sslsvd touch inst @@SYSCONFDIR@@/mageversion inst @@SSLDIR@@/certs/mcored.pem inst @@SSLDIR@@/private/mcored.key inst_dir @@MCORE_CHROOTDIR@@ inst @@CONFDDIR@@/mcored inst @@SYSCONFDIR@@/mcoredpasswd for __file in $(find @@SYSCONFDIR@@/mcore @@MCORE_LIBDIR@@ -type f) do inst ${__file} done inst_symlink @@SBINDIR@@/mcored inst_symlink @@SBINDIR@@/mcorepasswd inst_hook pre-pivot 90 "$moddir"/run-mcored.sh }