Skip to content

Commit

Permalink
Fix timezone and RTC setup
Browse files Browse the repository at this point in the history
Correctly create /etc/localtime as a symlink. Also stop dealing with
/etc/adjtime, which does not exist anymore. Instead document RTC=UTC
as default.

Remove GRMLBASE.var "UTC", and default TIMEZONE to Etc/UTC, to get
the debconf variables correctly set.
  • Loading branch information
zeha committed Jan 30, 2025
1 parent 1680659 commit ebfa1c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
4 changes: 1 addition & 3 deletions config/class/GRMLBASE.var
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
# allow installation of packages from unsigned repositories
# FAI_ALLOW_UNSIGNED=1

# Set UTC=yes if your system clock is set to UTC (GMT) and UTC=no if not.
UTC=no
TIMEZONE=UTC
TIMEZONE=Etc/UTC
9 changes: 1 addition & 8 deletions config/scripts/GRMLBASE/18-timesetup
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ set -e
# FAI sets $target, but shellcheck does not know that.
target=${target:?}

# tell if hwclock is running in UTC or local time
# by default it's set to UTC=no
if [ -n "$UTC" ] && [ "$UTC" = "yes" ] ; then
echo "UTC is set to 'yes', setting hwclock parameter UTC"
[ -e "${target}/etc/adjtime" ] && sed -i "s/^LOCAL/UTC/" "${target}/etc/adjtime"
fi

# default timezone settings
if [ -n "$TIMEZONE" ] ; then
echo "Setting default timezone to $TIMEZONE"
Expand All @@ -33,7 +26,7 @@ if [ -n "$TIMEZONE" ] ; then
echo "$TIMEZONE" > "$target"/etc/timezone
fi
rm -f "$target"/etc/localtime
cp -f "$target"/usr/share/zoneinfo/"$TIMEZONE" "$target"/etc/localtime
chroot "$target" ln -sf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
fi

## END OF FILE ################################################################
Expand Down
4 changes: 2 additions & 2 deletions templates/GRML/grml-cheatcodes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Regional settings:
------------------
grml lang=at|de|cn|da|es|fr|it Specify language ($LANG, $LC_ALL, $LANGUAGE - utf8) + keyboard
grml lang=nl|pl|ru|sk|tr|tw|us Specify language ($LANG, $LC_ALL, $LANGUAGE - utf8) + keyboard
grml utc Hardware Clock is set to Coordinated Universal Time (UTC)
grml localtime Hardware Clock is set to local time (LOCAL), this is the default
grml utc Hardware Clock is set to Coordinated Universal Time (UTC), this is the default
grml localtime Hardware Clock is set to local time
grml tz=Europe/Vienna Use specified timezone for TZ, defaults to TZ=UTC
grml keyboard=us Use different keyboard layout

Expand Down

0 comments on commit ebfa1c7

Please sign in to comment.