Browse Source

Fix local-time so it doesn't overwrite existing /etc/localtime (set by Calamares)

Signed-off-by: Strahinya Radich <strajder@artixlinux.org>
master
Strahinya Radich 1 month ago committed by Gitea
parent
commit
88d980e4a4
  1. 30
      module/boot@/service/local/local-time
  2. 3
      service/boot@

30
module/boot@/service/local/local-time

@ -9,16 +9,32 @@
[start]
@execute =
(
if { 66-yeller -cdp local-time -1 /dev/console starts... }
if -nt {
if { 66-yeller -cdp local-time -1 /dev/console starts... }
execl-envfile ${conf_file}
s6-ln -nsf /usr/share/zoneinfo/${TZ} /etc/localtime
# 1. Load envfile; if TZ is not empty, link appropriate zoneinfo file to
# /etc/localtime
#
# 2. If /etc/localtime is already set, do nothing; otherwise, if
# /etc/localtime is not a symbolic link, link zoneinfo file defined
# by def_tz, which is "GMT" by default
#
if -nt {
}
66-yeller -fcdp local-time -1 /dev/console crashed!
execl-envfile ${conf_file}
importas -D "" TZ TZ
ifelse { [ -n "${TZ}" ] }
{
s6-ln -nsf /usr/share/zoneinfo/${TZ} /etc/localtime
}
ifelse { [ ! -L /etc/localtime ] }
{
s6-ln -nsf /usr/share/zoneinfo/${def_tz} /etc/localtime
}
}
66-yeller -fcdp local-time -1 /dev/console crashed!
)
[environment]
conf_file=!@bootconf@
def_tz=!GMT

3
service/boot@

@ -41,11 +41,12 @@
#======================= Global Settings ===============================
## Set your HOSTNAME.
## If set to empty, /etc/hostname will be used instead.
## If unset/set to empty, /etc/hostname will be used instead.
@HOSTNAME@
## Set your timezone, available timezones can be found at /usr/share/zoneinfo.
## If unset/set to empty, /etc/localtime won't be overwritten if present.
@TZ@

Loading…
Cancel
Save