4 |
local _program |
local _program |
5 |
. $dracutfunctions |
. $dracutfunctions |
6 |
|
|
7 |
for _program in ifconfig ip route udhcpc iwconfig wpa_supplicant \ |
for _program in iwconfig wpa_supplicant \ |
8 |
chroot systemd-nspawn vncpasswd hostname mcored; do |
chroot systemd-nspawn vncpasswd hostname mcored; do |
9 |
if ! type -P $_program >/dev/null; then |
if ! type -P $_program >/dev/null; then |
10 |
derror "Could not find program \"$_program\" required by mcored." |
derror "Could not find program \"$_program\" required by mcored." |
16 |
} |
} |
17 |
|
|
18 |
depends() { |
depends() { |
19 |
return 0 |
echo network |
|
} |
|
|
|
|
|
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 |
|
20 |
} |
} |
21 |
|
|
22 |
install() { |
install() { |
27 |
# group file is fully included atm |
# group file is fully included atm |
28 |
#egrep '^lp:' @@SYSCONFDIR@@/group >> "$initdir@@SYSCONFDIR@@/group" |
#egrep '^lp:' @@SYSCONFDIR@@/group >> "$initdir@@SYSCONFDIR@@/group" |
29 |
|
|
30 |
# networking stuff |
# other stuff required by mcored |
31 |
dracut_install ifconfig ip route udhcpc iwconfig wpa_supplicant chroot systemd-nspawn |
dracut_install iwconfig wpa_supplicant chroot systemd-nspawn |
|
inst @@DATADIR@@/udhcpc/default.script |
|
|
inst_simple "$moddir/net-lib.sh" /lib/net-lib.sh |
|
32 |
|
|
33 |
# mcored config stuff |
# mcored config stuff |
34 |
dracut_install hwinfo vncpasswd |
dracut_install hwinfo vncpasswd |
43 |
# install things which are needed but not provided by our busybox |
# install things which are needed but not provided by our busybox |
44 |
dracut_install find install sslsvd touch |
dracut_install find install sslsvd touch |
45 |
inst @@SYSCONFDIR@@/mageversion |
inst @@SYSCONFDIR@@/mageversion |
|
inst @@CONFDDIR@@/network |
|
46 |
inst @@SSLDIR@@/certs/mcored.pem |
inst @@SSLDIR@@/certs/mcored.pem |
47 |
inst @@SSLDIR@@/private/mcored.key |
inst @@SSLDIR@@/private/mcored.key |
48 |
inst_dir @@MCORE_CHROOTDIR@@ |
inst_dir @@MCORE_CHROOTDIR@@ |