From patchwork Sat Nov 16 09:10:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1196072 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QtGRiZwc"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47FTvf1bNXz9sP6 for ; Sat, 16 Nov 2019 20:10:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 92545214EC; Sat, 16 Nov 2019 09:10:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UT0F7wMNYrnV; Sat, 16 Nov 2019 09:10:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 38E6A2107A; Sat, 16 Nov 2019 09:10:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0E6221BF378 for ; Sat, 16 Nov 2019 09:10:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0B20285F8E for ; Sat, 16 Nov 2019 09:10:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EkIvSl8SIueb for ; Sat, 16 Nov 2019 09:10:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id AE43C844EA for ; Sat, 16 Nov 2019 09:10:11 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id 8so12979887wmo.0 for ; Sat, 16 Nov 2019 01:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PuoXkut3JG4l7Yo9UWpqwJMFjHhcc4isbVJEoJL37KE=; b=QtGRiZwcKoaAQhRdVxpGpHKtKi1sxWV0YVTaOZs47YBXRN0ED3FMd+xWYjWkZ/ucwy L0wazDuSKXMT8FeDbUgiVJyC4EnFbLMuzygpQrL9x4fhhpZY/xDjptgv/99e9sw5sBZP J4PoELHTH3dJyfw+ExtvK/Dq5SYLFYT9IBPJ+f91WRojeLEHOyuKKvUAfE9HIt/vagZA sSdNGsI0FpzFUyoODbReJJsmFx2cba8IXULot3pfQtrHQc8vxzMVlhWKlNcmjuWndbM+ CSxWWy2VpA2Az36c6rlBMJw6n9J3NF6aPl5cwrzNkn7XrRoucX2rWhmwD/sF5CrBbQF1 1vUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=PuoXkut3JG4l7Yo9UWpqwJMFjHhcc4isbVJEoJL37KE=; b=E3z7lu4TSH9rfEnoGKRzA37N0icrwLOMbO1sT82DiCoLWwmGGzUDdE1EssOg/UYzMx IJ2HnP7IrkfYD5lehDNaj+acou02BopwJvXWkQjuAhItjT3nR8OaFyM8kLqFVz5ORkfP 6Y0cfAPwrilp0XGukqOkToazcyActygAT/BG6R427V+kdWZ4gwNHPLgICDS3AgArFhug cKvoQLH/E7CCppMmXNEZ9KdNV8JkyyKRsvmpsajmHhQBhn3ckc10k3tiSY5sb6830qPR ano7+anwNovQ+NppTftuuVGlDOAp2lvXVDZon8Yj53r3Bo9oZt0N3zW+j0RvJ3xOATXO cngA== X-Gm-Message-State: APjAAAXGPihg40TbSrlDXuq5ULOnOtP+K1viZFYflfj3o8c/58l31jAr RiKU5qE3gEPm8snvel8/yX/CushW X-Google-Smtp-Source: APXvYqzQu0eCwRN3KdJz7n/L9Al5QmW/n86blFf5HvmTxDTC/yrTyt8S2tIrTmSawQ7C8DO/VFQ3ZQ== X-Received: by 2002:a1c:2155:: with SMTP id h82mr18622659wmh.94.1573895409664; Sat, 16 Nov 2019 01:10:09 -0800 (PST) Received: from scaer.home ([2a01:cb19:8b51:cb00:f888:4572:7e82:3c49]) by smtp.gmail.com with ESMTPSA id t13sm14075354wrr.88.2019.11.16.01.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Nov 2019 01:10:08 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sat, 16 Nov 2019 10:10:04 +0100 Message-Id: <20191116091004.23726-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] system: allow not setting a default, system-wide time zone X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Richard Braun , Andrew Trapani , "Yann E. MORIN" , Martin Bark Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" It is valid that there is no system-wide default time zone defined, in which case Etc/UTC is assumed. Fixes: #12316 Signed-off-by: Yann E. MORIN Cc: Martin Bark Cc: Alexandre Belloni Cc: Richard Braun Cc: Andrew Trapani --- package/tz/tz.mk | 17 +++++++++++------ package/tzdata/tzdata.mk | 19 ++++++++++++------- system/Config.in | 2 ++ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/package/tz/tz.mk b/package/tz/tz.mk index 1e797046d2..135726c2ce 100644 --- a/package/tz/tz.mk +++ b/package/tz/tz.mk @@ -8,6 +8,16 @@ TZ_DEPENDENCIES = host-tzdata host-tzdump TZ_LICENSE = Public domain TZ_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME)) +ifneq ($(TZ_LOCALTIME),) +define TZ_SET_LOCALTIME + if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) ]; then \ + printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \ + "$(TZ_LOCALTIME)"; \ + exit 1; \ + fi + ln -sf ../usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) $(TARGET_DIR)/etc/TZ +endef +endif define TZ_BUILD_CMDS (cd $(HOST_DIR)/share/zoneinfo/posix/; \ @@ -25,12 +35,7 @@ define TZ_INSTALL_TARGET_CMDS $(TARGET_DIR)/usr/share/zoneinfo/iso3166.tab mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc - if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) ]; then \ - printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \ - "$(TZ_LOCALTIME)"; \ - exit 1; \ - fi - ln -sf ../usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) $(TARGET_DIR)/etc/TZ + $(TZ_SET_LOCALTIME) endef $(eval $(generic-package)) diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk index 4d097dbee9..b656bc7f7f 100644 --- a/package/tzdata/tzdata.mk +++ b/package/tzdata/tzdata.mk @@ -26,6 +26,17 @@ TZDATA_ZONELIST = $(call qstrip,$(BR2_TARGET_TZ_ZONELIST)) endif TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME)) +ifneq ($(TZDATA_LOCALTIME),) +define TZDATA_SET_LOCALTIME + if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \ + printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \ + "$(TZDATA_LOCALTIME)"; \ + exit 1; \ + fi + ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) $(TARGET_DIR)/etc/localtime + echo "$(TZDATA_LOCALTIME)" >$(TARGET_DIR)/etc/timezone +endef +endif # No need to extract for target, we're using the host-installed files TZDATA_EXTRACT_CMDS = @@ -37,13 +48,7 @@ define TZDATA_INSTALL_TARGET_CMDS for zone in posix/*; do \ ln -sfn "$${zone}" "$${zone##*/}"; \ done - if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \ - printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \ - "$(TZDATA_LOCALTIME)"; \ - exit 1; \ - fi - ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) $(TARGET_DIR)/etc/localtime - echo "$(TZDATA_LOCALTIME)" >$(TARGET_DIR)/etc/timezone + $(TZDATA_SET_LOCALTIME) endef define HOST_TZDATA_BUILD_CMDS diff --git a/system/Config.in b/system/Config.in index c87266f431..c8c5be40e0 100644 --- a/system/Config.in +++ b/system/Config.in @@ -494,6 +494,8 @@ config BR2_TARGET_LOCALTIME Pacific/Wallis ... + Set to empty to not install a default time zone. + endif # BR2_TARGET_TZ_INFO config BR2_ROOTFS_USERS_TABLES