4 |
local _program |
local _program |
5 |
. $dracutfunctions |
. $dracutfunctions |
6 |
|
|
7 |
for _program in ifconfig ip route udhcpc; do |
for _program in iwconfig wpa_supplicant \ |
8 |
|
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." |
11 |
return 1 |
return 1 |
16 |
} |
} |
17 |
|
|
18 |
depends() { |
depends() { |
19 |
return 0 |
echo busybox 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() { |
23 |
local __file |
local __file |
24 |
|
|
25 |
# add lp usr/group |
# add lp usr/group |
26 |
egrep '^lp:' /etc/passwd >> "$initdir/etc/passwd" |
egrep '^lp:' @@SYSCONFDIR@@/passwd >> "$initdir@@SYSCONFDIR@@/passwd" |
27 |
# group file is fully included atm |
# group file is fully included atm |
28 |
#egrep '^lp:' /etc/group >> "$initdir/etc/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 |
dracut_install iwconfig wpa_supplicant chroot systemd-nspawn |
|
inst /usr/share/udhcpc/default.script |
|
32 |
|
|
33 |
# mcored config stuff |
# mcored config stuff |
34 |
dracut_install hwinfo vncpasswd |
dracut_install hwinfo vncpasswd |
35 |
|
|
36 |
# mcored |
# mcored |
|
# install all busybox modules |
|
|
dracut_install busybox |
|
|
for __file in $(cat /usr/share/busybox/busybox.links) |
|
|
do |
|
|
inst_symlink ${__file} |
|
|
done |
|
37 |
# install things which are needed but not provided by our busybox |
# install things which are needed but not provided by our busybox |
38 |
dracut_install find install sslsvd touch |
dracut_install find install sslsvd touch |
39 |
inst /etc/mageversion |
inst @@SYSCONFDIR@@/mageversion |
40 |
inst /etc/conf.d/network |
inst @@SSLDIR@@/certs/mcored.pem |
41 |
inst /etc/ssl/certs/mcored.pem |
inst @@SSLDIR@@/private/mcored.key |
42 |
inst /etc/ssl/private/mcored.key |
inst_dir @@MCORE_CHROOTDIR@@ |
43 |
inst_dir /var/lib/mcored |
inst @@CONFDDIR@@/mcored |
44 |
inst /etc/conf.d/mcored |
inst @@SYSCONFDIR@@/mcore/mcore.conf |
45 |
inst /etc/mcore/config.rc |
inst @@SYSCONFDIR@@/mcoredpasswd |
46 |
inst /etc/mcoredpasswd |
for __file in $(find @@MCORE_LIBDIR@@/include -type f) |
|
for __file in $(find /usr/lib/mcored/include -type f) |
|
47 |
do |
do |
48 |
inst ${__file} |
inst ${__file} |
49 |
done |
done |
50 |
inst /usr/lib/mcored/mcored |
inst @@MCORE_LIBDIR@@/mcored |
51 |
inst /usr/lib/mcored/mcore-generate-certificate |
inst @@MCORE_LIBDIR@@/mcore-generate-certificate |
52 |
inst /usr/lib/mcored/mcorepasswd |
inst @@MCORE_LIBDIR@@/mcorepasswd |
53 |
inst /usr/lib/mcored/start-daemon.sh |
inst @@MCORE_LIBDIR@@/VERSION |
54 |
inst /usr/lib/mcored/VERSION |
inst_symlink @@SBINDIR@@/mcored |
55 |
inst_symlink /usr/sbin/mcored |
inst_symlink @@SBINDIR@@/mcorepasswd |
|
inst_symlink /usr/bin/mcorepasswd |
|
56 |
|
|
57 |
inst_hook pre-pivot 90 "$moddir"/run-mcored.sh |
inst_hook pre-pivot 90 "$moddir"/run-mcored.sh |
58 |
} |
} |