From 7251742b7cfa1490d0a021974482d08bdf4acadd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 17 Jul 2019 11:10:51 +0200 Subject: [PATCH] working timezone and locale settings --- modules/default.mk | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/modules/default.mk b/modules/default.mk index 4cbc7ea..fdeff30 100644 --- a/modules/default.mk +++ b/modules/default.mk @@ -23,33 +23,26 @@ _debconf_selections: ${SYSROOT} .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 @@ -66,7 +59,6 @@ _rootpass: ${CFGROOT} 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 -- 2.39.2