From eaa4e6020ad134745ebd8d1d530aaa777915de5d Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Wed, 6 Jan 2021 20:34:07 +0100 Subject: Fix /etc/localtime file, needs to be a symlink --- liveinit.tpl | 5 ++--- make_slackware_live.sh | 12 +++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/liveinit.tpl b/liveinit.tpl index f3c7d0a..ab6e4f5 100644 --- a/liveinit.tpl +++ b/liveinit.tpl @@ -1104,9 +1104,8 @@ EOT if [ ! -z "$TZ" -a -f /mnt/overlay/usr/share/zoneinfo/${TZ} ]; then # Configure custom timezone: echo "${MARKER}: Configuring timezone '$TZ'" - cp /mnt/overlay/usr/share/zoneinfo/${TZ} /mnt/overlay/etc/localtime + ln -s /usr/share/zoneinfo/${TZ} /mnt/overlay/etc/localtime rm -f /mnt/overlay/etc/localtime-copied-from - ln -s /usr/share/zoneinfo/${TZ} /mnt/overlay/etc/localtime-copied-from # Configure the hardware clock to be interpreted as localtime and not UTC: cat < /mnt/overlay/etc/hardwareclock # /etc/hardwareclock @@ -1119,7 +1118,7 @@ EOT # file so QT5 fails to determine the timezone and falls back to UTC. Fix: echo ${TZ} > /mnt/overlay/etc/timezone - # KDE4 and PLASMA5 user timezone re-configuration: + # KDE4 and Plasma5 user timezone re-configuration: if [ -f /mnt/overlay/home/${LIVEUID}/.kde/share/config/ktimezonedrc ]; then sed -i -e "s%^LocalZone=.*%LocalZone=${TZ}%" \ /mnt/overlay/home/${LIVEUID}/.kde/share/config/ktimezonedrc diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 514de7c..843c6da 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -1503,16 +1503,14 @@ echo "LANG=${DEF_LOCALE}" > ${LIVE_ROOTDIR}/etc/locale.conf echo "KEYMAP=${DEF_KBD}" > ${LIVE_ROOTDIR}/etc/vconsole.conf # Set timezone to UTC, mimicking the 'timeconfig' script in Slackware: -cp -a ${LIVE_ROOTDIR}/usr/share/zoneinfo/UTC ${LIVE_ROOTDIR}/etc/localtime +ln -s /usr/share/zoneinfo/UTC ${LIVE_ROOTDIR}/etc/localtime # Could be absent so 'rm -f' to avoid script aborts: rm -f ${LIVE_ROOTDIR}/etc/localtime-copied-from -ln -s /usr/share/zoneinfo/UTC ${LIVE_ROOTDIR}/etc/localtime-copied-from -# Qt5 expects '/etc/localtime' to be a symlink, but in Slackware this is a -# real file. This causes Qt5 timezone detection to fail so that "UTC" -# will be returned always. However if a file '/etc/timezone' exists, Qt5 -# will use that. Until this is fixed (either in Slackware or in Qt5) we -# add the file and update the 'timeconfig' script accordingly: +# Qt5 expects '/etc/localtime' to be a symlink. If this is a real file, +# it causes Qt5 timezone detection to fail so that "UTC" will be returned +# always. However if a file '/etc/timezone' exists, Qt5 will use that. +# We add the file and update the 'timeconfig' script accordingly: echo "UTC" > ${LIVE_ROOTDIR}/etc/timezone sed -i -n "p;s/^\( *\)rm -f localtime$/\1echo \$TZ > timezone/p" \ ${LIVE_ROOTDIR}/usr/sbin/timeconfig -- cgit v1.2.3