.PHONY: _timezone _locales
ifdef timezone
-define DEBCONF :=
-${DEBCONF}
-tzdata tzdata/Areas select $(firstword $(subst /,${space_},${timezone}))
-tzdata tzdata/Zones/Europe select $(lastword $(subst /,${space_},${timezone}))
-endef
+export timezone
PACKAGES := ${PACKAGES} tzdata
_config: _timezone
endif
ifdef locales
-define DEBCONF :=
-${DEBCONF}
-locales locales/locales_to_be_generated multiselect ${locales}
-locales locales/default_environment_locale select $(firstword $(subst ${comma_},${space_},${locales}))
-endef
-#$(addsuffix ${space_}UTF-8,$(subst ${comma_},${space_}${comma},${locales}))
PACKAGES := ${PACKAGES} locales
_config: _locales
endif
_timezone: ${CFGROOT}
- rm "$${CFGROOT}/etc/timezone"
- chroot "$${CFGROOT}" dpkg-reconfigure --default-priority -u tzdata
+ printf '%s\n' "$${timezone}" >"$${CFGROOT}/etc/timezone"
+ ln -sf /usr/share/zoneinfo/"$${timezone}" "$${CFGROOT}/etc/localtime"
_locales: ${CFGROOT}
- rm "$${CFGROOT}/etc/default/locale" "$${CFGROOT}/etc/locale.gen"
- chroot "$${CFGROOT}" dpkg-reconfigure --default-priority -u locales
+ for l in $(subst ${comma_},${space_},${locales}); do \
+ printf '%s %s\n' "$${l}" "$${l#*.}"; \
+ done >"$${CFGROOT}/etc/locale.gen"
+ printf 'LANG=%s\n' "$(firstword $(subst ${comma_},${space_},${locales}))" >"$${CFGROOT}/etc/default/locale"
+ chroot "$${CFGROOT}" locale-gen
.PHONY: _rootpass _users
chroot "$${CFGROOT}" usermod -p "$$(openssl passwd "$${rootpass}")" root
_users: ${CFGROOT}
- #sed -Ei 's;^SHELL=/bin/sh$$;SHELL=/bin/bash;;' "${CFGROOT}/etc/default/useradd"
for u in $(subst ${comma_},${space_},${users}); do \
chroot "$${CFGROOT}" useradd -m -s /bin/bash -p "$$(openssl passwd "")" "$$u"; \
done