printf '%s\n' "$${hostname}" >"$${CFGROOT}/etc/hostname"
sed -Ei "s;^127\.0\.0\.1.*$$;& $${hostname};" "$${CFGROOT}/etc/hosts"
+_timeouts: ${CFGROOT}
+ printf '%s\n' DefaultTimeoutStartSec=10s DefaultTimeoutStopSec=10s >>"${CFGROOT}/etc/systemd/system.conf"
+
+
.PHONY: _systemd_timeout
_config: _systemd_timeout
_systemd_timeout: ${CFGROOT}
-PACKAGES += cifs-utils libpam-mount libpam-script lightdm nis nscd samba-common-bin usermode
+PACKAGES += cifs-utils libpam-mount libpam-script lightdm nis nscd samba-common-bin usermode libnss-nis
ifndef nis_server
nis_server := nismaster
endef
-.PHONY: _smb_nis
-_config: _smb_nis
+.PHONY: _smb_nis _ypbind
+_config: _smb_nis _ypbind
_smb_nis: ${CFGROOT}/opt/pam_script/pam_script_passwd ${CFGROOT}/etc/security/pam_mount.conf.xml
-_smb_nis: ${CFGROOT}/etc/yp.conf ${CFGROOT}/etc/defaultdomain
+_smb_nis: ${CFGROOT}/etc/yp.conf ${CFGROOT}/etc/defaultdomain ${CFGROOT}/etc/default/nis
_smb_nis: ${CFGROOT}
sed -Ei 's;^(passwd:|group:|shadow:|gshadow:).*$$;\1 files nis;' $${CFGROOT}/etc/nsswitch.conf
sed -Ei '/pam_(script|mount).so/d' $${CFGROOT}/etc/pam.d/common-*
- printf '\nauth optional pam_mount.so\n' >>$${CFGROOT}/etc/pam.d/common-auth
+ printf '\nauth required pam_mount.so\n' >>$${CFGROOT}/etc/pam.d/common-auth
printf '\nsession optional pam_mount.so\n' >>$${CFGROOT}/etc/pam.d/common-session
printf '\npassword required pam_script.so dir=/opt/pam_script\n' >$${CFGROOT}/etc/pam.d/common-password
+_ypbind: ${CFGROOT}
+ chroot "$<" systemctl enable ypbind
+
${CFGROOT}/opt/pam_script/pam_script_passwd: ${CFGROOT} .FORCE
mkdir -p "$(dir $@)"
printf '%s' "$${smb_nis_pamscript}" >"$@"
${CFGROOT}/etc/defaultdomain: ${CFGROOT} .FORCE
printf '%s\n' "${nis_domain}" >"$@"
+ printf 'kernel.domainname = %s\n' "${nis_domain}" >"${CFGROOT}/etc/sysctl.d/10-domainname.conf"
+
+${CFGROOT}/etc/default/nis: ${CFGROOT} .FORCE
+ printf '%s\n' "NISSERVER=false" "NISCLIENT=true" "YPPWDDIR=/etc" "NISMASTER=${nis_server}" >"$@"