From 8b9d174695e22b9d2aa6da39ed060f7c1c1a6824 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Tue, 14 Jan 2025 18:29:58 +0100 Subject: [PATCH] Update /etc/timezone only if it exists tzdata 2024b-6 stops creating /etc/timezone, so we should not create it either. https://salsa.debian.org/glibc-team/tzdata/-/commit/c071fbc167ad306394b576879d515e6ecbe5a734 --- chroot-script | 9 ++++++--- config | 2 +- tests/goss.yaml | 3 --- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chroot-script b/chroot-script index 4f68ca77..0cb906fb 100755 --- a/chroot-script +++ b/chroot-script @@ -471,9 +471,12 @@ timezone() { echo "Adjusting /etc/localtime" ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime - echo "Setting /etc/timezone to $TIMEZONE" - printf '%s\n' "$TIMEZONE" > /etc/timezone - + if [ -e /etc/timezone ] ; then + # not necessary for trixie or newer, see tzdata 2024b-6 changelog. + # https://salsa.debian.org/glibc-team/tzdata/-/commit/c071fbc167ad306394b576879d515e6ecbe5a734 + echo "Setting /etc/timezone to $TIMEZONE" + printf '%s\n' "$TIMEZONE" > /etc/timezone + fi fi } # }}} diff --git a/config b/config index 7a97f399..4cdf5c53 100644 --- a/config +++ b/config @@ -192,7 +192,7 @@ # Default: 'en_US:en' # DEFAULT_LANGUAGE='en_US:en' -# Use /usr/share/zoneinfo/$TIMEZONE for /etc/localtime + set /etc/timezone. +# Use /usr/share/zoneinfo/$TIMEZONE for /etc/localtime. # Default: 'Europe/Vienna' # TIMEZONE='Europe/Vienna' diff --git a/tests/goss.yaml b/tests/goss.yaml index fdf8316b..9fae2220 100644 --- a/tests/goss.yaml +++ b/tests/goss.yaml @@ -3,9 +3,6 @@ process: running: true file: - /etc/timezone: - exists: true - contains: ["Europe/Vienna"] /etc/localtime: filetype: symlink exists: true