--- mcore-src/trunk/mcore-tools/dracut/module-setup.sh 2013/05/08 14:17:54 2068 +++ mcore-src/trunk/mcore-tools/dracut/module-setup.sh.in 2014/07/11 12:48:05 2321 @@ -4,7 +4,8 @@ local _program . $dracutfunctions - for _program in ifconfig ip route udhcpc; do + 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 @@ -15,104 +16,38 @@ } depends() { - return 0 -} - -installkernel() { - net_module_filter() { - local _net_drivers='eth_type_trans|register_virtio_device' - local _unwanted_drivers='/(isdn|uwb)/' - local _ret - # subfunctions inherit following FDs - local _merge=8 _side2=9 - function nmf1() { - local _fname _fcont - while read _fname; do - [[ $_fname =~ $_unwanted_drivers ]] && continue - case "$_fname" in - *.ko) _fcont="$(< $_fname)" ;; - *.ko.gz) _fcont="$(gzip -dc $_fname)" ;; - *.ko.xz) _fcont="$(xz -dc $_fname)" ;; - esac - [[ $_fcont =~ $_net_drivers - && ! $_fcont =~ iw_handler_get_spy ]] \ - && echo "$_fname" - done - } - function rotor() { - local _f1 _f2 - while read _f1; do - echo "$_f1" - if read _f2; then - echo "$_f2" 1>&${_side2} - fi - done | nmf1 1>&${_merge} - } - # Use two parallel streams to filter alternating modules. - set +x - eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1" - _ret=$? - [[ $debug ]] && set -x - return $_ret - } - - { find_kernel_modules_by_path drivers/net; find_kernel_modules_by_path drivers/s390/net; } \ - | net_module_filter | instmods - - instmods =drivers/net/phy - instmods ecb arc4 - # bridge modules - instmods bridge stp llc - instmods ipv6 - # bonding - instmods bonding - # vlan - instmods 8021q + echo busybox systemd network } install() { local __file # add lp usr/group - egrep '^lp:' /etc/passwd >> "$initdir/etc/passwd" + egrep '^lp:' @@SYSCONFDIR@@/passwd >> "$initdir@@SYSCONFDIR@@/passwd" # group file is fully included atm - #egrep '^lp:' /etc/group >> "$initdir/etc/group" + #egrep '^lp:' @@SYSCONFDIR@@/group >> "$initdir@@SYSCONFDIR@@/group" - # networking stuff - dracut_install ifconfig ip route udhcpc iwconfig wpa_supplicant - inst /usr/share/udhcpc/default.script + # other stuff required by mcored + dracut_install iwconfig wpa_supplicant chroot systemd-nspawn # mcored config stuff - dracut_install hwinfo vncpasswd xml + dracut_install hwinfo vncpasswd localectl # mcored - # install all busybox modules - dracut_install busybox - for __file in $(cat /usr/share/busybox/busybox.links) - do - inst_symlink ${__file} - done # install things which are needed but not provided by our busybox dracut_install find install sslsvd touch - inst /etc/mageversion - inst /etc/conf.d/network - inst /etc/ssl/certs/mcored.pem - inst /etc/ssl/private/mcored.key - inst_dir /var/lib/mcored - inst /etc/conf.d/mcored - inst /etc/mcore/config.rc - inst /etc/mcoredpasswd - for __file in $(find /usr/lib/mcored/include -type f) + 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} + inst ${__file} done - inst /usr/lib/mcored/mcored - inst /usr/lib/mcored/mcore-generate-certificate - inst /usr/lib/mcored/mcorepasswd - inst /usr/lib/mcored/start-daemon.sh - inst /usr/lib/mcored/VERSION - inst_symlink /usr/sbin/mcored - inst_symlink /usr/bin/mcorepasswd + inst_symlink @@SBINDIR@@/mcored + inst_symlink @@SBINDIR@@/mcorepasswd inst_hook pre-pivot 90 "$moddir"/run-mcored.sh }