## Comma separated list of locales, first one will become default locale
# locales=de_DE.UTF-8,en_US.UTF-8
+## Keyboard as used in debconfs keyboard-configuration/variant
+## Use debconf-get-selections to find out the exact string
+# keyboard=German
+
## If nodm is installed, you can choose a user to login automatically
## If no user is given here, then nodm will default to root
# nodm_user=adam
## In nodm, use full screen chromium web browser as session
# webui=http://localhost/
-## When using NIS modules the directory server should be given
+## When using NIS modules the directory server and NIS domain should be given
# nis_server=nismaster
+# nis_domain=example.com
+
+## also when using SMB the main server must be given
+# smb_server=smbmaster
## If the approxmodule is enabled, then one (and only one) apt-source
## can be choosen to install packages from
dtoverlay=vc4-fkms-v3d,cma-256
endef
-.PHONY: _debconf_selections _raspberry_config
+.PHONY: _debconf_selections _raspberry_config _keyboard
_install: _debconf_selections
_debconf_selections: ${SYSROOT}
printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections
+ifdef keyboard
+ _config: _keyboard
+endif
+_keyboard: ${CFGROOT}
+ -sed -Ei 's;^XKBLAYOUT=.*$$;XKBLAYOUT="${keyboard}";;' "$${CFGROOT}/etc/default/keyboard"
+
ifdef raspi
_config: _raspberry_config
endif
_hostname: ${CFGROOT}
printf '%s\n' "$${hostname}" >"$${CFGROOT}/etc/hostname"
+ sed -Ei "s;^127\.0\.0\.1.*$$;& $${hostname};" "$${CFGROOT}/etc/hosts"
ifdef wifi
_config: ${CFGROOT}/etc/network/interfaces.d/wifi
-PACKAGES += cifs-utils libpam-mount libpam-script lxdm nis nscd samba-common-bin usermode
+PACKAGES += cifs-utils libpam-mount libpam-script lightdm nis nscd samba-common-bin usermode
ifndef nis_server
nis_server := nismaster
endif
+ifndef nis_domain
+ nis_domain := ${nis_server}
+endif
+ifndef smb_server
+ smb_server := ${nis_server}
+endif
define DEBCONF +=
-nis nis/domain string .${nis_server}
+nis nis/domain string ${nis_domain}
endef
export smb_nis_pamscript smb_nis_pammount
define smb_nis_pamscript :=
#!/bin/sh
+# forced through bash, to hide euid from smbpasswd
/bin/bash -c '
printf "%s\n" "$$PAM_OLDAUTHTOK" "$$PAM_AUTHTOK" "$$PAM_AUTHTOK" \
- | smbpasswd -sr ${nis_server} -U "$$PAM_USER"
+ | smbpasswd -sr ${smb_server} -U "$$PAM_USER"
'
exit $?
define smb_nis_pammount :=
<pam_mount> <debug enable="0" />
<!-- Volume definitions -->
- <volume options="user=%(USER)" fstype="cifs" server="${nis_server}" path="%(USER)" mountpoint="~" />
+ <volume options="user=%(USER)" fstype="cifs" server="${smb_server}" path="%(USER)" mountpoint="~" />
<mntoptions require="nosuid,nodev" />
<logout wait="0" hup="no" term="no" kill="no" />
<mkmountpoint enable="1" remove="true" />
_smb_nis: ${CFGROOT}/etc/yp.conf ${CFGROOT}/etc/defaultdomain
_smb_nis: ${CFGROOT}
- sed -Ei 's;^(passwd:|group:|shadow:|gshadow:) *;\1 nis ;' $${CFGROOT}/etc/nsswitch.conf
+ 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 '\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
-${CFGROOT}/opt/pam_script/pam_script_passwd: ${CFGROOT}
+${CFGROOT}/opt/pam_script/pam_script_passwd: ${CFGROOT} .FORCE
mkdir -p "$(dir $@)"
printf '%s' "$${smb_nis_pamscript}" >"$@"
-${CFGROOT}/etc/security/pam_mount.conf.xml: ${CFGROOT}
+${CFGROOT}/etc/security/pam_mount.conf.xml: ${CFGROOT} .FORCE
mkdir -p "$(dir $@)"
printf '%s' "$${smb_nis_pammount}" >"$@"
-${CFGROOT}/etc/yp.conf: ${CFGROOT}
+${CFGROOT}/etc/yp.conf: ${CFGROOT} .FORCE
printf 'ypserver %s\n' "${nis_server}" >"$@"
-${CFGROOT}/etc/defaultdomain: ${CFGROOT}
- printf '.%s\n' "${nis_server}" >"$@"
+${CFGROOT}/etc/defaultdomain: ${CFGROOT} .FORCE
+ printf '%s\n' "${nis_domain}" >"$@"