8 #XXX: fix installation of /usr/lib/tmpfileS.d/{dracut-tmpfiles,systemd}.conf
9 #XXX: should be removed when bug 18642 (mageia) or 1343230 (fedora) will be fixed in /usr/bin/dracut +1262-1282
10 [ -z "$tmpfilesdir" -o ! -d "$tmpfilesdir" -a -d /usr
/lib
/tmpfiles.d
] && tmpfilesdir
=/usr
/lib
/tmpfiles.d
11 [ -z "$tmpfilesdir" -o ! -d "$tmpfilesdir" -a -d /etc
/tmpfiles.d
] && tmpfilesdir
=/etc
/tmpfiles.d
12 [ -z "$tmpfilesdir" -o ! -d "$tmpfilesdir" -a -d /lib
/tmpfiles.d
] && tmpfilesdir
=/lib
/tmpfiles.d
14 # if cryptsetup is not installed, then we cannot support encrypted devices.
15 require_binaries cryptsetup
|| return 1
17 # if hostonly or mount_needs include if required by other module
18 # if one of fs types is crypto_LUKS include it
19 [[ $hostonly ]] || [[ $mount_needs ]] && {
20 for fs
in "${host_fs_types[@]}"; do
21 [[ $fs = "crypto_LUKS" ]] && return 0
31 # depend on crypt for /etc/crypttab
32 # depend on systemd-networkd for rd.neednet=1
33 # depend on dracut-systemd for appending to $tmpfilesdir/dracut-tmpfiles.conf
34 echo crypt systemd
-networkd dracut
-systemd
41 for fs
in "${host_fs_types[@]}"; do
42 if [[ "$fs" == "crypto_LUKS" ]]; then
43 #XXX we used to include ip=dhcp as well (replaced by systemd-networkd configuration)
44 printf "%s" " rd.neednet=1"
52 local _ihttpdconf
=$(cmdline)
54 #XXX: rd.neednet=1 is mandatory to have active network in initrd
55 [[ $_ihttpdconf ]] && printf "%s\n" "$_ihttpdconf" >> "${initdir}/etc/cmdline.d/99ihttpd.conf"
60 /etc
/pki
/tls
/private \
61 /etc
/systemd
/network \
62 $systemdsystemunitdir/ihttpd.service.wants \
66 #XXX: force cryptsetup install until systemd-cryptsetup implement a method that don't rely on password ending with \0
72 /etc
/pki
/tls
/certs
/ihttpd.pem \
73 /etc
/pki
/tls
/private
/ihttpd.pem \
74 /etc
/systemd
/resolved.conf \
75 $systemdsystemunitdir/systemd
-networkd.service \
76 $systemdsystemunitdir/systemd
-resolved.service \
77 $systemdsystemunitdir/systemd
-tmpfiles-setup.service \
78 $systemdutildir/systemd
-resolved \
79 $tmpfilesdir/ihttpd.conf \
86 inst_simple
-o /var
/www
/html
/favicon.ico
88 # Include all ihttpd deps
106 "libnss_files.so.*" \
108 "libnss_myhostname.so.*" \
109 {"tls/$_arch/",tls
/,"$_arch/",}"libssl.so.*"
111 # Install ihttpd.conf index.bin reboot.bin ihttpd.service
112 for nc
in /etc
/ihttpd.conf
/var
/www
/html
/index.bin
/var
/www
/html
/reboot.bin
$systemdsystemunitdir/ihttpd.service
; do
113 inst_simple
/usr
/lib
/ihttpd
/${nc##*/} $nc
116 # Force load of ihttpd.service
117 ln -fs ..
/ihttpd.service
$initdir$systemdsystemunitdir/sysinit.target.wants
/
119 # Copy systemd-networkd config
120 for nc
in `ls /etc/systemd/network/`; do
121 inst_simple
/etc
/systemd
/network
/$nc
124 # Install resolv.conf as symlink
125 ln -fs '/run/systemd/resolve/resolv.conf' $initdir/etc
/resolv.conf
127 # Install in ihttpd.service.wants
129 ..
/systemd
-resolved.service \
130 ..
/systemd
-networkd.service \
131 ..
/systemd
-tmpfiles-setup.service \
132 $initdir$systemdsystemunitdir/ihttpd.service.wants
/
134 # Cleanup resolved.conf
135 perl
-pne 'undef $_ if /^(?:#.*|Domains=|FallbackDNS=|DNS=(?:127.0.0.1|::1)$|$)/;/^DNS=/ && $_ =~ s/(?:127.0.0.1|::1)[ \t]*//g' \
136 -i "$initdir/etc/systemd/resolved.conf"
138 # Cleanup nsswitch.conf
139 perl
-pne 'undef $_ if /^(?:#|$)/;s/compat/files/;s/ ?(?:nis|wins|mdns4_minimal |mdns4)( )?/\1/g' \
140 -i "$initdir/etc/nsswitch.conf"
142 # Require systemd-resolve user and group for our ihttpd process
143 `egrep -q '^systemd-resolve:' $initdir/etc/group` || egrep '^systemd-resolve:' /etc
/group
>> "$initdir/etc/group"
144 `egrep -q '^systemd-resolve:' $initdir/etc/passwd` || egrep '^systemd-resolve:' /etc
/passwd
>> "$initdir/etc/passwd"
145 #XXX: bug: fix /usr/lib/tmpfiles.d/{systemd,dracut-tmpfiles}.conf missing user and group
146 `egrep -q '^utmp:' $initdir/etc/group` || egrep '^utmp:' /etc
/group
>> "$initdir/etc/group"
147 # Require root user and group for our ihttpd process
148 `egrep -q '^root:' $initdir/etc/group` || egrep '^root:' /etc
/group
>> "$initdir/etc/group"
149 `egrep -q '^root:' $initdir/etc/passwd` || egrep '^root:' /etc
/passwd
>> "$initdir/etc/passwd"
154 ln -fs ..
/..
/..
/run
/ihttpd
/log
/{http
,https
,child.
{askpassword
,ihttpd
},error
}.log
$initdir/var
/www
/html
/
163 $systemdsystemunitdir/basic.target.wants \
164 $systemdsystemunitdir/emergency.target.wants \
165 $systemdsystemunitdir/rescue.target.wants \
166 $systemdsystemunitdir/sysinit.target.wants \
167 /usr
/lib
64/security \
168 /usr
/share
/terminfo
/x \
177 /etc
/pam.d
/system
-auth \
178 /etc
/profile.d
/*.sh \
179 /etc
/security
/limits.conf \
180 /etc
/security
/pam_env.conf \
184 /etc
/ssh
/ssh_config \
185 /etc
/ssh
/sshd_config \
186 /etc
/ssh
/ssh_host_
* \
187 /root
/.bash_profile \
193 /usr
/lib
64/security
/pam_cracklib.so \
194 /usr
/lib
64/security
/pam_deny.so \
195 /usr
/lib
64/security
/pam_env.so \
196 /usr
/lib
64/security
/pam_keyinit.so \
197 /usr
/lib
64/security
/pam_limits.so \
198 /usr
/lib
64/security
/pam_listfile.so \
199 /usr
/lib
64/security
/pam_nologin.so \
200 /usr
/lib
64/security
/pam_succeed_if.so \
201 /usr
/lib
64/security
/pam_systemd.so \
202 /usr
/lib
64/security
/pam_tcb.so \
204 /usr
/share
/terminfo
/x
/*
207 #perl -pne 's%^UsePAM yes$%UsePAM no%;s%^PermitRootLogin .*$%PermitRootLogin yes%' -i "$initdir/etc/ssh/sshd_config"
208 perl
-pne 's%^PermitRootLogin .*$%PermitRootLogin yes%' -i "$initdir/etc/ssh/sshd_config"
210 # Install debug sshd service
211 inst_simple
/usr
/lib
/ihttpd
/debug
-sshd.service
$initdir$systemdsystemunitdir/debug
-sshd.service
213 # Install in sysinit.target.wants
214 ln -fs ..
/debug
-sshd.service
$initdir$systemdsystemunitdir/sysinit.target.wants
/
216 # Install sshd user and group
217 `grep -Eq '^sshd:' $initdir/etc/passwd` || grep -E '^sshd:' /etc
/passwd
>> "$initdir/etc/passwd"
218 `grep -Eq '^sshd:' $initdir/etc/group` || grep -E '^sshd:' /etc
/group
>> "$initdir/etc/group"