From 76713531588861e995772a5d034404cdaab8d7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= Date: Sun, 11 Jun 2023 17:07:41 +0200 Subject: [PATCH] install: run setup-timezone with "-i" when appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes sure that the "/etc/localtime" file being created points to the tzdata directory (/usr/share/zoneinfo), instead of to the custom "/etc/zoneinfo" created by alpine to save space. This is relevant because it otherwise will point to a directory that contains incomplete tzdata, and can produce unexpected results in some circumnstances. Signed-off-by: Pablo Correa Gómez Tested-by: Clayton Craft Reviewed-by: Oliver Smith Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230611150743.23310-3-ablocorrea@hotmail.com%3E --- pmb/install/_install.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index eaf73864..31bddad1 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -362,6 +362,12 @@ def setup_timezone(args): version = alpine_conf["version"].split("-r")[0] setup_tz_cmd = ["setup-timezone"] + # setup-timezone will, by default, copy the timezone to /etc/zoneinfo + # and disregard tzdata, to save space. If we actually have tzdata + # installed, make sure that setup-timezone makes use of it, since + # there's no space to be saved. + if "tzdata" in pmb.chroot.apk.installed(args, suffix): + setup_tz_cmd += ["-i"] if not pmb.parse.version.check_string(version, ">=3.14.0"): setup_tz_cmd += ["-z"] setup_tz_cmd += [args.timezone]