[Buildroot] [PATCH 1/7] system: make the zoneinfo list a system option

Yann E. MORIN yann.morin.1998 at free.fr
Mon Mar 3 22:10:20 UTC 2014


From: "Yann E. MORIN" <yann.morin.1998 at free.fr>

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Alexandre Belloni <alexandre.belloni at free-electrons.com>

---
Note: because the tzdata package loses its prompt, it defaults
to 'n'. This means a user will loose his timezone settings,
unless he selects to install timezone info in the system
configuration menu.

We can not add a legacy option for that, or we'd get a circular
dependency. The only way we'd be fool-proof would be by renaming
the package altogether, and adding a legacy option for the old
name.
---
 Config.in.legacy         | 15 +++++++++++++++
 package/tzdata/Config.in | 23 +++--------------------
 package/tzdata/tzdata.mk |  4 ++--
 system/Config.in         | 22 ++++++++++++++++++++++
 4 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index afcd3b1..5e2970a 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -184,6 +184,21 @@ config BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS
 ###############################################################################
 comment "Legacy options removed in 2014.02"
 
+config BR2_TARGET_TZ_ZONELIST
+	default BR2_PACKAGE_TZDATA_ZONELIST if BR2_PACKAGE_TZDATA_ZONELIST != ""
+
+config BR2_PACKAGE_TZDATA_ZONELIST
+	string "tzdata: the timezone list option has been renamed"
+	help
+	  The option BR2_PACKAGE_TZDATA_ZONELIST has been renamed to
+	  BR2_TARGET_TZ_ZONELIST, and moved to the "System configuration"
+	  menu. You'll need to select BR2_TARGET_TZ_INFO.
+
+config BR2_PACKAGE_TZDATA_ZONELIST_WRAP
+	bool
+	default y if BR2_PACKAGE_TZDATA_ZONELIST != ""
+	select BR2_LEGACY
+
 config BR2_sh2
 	bool "sh2 support removed"
 	help
diff --git a/package/tzdata/Config.in b/package/tzdata/Config.in
index 1be6814..1e6cc0f 100644
--- a/package/tzdata/Config.in
+++ b/package/tzdata/Config.in
@@ -1,26 +1,9 @@
-comment "tzdata needs an (e)glibc toolchain"
-	depends on !BR2_TOOLCHAIN_USES_GLIBC
+# This package is not meant to be user-visible.
+# It gets selected by BR2_TARGET_TZ in system/Config.in
 
 config BR2_PACKAGE_TZDATA
-	bool "tzdata"
-	depends on BR2_TOOLCHAIN_USES_GLIBC
+	bool
 	help
 	  Time zone database
 
 	  http://www.iana.org/time-zones/repository/tz-link.html
-
-if BR2_PACKAGE_TZDATA
-
-config BR2_PACKAGE_TZDATA_ZONELIST
-	string "Time zone list"
-	default "default"
-	help
-	  Space-separated list of time zones to compile.
-
-	  The value "default" includes all commonly used time zones. Note
-	  that this set consumes around 5.5M.
-
-	  The full list is the list of files in the time zone database source,
-	  not including the build and .tab files.
-
-endif
diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
index 1cb5b3f..b6f07e2 100644
--- a/package/tzdata/tzdata.mk
+++ b/package/tzdata/tzdata.mk
@@ -13,10 +13,10 @@ TZDATA_LICENSE = Public domain
 TZDATA_DEFAULT_ZONELIST = africa antarctica asia australasia backward etcetera \
 			europe factory northamerica pacificnew southamerica
 
-ifeq ($(call qstrip,$(BR2_PACKAGE_TZDATA_ZONELIST)),default)
+ifeq ($(call qstrip,$(BR2_TARGET_TZ_ZONELIST)),default)
 TZDATA_ZONELIST = $(TZDATA_DEFAULT_ZONELIST)
 else
-TZDATA_ZONELIST = $(call qstrip,$(BR2_PACKAGE_TZDATA_ZONELIST))
+TZDATA_ZONELIST = $(call qstrip,$(BR2_TARGET_TZ_ZONELIST))
 endif
 
 # Don't strip any path components during extraction.
diff --git a/system/Config.in b/system/Config.in
index 89578c5..7ea0208 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -265,6 +265,28 @@ config BR2_TARGET_GENERIC_GETTY_OPTIONS
 endmenu
 endif
 
+config BR2_TARGET_TZ_INFO
+	bool "Install timezone info"
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	select BR2_PACKAGE_TZDATA
+	help
+	  Say 'y' here to install timezone info.
+
+if BR2_TARGET_TZ_INFO
+
+config BR2_TARGET_TZ_ZONELIST
+	string "timezone list"
+	help
+	  Space-separated list of time zones to compile.
+
+	  The value "default" includes all commonly used time zones. Note
+	  that this set consumes around 5.5M.
+
+	  The full list is the list of files in the time zone database source,
+	  not including the build and .tab files.
+
+endif # BR2_TARGET_TZ_INFO
+
 config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
 	bool "remount root filesystem read-write during boot"
 	default y
-- 
1.8.3.2




More information about the buildroot mailing list