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 \
71 /etc
/pki
/tls
/certs
/ihttpd.pem \
72 /etc
/pki
/tls
/private
/ihttpd.pem \
73 /etc
/systemd
/resolved.conf \
74 $systemdsystemunitdir/systemd
-networkd.service \
75 $systemdsystemunitdir/systemd
-resolved.service \
76 $systemdsystemunitdir/systemd
-tmpfiles-setup.service \
77 $systemdutildir/systemd
-resolved \
78 $tmpfilesdir/ihttpd.conf \
84 inst_simple
-o /var
/www
/html
/favicon.ico
86 # Include all ihttpd deps
104 "libnss_files.so.*" \
106 "libnss_myhostname.so.*" \
107 {"tls/$_arch/",tls
/,"$_arch/",}"libssl.so.*"
109 # Install ihttpd.conf index.bin reboot.bin ihttpd.service
110 for nc
in /etc
/ihttpd.conf
/var
/www
/html
/index.bin
/var
/www
/html
/reboot.bin
$systemdsystemunitdir/ihttpd.service
; do
111 inst_simple
/usr
/lib
/ihttpd
/${nc##*/} $nc
114 # Force load of ihttpd.service
115 ln -fs ..
/ihttpd.service
$initdir$systemdsystemunitdir/sysinit.target.wants
/
117 # Copy systemd-networkd config
118 for nc
in `ls /etc/systemd/network/`; do
119 inst_simple
/etc
/systemd
/network
/$nc
122 # Install resolv.conf as symlink
123 ln -fs '/run/systemd/resolve/resolv.conf' $initdir/etc
/resolv.conf
125 # Install in ihttpd.service.wants
127 ..
/systemd
-resolved.service \
128 ..
/systemd
-networkd.service \
129 ..
/systemd
-tmpfiles-setup.service \
130 $initdir$systemdsystemunitdir/ihttpd.service.wants
/
132 # Cleanup resolved.conf
133 perl
-pne 'undef $_ if /^(?:#.*|Domains=|FallbackDNS=|DNS=(?:127.0.0.1|::1)$|$)/;/^DNS=/ && $_ =~ s/(?:127.0.0.1|::1)[ \t]*//g' \
134 -i "$initdir/etc/systemd/resolved.conf"
136 # Cleanup nsswitch.conf
137 perl
-pne 'undef $_ if /^(?:#|$)/;s/compat/files/;s/ ?(?:nis|wins|mdns4_minimal |mdns4)( )?/\1/g' \
138 -i "$initdir/etc/nsswitch.conf"
140 # Require systemd-resolve user and group for our ihttpd process
141 `egrep -q '^systemd-resolve:' $initdir/etc/group` || egrep '^systemd-resolve:' /etc
/group
>> "$initdir/etc/group"
142 `egrep -q '^systemd-resolve:' $initdir/etc/passwd` || egrep '^systemd-resolve:' /etc
/passwd
>> "$initdir/etc/passwd"
143 #XXX: bug: fix /usr/lib/tmpfiles.d/{systemd,dracut-tmpfiles}.conf missing user and group
144 `egrep -q '^utmp:' $initdir/etc/group` || egrep '^utmp:' /etc
/group
>> "$initdir/etc/group"
145 # Require root user and group for our ihttpd process
146 `egrep -q '^root:' $initdir/etc/group` || egrep '^root:' /etc
/group
>> "$initdir/etc/group"
147 `egrep -q '^root:' $initdir/etc/passwd` || egrep '^root:' /etc
/passwd
>> "$initdir/etc/passwd"
152 ln -fs ..
/..
/..
/run
/ihttpd
/log
/{http
,https
,child.
{askpassword
,ihttpd
},error
}.log
$initdir/var
/www
/html
/
161 $systemdsystemunitdir/basic.target.wants \
162 $systemdsystemunitdir/emergency.target.wants \
163 $systemdsystemunitdir/rescue.target.wants \
164 $systemdsystemunitdir/sysinit.target.wants \
165 /usr
/lib
64/security \
166 /usr
/share
/terminfo
/x \
175 /etc
/pam.d
/system
-auth \
176 /etc
/profile.d
/*.sh \
177 /etc
/security
/limits.conf \
178 /etc
/security
/pam_env.conf \
182 /etc
/ssh
/ssh_config \
183 /etc
/ssh
/sshd_config \
184 /etc
/ssh
/ssh_host_
* \
185 /root
/.bash_profile \
191 /usr
/lib
64/security
/pam_cracklib.so \
192 /usr
/lib
64/security
/pam_deny.so \
193 /usr
/lib
64/security
/pam_env.so \
194 /usr
/lib
64/security
/pam_keyinit.so \
195 /usr
/lib
64/security
/pam_limits.so \
196 /usr
/lib
64/security
/pam_listfile.so \
197 /usr
/lib
64/security
/pam_nologin.so \
198 /usr
/lib
64/security
/pam_succeed_if.so \
199 /usr
/lib
64/security
/pam_systemd.so \
200 /usr
/lib
64/security
/pam_tcb.so \
202 /usr
/share
/terminfo
/x
/*
205 #perl -pne 's%^UsePAM yes$%UsePAM no%;s%^PermitRootLogin .*$%PermitRootLogin yes%' -i "$initdir/etc/ssh/sshd_config"
206 perl
-pne 's%^PermitRootLogin .*$%PermitRootLogin yes%' -i "$initdir/etc/ssh/sshd_config"
208 # Install debug sshd service
209 inst_simple
/usr
/lib
/ihttpd
/debug
-sshd.service
$initdir$systemdsystemunitdir/debug
-sshd.service
211 # Install in sysinit.target.wants
212 ln -fs ..
/debug
-sshd.service
$initdir$systemdsystemunitdir/sysinit.target.wants
/
214 # Install sshd user and group
215 `grep -Eq '^sshd:' $initdir/etc/passwd` || grep -E '^sshd:' /etc
/passwd
>> "$initdir/etc/passwd"
216 `grep -Eq '^sshd:' $initdir/etc/group` || grep -E '^sshd:' /etc
/group
>> "$initdir/etc/group"