main/postmarketos-base: migrate wrong timezone configurations (MR 4308)
So that old installations that run setup-timezone without "-i" do not need to execute manual steps to get sensible timezone configurations. See https://gitlab.com/postmarketOS/pmaports/-/issues/2168 for more context Fixes #2168 [ci:skip-build]: already built successfully in CI
This commit is contained in:
parent
0383bcaa1e
commit
04abb5b1a7
2 changed files with 22 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
pkgname=postmarketos-base
|
pkgname=postmarketos-base
|
||||||
pkgver=27
|
pkgver=27
|
||||||
pkgrel=0
|
pkgrel=1
|
||||||
pkgdesc="Meta package for minimal postmarketOS base"
|
pkgdesc="Meta package for minimal postmarketOS base"
|
||||||
url="https://postmarketos.org"
|
url="https://postmarketos.org"
|
||||||
arch="noarch"
|
arch="noarch"
|
||||||
|
|
|
@ -3,3 +3,24 @@
|
||||||
# Otherwise it will enable services, as listed in that file. And we don't want
|
# Otherwise it will enable services, as listed in that file. And we don't want
|
||||||
# this to happen during upgrade, especially not automatically enabling the sshd
|
# this to happen during upgrade, especially not automatically enabling the sshd
|
||||||
# service! (build.postmarketos.org#85)
|
# service! (build.postmarketos.org#85)
|
||||||
|
|
||||||
|
# Fixup old pmOS installations that run setup-timezone without "-i" option
|
||||||
|
# and those later installations that run with it, but have missing
|
||||||
|
# https://gitlab.alpinelinux.org/alpine/alpine-conf/-/merge_requests/157
|
||||||
|
# See https://gitlab.com/postmarketOS/pmaports/-/issues/2168 for context
|
||||||
|
# This is probably safe to remove after a couple of releases of the alpine-conf
|
||||||
|
# fix having been merged
|
||||||
|
[ -L /etc/localtime ] || exit 0
|
||||||
|
localtime="$(readlink /etc/localtime)"
|
||||||
|
restart="yes"
|
||||||
|
case "$localtime" in
|
||||||
|
//usr/share/zoneinfo/*) localtime=${localtime#/*} ;;
|
||||||
|
//etc/zoneinfo*) localtime="/usr/share/zoneinfo/${localtime#//etc/zoneinfo/*}" ;;
|
||||||
|
/etc/zoneinfo/*) localtime="/usr/share/zoneinfo/${localtime#/etc/zoneinfo/*}" ;;
|
||||||
|
*) restart="no" ;;
|
||||||
|
esac
|
||||||
|
ln -sf "$localtime" /etc/localtime
|
||||||
|
rm -rf /etc/zoneinfo
|
||||||
|
[ "$restart" = "yes" ] && service -qq openrc-settingsd restart
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue