base-files: fix /tmp/TZ when zoneinfo not installed
The zoneinfo packages are not installed per default so neither /tmp/localtime nor /tmp/TZ is generated. This patch mostly reverts the previous fix and instead incooperates a solution suggested by Jo. Fixes "base-files: fix zoneinfo support "8af62ed
Signed-off-by: Paul Spooren <mail@aparcar.org> (cherry picked from commit56bdb6bb97
)
This commit is contained in:
parent
3047df2317
commit
3d62b5d5c6
|
@ -21,13 +21,10 @@ system_config() {
|
||||||
|
|
||||||
echo "$hostname" > /proc/sys/kernel/hostname
|
echo "$hostname" > /proc/sys/kernel/hostname
|
||||||
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
|
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
|
||||||
rm -f /tmp/TZ
|
echo "$timezone" > /tmp/TZ
|
||||||
if [ -n "$zonename" ]; then
|
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
|
||||||
local zname=$(echo "$zonename" | tr ' ' _)
|
&& ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
|
||||||
[ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime
|
&& rm -f /tmp/TZ
|
||||||
else
|
|
||||||
echo "$timezone" > /tmp/TZ
|
|
||||||
fi
|
|
||||||
|
|
||||||
# apply timezone to kernel
|
# apply timezone to kernel
|
||||||
hwclock -u --systz
|
hwclock -u --systz
|
||||||
|
|
Loading…
Reference in New Issue