All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz)
@ 2014-04-07 19:58 Yann E. MORIN
  2014-04-07 19:58 ` [Buildroot] [PATCH 1/6] system: make the zoneinfo list a system option Yann E. MORIN
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-07 19:58 UTC (permalink / raw)
  To: buildroot

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

Hello All!

Here is a series that adds the possibility to:

  - install the timezone info for uClibc; currently, that was only
    supported for glibc or eglibc-based systems. Thanks to Alexandre's
    packaging of tzdump, we can generate zoneinfo for uClibc, too.

  - set a default localtime for the system, for both *glibc-based
    systems and uClibc-based systems.

Unfortunately, musl-based systems are still left behind for now.
This is not too bad, as musl is not yet widely available.

Changes v3 -> v4:
  - fix omission about the default value in the TZ list

Changes v1 -> v3:
  - lost in the time warp since the initial submission... :-/

Regards,
Yann E. MORIN.


The following changes since commit f46f81de1315e6807a5309c0183d8bf336d14000:

  Don't build host-xz needlessly (2014-04-07 21:38:28 +0200)

are available in the git repository at:

  git://gitorious.org/buildroot/buildroot.git yem/tz

for you to fetch changes up to d6e21684e5985a2d9c710447082cf576d956e328:

  system: allow setting the local timezone for uClibc (2014-04-07 21:51:18 +0200)

----------------------------------------------------------------
Alexandre Belloni (3):
      tzdata: allow host build
      tzdump: new host package
      tz: new package

Yann E. MORIN (3):
      system: make the zoneinfo list a system option
      system: add selection of a default localtime
      system: allow setting the local timezone for uClibc

 Config.in.legacy         | 15 +++++++++++++++
 package/Config.in        |  1 +
 package/tz/Config.in     |  4 ++++
 package/tz/tz.mk         | 30 ++++++++++++++++++++++++++++++
 package/tzdata/Config.in | 23 +++--------------------
 package/tzdata/tzdata.mk | 31 ++++++++++++++++++++++++++++---
 package/tzdump/tzdump.mk | 24 ++++++++++++++++++++++++
 system/Config.in         | 39 +++++++++++++++++++++++++++++++++++++++
 8 files changed, 144 insertions(+), 23 deletions(-)
 create mode 100644 package/tz/Config.in
 create mode 100644 package/tz/tz.mk
 create mode 100644 package/tzdump/tzdump.mk

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 1/6] system: make the zoneinfo list a system option
  2014-04-07 19:58 [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz) Yann E. MORIN
@ 2014-04-07 19:58 ` Yann E. MORIN
  2014-04-08 21:35   ` Peter Korsgaard
  2014-04-07 19:58 ` [Buildroot] [PATCH 2/6] system: add selection of a default localtime Yann E. MORIN
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-07 19:58 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Alexandre Belloni <alexandre.belloni@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         | 23 +++++++++++++++++++++++
 4 files changed, 43 insertions(+), 22 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index ce44d0f..393cc1f 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -215,6 +215,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 d5c9f66..5900473 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 ba225ce..d69e880 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -267,6 +267,29 @@ 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"
+	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 # 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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 2/6] system: add selection of a default localtime
  2014-04-07 19:58 [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz) Yann E. MORIN
  2014-04-07 19:58 ` [Buildroot] [PATCH 1/6] system: make the zoneinfo list a system option Yann E. MORIN
@ 2014-04-07 19:58 ` Yann E. MORIN
  2014-04-08 21:47   ` Peter Korsgaard
  2014-04-07 19:58 ` [Buildroot] [PATCH 3/6] tzdata: allow host build Yann E. MORIN
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-07 19:58 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[alexandre.belloni: move from "tzdata" to "system configuration"]
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[yann.morin.1998 at free.fr: move into the BR2_TARGET_TZ_INFO conditionnal block]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/tzdata/tzdata.mk |  7 ++++++-
 system/Config.in         | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
index 5900473..762a31e 100644
--- a/package/tzdata/tzdata.mk
+++ b/package/tzdata/tzdata.mk
@@ -39,8 +39,13 @@ define TZDATA_INSTALL_TARGET_CMDS
 	cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo
 	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
 	for zone in posix/*; do                 \
-	    ln -sfn "$${zone}" "$${zone##*/}";    \
+	    ln -sfn "$${zone}" "$${zone##*/}";  \
 	done
+	if [ -n "$(BR2_TARGET_LOCALTIME)" ]; then                           \
+	    cd $(TARGET_DIR)/etc;                                           \
+	    ln -sf ../usr/share/zoneinfo/$(BR2_TARGET_LOCALTIME) localtime; \
+	    echo "$(BR2_TARGET_LOCALTIME)" >timezone;                       \
+	fi
 endef
 
 $(eval $(generic-package))
diff --git a/system/Config.in b/system/Config.in
index d69e880..c700729 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -288,6 +288,20 @@ config BR2_TARGET_TZ_ZONELIST
 	  The full list is the list of files in the time zone database source,
 	  not including the build and .tab files.
 
+config BR2_TARGET_LOCALTIME
+	string "default local time"
+	help
+	  The time zone to install as the default local time, expressed as a
+	  tzdata location, such as:
+	    GMT
+	    Europe/Paris
+	    America/New_York
+	    Pacific/Wallis
+	    ...
+
+	  If empty, no local time will be set, and the dates will be
+	  expressed in UTC.
+
 endif # BR2_TARGET_TZ_INFO
 
 config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 3/6] tzdata: allow host build
  2014-04-07 19:58 [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz) Yann E. MORIN
  2014-04-07 19:58 ` [Buildroot] [PATCH 1/6] system: make the zoneinfo list a system option Yann E. MORIN
  2014-04-07 19:58 ` [Buildroot] [PATCH 2/6] system: add selection of a default localtime Yann E. MORIN
@ 2014-04-07 19:58 ` Yann E. MORIN
  2014-04-08 22:04   ` Peter Korsgaard
  2014-04-07 19:58 ` [Buildroot] [PATCH 4/6] tzdump: new host package Yann E. MORIN
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-07 19:58 UTC (permalink / raw)
  To: buildroot

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

uClibc uses its own format for timezone info. OTOH, we can generate
uClibc-compatible timezone info from existing tzdata.

Add a host-version of tzdata, so we can harvest its installed timezone
info.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/tzdata/tzdata.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
index 762a31e..64bec79 100644
--- a/package/tzdata/tzdata.mk
+++ b/package/tzdata/tzdata.mk
@@ -48,4 +48,24 @@ define TZDATA_INSTALL_TARGET_CMDS
 	fi
 endef
 
+define HOST_TZDATA_EXTRACT_CMDS
+	gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \
+		| $(TAR) --strip-components=0 -C $(@D) -xf -
+endef
+
+define HOST_TZDATA_BUILD_CMDS
+	(cd $(@D); \
+		for zone in $(TZDATA_ZONELIST); do \
+			$(ZIC) -d _output/posix -y yearistype.sh $$zone; \
+			$(ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone; \
+		done; \
+	)
+endef
+
+define HOST_TZDATA_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/usr/share/zoneinfo
+	cp -a $(@D)/_output/* $(HOST_DIR)/usr/share/zoneinfo
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 4/6] tzdump: new host package
  2014-04-07 19:58 [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2014-04-07 19:58 ` [Buildroot] [PATCH 3/6] tzdata: allow host build Yann E. MORIN
@ 2014-04-07 19:58 ` Yann E. MORIN
  2014-04-08 22:13   ` Peter Korsgaard
  2014-04-07 19:58 ` [Buildroot] [PATCH 5/6] tz: new package Yann E. MORIN
  2014-04-07 19:58 ` [Buildroot] [PATCH 6/6] system: allow setting the local timezone for uClibc Yann E. MORIN
  5 siblings, 1 reply; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-07 19:58 UTC (permalink / raw)
  To: buildroot

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

tzdump takes timezone info in the installed tzdata format, and
outputs timezone info parseable by uClibc.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[yann.morin.1998 at free.fr: split zic header-install to its own cset]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/tzdump/tzdump.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 package/tzdump/tzdump.mk

diff --git a/package/tzdump/tzdump.mk b/package/tzdump/tzdump.mk
new file mode 100644
index 0000000..471a719
--- /dev/null
+++ b/package/tzdump/tzdump.mk
@@ -0,0 +1,24 @@
+################################################################################
+#
+# tzdump
+#
+################################################################################
+
+TZDUMP_VERSION = 65a10105564801094b18c3fcacf4dde4c44e4ab8
+TZDUMP_SITE = $(call github,alexandrebelloni,tzdump,$(TZDUMP_VERSION))
+TZDUMP_DEPENDENCIES = host-zic
+
+define HOST_TZDUMP_BUILD_CMDS
+	(cd $(@D) ;\
+		$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o tzdump tzdump.c ; \
+	)
+endef
+
+define HOST_TZDUMP_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/usr/sbin
+	install -D -m 755 $(@D)/tzdump $(HOST_DIR)/usr/sbin/tzdump
+endef
+
+$(eval $(host-generic-package))
+
+TZDUMP = $(HOST_DIR)/usr/sbin/tzdump
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 5/6] tz: new package
  2014-04-07 19:58 [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz) Yann E. MORIN
                   ` (3 preceding siblings ...)
  2014-04-07 19:58 ` [Buildroot] [PATCH 4/6] tzdump: new host package Yann E. MORIN
@ 2014-04-07 19:58 ` Yann E. MORIN
  2014-04-08 22:32   ` Peter Korsgaard
  2014-04-07 19:58 ` [Buildroot] [PATCH 6/6] system: allow setting the local timezone for uClibc Yann E. MORIN
  5 siblings, 1 reply; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-07 19:58 UTC (permalink / raw)
  To: buildroot

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

uClibc can not use timezone info from tzdata as-is, but accepts setting
the local timezone in /etc/TZ.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[yann.morin.1998 at free.fr: make it a blind package; little tweak to help text]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/Config.in    |  1 +
 package/tz/Config.in |  4 ++++
 package/tz/tz.mk     | 30 ++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 package/tz/Config.in
 create mode 100644 package/tz/tz.mk

diff --git a/package/Config.in b/package/Config.in
index cc28d51..5cec558 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -815,6 +815,7 @@ source "package/protobuf/Config.in"
 source "package/protobuf-c/Config.in"
 source "package/schifra/Config.in"
 source "package/startup-notification/Config.in"
+source "package/tz/Config.in"
 source "package/tzdata/Config.in"
 endmenu
 
diff --git a/package/tz/Config.in b/package/tz/Config.in
new file mode 100644
index 0000000..943dc5c
--- /dev/null
+++ b/package/tz/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_TZ
+	bool
+	help
+	  Timezone info for uClibc.
diff --git a/package/tz/tz.mk b/package/tz/tz.mk
new file mode 100644
index 0000000..e74c41b
--- /dev/null
+++ b/package/tz/tz.mk
@@ -0,0 +1,30 @@
+################################################################################
+#
+# tz
+#
+################################################################################
+
+TZ_SOURCE =
+TZ_DEPENDENCIES = host-tzdata host-tzdump
+TZ_LICENSE = Public domain
+
+define TZ_BUILD_CMDS
+	(cd $(HOST_DIR)/usr/share/zoneinfo/posix/;                 \
+		for i in $$(find . -type f); do                    \
+			mkdir -p $(@D)/output/$$(dirname $$i);         \
+			$(TZDUMP) -p . -q $${i#./} > $(@D)/output/$$i; \
+		done                                               \
+	)
+endef
+
+define TZ_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc
+	cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc
+	if [ -n "$(BR2_TARGET_LOCALTIME)" ]; then                     \
+		ln -sf /usr/share/zoneinfo/uclibc/$(BR2_TARGET_LOCALTIME) \
+			$(TARGET_DIR)/etc/TZ;                                 \
+	fi
+
+endef
+
+$(eval $(generic-package))
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 6/6] system: allow setting the local timezone for uClibc
  2014-04-07 19:58 [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz) Yann E. MORIN
                   ` (4 preceding siblings ...)
  2014-04-07 19:58 ` [Buildroot] [PATCH 5/6] tz: new package Yann E. MORIN
@ 2014-04-07 19:58 ` Yann E. MORIN
  2014-04-08 22:39   ` Peter Korsgaard
  5 siblings, 1 reply; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-07 19:58 UTC (permalink / raw)
  To: buildroot

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

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

---
Changes v3 -> v4
  - do not double-depend on glibc||uClibc
---
 system/Config.in | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/system/Config.in b/system/Config.in
index c700729..d15c3aa 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -269,8 +269,10 @@ endif
 
 config BR2_TARGET_TZ_INFO
 	bool "Install timezone info"
-	depends on BR2_TOOLCHAIN_USES_GLIBC
-	select BR2_PACKAGE_TZDATA
+	# No timezone for musl; only for uClibc or (e)glibc.
+	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC
+	select BR2_PACKAGE_TZDATA if BR2_TOOLCHAIN_USES_GLIBC
+	select BR2_PACKAGE_TZ if BR2_TOOLCHAIN_USES_UCLIBC
 	help
 	  Say 'y' here to install timezone info.
 
@@ -283,7 +285,7 @@ config BR2_TARGET_TZ_ZONELIST
 	  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.
+	  that this set consumes around 5.5M for (e)glibc and 2.1M for uClibc.
 
 	  The full list is the list of files in the time zone database source,
 	  not including the build and .tab files.
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 1/6] system: make the zoneinfo list a system option
  2014-04-07 19:58 ` [Buildroot] [PATCH 1/6] system: make the zoneinfo list a system option Yann E. MORIN
@ 2014-04-08 21:35   ` Peter Korsgaard
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 21:35 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > From: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Alexandre Belloni <alexandre.belloni@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         | 23 +++++++++++++++++++++++
 >  4 files changed, 43 insertions(+), 22 deletions(-)

 > diff --git a/Config.in.legacy b/Config.in.legacy
 > index ce44d0f..393cc1f 100644
 > --- a/Config.in.legacy
 > +++ b/Config.in.legacy
 > @@ -215,6 +215,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 != ""
 > +

These should go under 2014.05. Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 2/6] system: add selection of a default localtime
  2014-04-07 19:58 ` [Buildroot] [PATCH 2/6] system: add selection of a default localtime Yann E. MORIN
@ 2014-04-08 21:47   ` Peter Korsgaard
  2014-04-08 21:50     ` Peter Korsgaard
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 21:47 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > From: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > [alexandre.belloni: move from "tzdata" to "system configuration"]
 > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
 > [yann.morin.1998 at free.fr: move into the BR2_TARGET_TZ_INFO conditionnal block]
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > ---
 >  package/tzdata/tzdata.mk |  7 ++++++-
 >  system/Config.in         | 14 ++++++++++++++
 >  2 files changed, 20 insertions(+), 1 deletion(-)

 > diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
 > index 5900473..762a31e 100644
 > --- a/package/tzdata/tzdata.mk
 > +++ b/package/tzdata/tzdata.mk
 > @@ -39,8 +39,13 @@ define TZDATA_INSTALL_TARGET_CMDS
 >  	cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo
 >  	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
 >  	for zone in posix/*; do                 \
 > -	    ln -sfn "$${zone}" "$${zone##*/}";    \
 > +	    ln -sfn "$${zone}" "$${zone##*/}";  \
 >  	done
 > +	if [ -n "$(BR2_TARGET_LOCALTIME)" ]; then                           \
 > +	    cd $(TARGET_DIR)/etc;                                           \
 > +	    ln -sf ../usr/share/zoneinfo/$(BR2_TARGET_LOCALTIME) localtime; \
 > +	    echo "$(BR2_TARGET_LOCALTIME)" >timezone;                       \

BR2_TARGET_LOCALTIME is a string kconfig, so it already has quotes
around it, and the extra quotes will cancel eachother out.

We should imho use qstrip and assign it to a TZDATA_LOCALTIME variable
and use that similar to how it is done for TZDATA_ZONELIST.

Committed with that fixed, thanks.

This also doesn't give very clear error messages if the user misspelled
the localtime. Perhaps we should error out with something more sensible?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 2/6] system: add selection of a default localtime
  2014-04-08 21:47   ` Peter Korsgaard
@ 2014-04-08 21:50     ` Peter Korsgaard
  2014-04-08 21:57       ` Peter Korsgaard
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 21:50 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Korsgaard <jacmet@uclibc.org> writes:

 >> --- a/package/tzdata/tzdata.mk
 >> +++ b/package/tzdata/tzdata.mk
 >> @@ -39,8 +39,13 @@ define TZDATA_INSTALL_TARGET_CMDS
 >> cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo
 >> cd $(TARGET_DIR)/usr/share/zoneinfo;    \
 >> for zone in posix/*; do                 \
 >> -	    ln -sfn "$${zone}" "$${zone##*/}";    \
 >> +	    ln -sfn "$${zone}" "$${zone##*/}";  \
 >> done
 >> +	if [ -n "$(BR2_TARGET_LOCALTIME)" ]; then                           \
 >> +	    cd $(TARGET_DIR)/etc;                                           \
 >> +	    ln -sf ../usr/share/zoneinfo/$(BR2_TARGET_LOCALTIME) localtime; \
 >> +	    echo "$(BR2_TARGET_LOCALTIME)" >timezone;                       \

 > BR2_TARGET_LOCALTIME is a string kconfig, so it already has quotes
 > around it, and the extra quotes will cancel eachother out.

 > We should imho use qstrip and assign it to a TZDATA_LOCALTIME variable
 > and use that similar to how it is done for TZDATA_ZONELIST.

 > Committed with that fixed, thanks.

 > This also doesn't give very clear error messages if the user misspelled
 > the localtime. Perhaps we should error out with something more sensible?

Hmm, and it doesn't actually work if you use something like
Europe/Copenhagen as those are under /usr/share/zoneinfo/posix :/

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 2/6] system: add selection of a default localtime
  2014-04-08 21:50     ` Peter Korsgaard
@ 2014-04-08 21:57       ` Peter Korsgaard
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 21:57 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

 >> This also doesn't give very clear error messages if the user misspelled
 >> the localtime. Perhaps we should error out with something more sensible?

 > Hmm, and it doesn't actually work if you use something like
 > Europe/Copenhagen as those are under /usr/share/zoneinfo/posix :/

And I somehow missed the /usr/share/zoneinfo/Europe symlink - Sorry about
that.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 3/6] tzdata: allow host build
  2014-04-07 19:58 ` [Buildroot] [PATCH 3/6] tzdata: allow host build Yann E. MORIN
@ 2014-04-08 22:04   ` Peter Korsgaard
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 22:04 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
 > uClibc uses its own format for timezone info. OTOH, we can generate
 > uClibc-compatible timezone info from existing tzdata.

 > Add a host-version of tzdata, so we can harvest its installed timezone
 > info.

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

It would be good if we could reuse more of the target logic for this,
but that can be cleaned up later.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 4/6] tzdump: new host package
  2014-04-07 19:58 ` [Buildroot] [PATCH 4/6] tzdump: new host package Yann E. MORIN
@ 2014-04-08 22:13   ` Peter Korsgaard
  2014-04-08 22:18     ` Yann E. MORIN
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 22:13 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
 > tzdump takes timezone info in the installed tzdata format, and
 > outputs timezone info parseable by uClibc.

 > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
 > [yann.morin.1998 at free.fr: split zic header-install to its own cset]
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > ---
 >  package/tzdump/tzdump.mk | 24 ++++++++++++++++++++++++
 >  1 file changed, 24 insertions(+)
 >  create mode 100644 package/tzdump/tzdump.mk

 > diff --git a/package/tzdump/tzdump.mk b/package/tzdump/tzdump.mk
 > new file mode 100644
 > index 0000000..471a719
 > --- /dev/null
 > +++ b/package/tzdump/tzdump.mk
 > @@ -0,0 +1,24 @@
 > +################################################################################
 > +#
 > +# tzdump
 > +#
 > +################################################################################
 > +
 > +TZDUMP_VERSION = 65a10105564801094b18c3fcacf4dde4c44e4ab8
 > +TZDUMP_SITE = $(call github,alexandrebelloni,tzdump,$(TZDUMP_VERSION))
 > +TZDUMP_DEPENDENCIES = host-zic

It doesn't look like this is needed.

 > +
 > +define HOST_TZDUMP_BUILD_CMDS
 > +	(cd $(@D) ;\
 > +		$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o tzdump tzdump.c ; \
 > +	)

We don't really need the subshell here.

 > +endef
 > +
 > +define HOST_TZDUMP_INSTALL_CMDS
 > +	mkdir -p $(HOST_DIR)/usr/sbin
 > +	install -D -m 755 $(@D)/tzdump $(HOST_DIR)/usr/sbin/tzdump

install -D already creates the destination directory, so mkdir can be
dropped.

We normally use the INSTALL variable instead of explicit 'install'.

Committed with these fixes, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 4/6] tzdump: new host package
  2014-04-08 22:13   ` Peter Korsgaard
@ 2014-04-08 22:18     ` Yann E. MORIN
  2014-04-08 22:25       ` Peter Korsgaard
  0 siblings, 1 reply; 17+ messages in thread
From: Yann E. MORIN @ 2014-04-08 22:18 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2014-04-09 00:13 +0200, Peter Korsgaard spake thusly:
> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> 
>  > From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>  > tzdump takes timezone info in the installed tzdata format, and
>  > outputs timezone info parseable by uClibc.
> 
>  > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>  > [yann.morin.1998 at free.fr: split zic header-install to its own cset]
>  > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>  > ---
>  >  package/tzdump/tzdump.mk | 24 ++++++++++++++++++++++++
>  >  1 file changed, 24 insertions(+)
>  >  create mode 100644 package/tzdump/tzdump.mk
> 
>  > diff --git a/package/tzdump/tzdump.mk b/package/tzdump/tzdump.mk
>  > new file mode 100644
>  > index 0000000..471a719
>  > --- /dev/null
>  > +++ b/package/tzdump/tzdump.mk
>  > @@ -0,0 +1,24 @@
>  > +################################################################################
>  > +#
>  > +# tzdump
>  > +#
>  > +################################################################################
>  > +
>  > +TZDUMP_VERSION = 65a10105564801094b18c3fcacf4dde4c44e4ab8
>  > +TZDUMP_SITE = $(call github,alexandrebelloni,tzdump,$(TZDUMP_VERSION))
>  > +TZDUMP_DEPENDENCIES = host-zic
> 
> It doesn't look like this is needed.

Well, it's host-tzdump that needs host-zic, since the former needs a
header installed by the latter.

So, this should have been:

    HOST_TZDUMP_DEPENDENCIES = host-zic

>  > +define HOST_TZDUMP_INSTALL_CMDS
>  > +	mkdir -p $(HOST_DIR)/usr/sbin
>  > +	install -D -m 755 $(@D)/tzdump $(HOST_DIR)/usr/sbin/tzdump
> 
> install -D already creates the destination directory, so mkdir can be
> dropped.
> 
> We normally use the INSTALL variable instead of explicit 'install'.

Doh, I missed that one... :-(

> Committed with these fixes, thanks.

Hopefully, you'll get this in time to re-fix the host-zic dependency
before you push...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 4/6] tzdump: new host package
  2014-04-08 22:18     ` Yann E. MORIN
@ 2014-04-08 22:25       ` Peter Korsgaard
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 22:25 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

Hi,

 >> > +TZDUMP_DEPENDENCIES = host-zic
 >> 
 >> It doesn't look like this is needed.

 > Well, it's host-tzdump that needs host-zic, since the former needs a
 > header installed by the latter.

 > So, this should have been:

 >     HOST_TZDUMP_DEPENDENCIES = host-zic

Ahh ok, I'll fix that up.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 5/6] tz: new package
  2014-04-07 19:58 ` [Buildroot] [PATCH 5/6] tz: new package Yann E. MORIN
@ 2014-04-08 22:32   ` Peter Korsgaard
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 22:32 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
 > uClibc can not use timezone info from tzdata as-is, but accepts setting
 > the local timezone in /etc/TZ.

 > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
 > [yann.morin.1998 at free.fr: make it a blind package; little tweak to help text]
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

 > +++ b/package/tz/tz.mk
 > @@ -0,0 +1,30 @@
 > +################################################################################
 > +#
 > +# tz
 > +#
 > +################################################################################
 > +
 > +TZ_SOURCE =
 > +TZ_DEPENDENCIES = host-tzdata host-tzdump
 > +TZ_LICENSE = Public domain
 > +
 > +define TZ_BUILD_CMDS
 > +	(cd $(HOST_DIR)/usr/share/zoneinfo/posix/;                 \
 > +		for i in $$(find . -type f); do                    \
 > +			mkdir -p $(@D)/output/$$(dirname $$i);         \
 > +			$(TZDUMP) -p . -q $${i#./} > $(@D)/output/$$i; \
 > +		done                                               \
 > +	)
 > +endef
 > +
 > +define TZ_INSTALL_TARGET_CMDS
 > +	mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc
 > +	cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc
 > +	if [ -n "$(BR2_TARGET_LOCALTIME)" ]; then                     \
 > +		ln -sf /usr/share/zoneinfo/uclibc/$(BR2_TARGET_LOCALTIME) \
 > +			$(TARGET_DIR)/etc/TZ;                                 \
 > +	fi

Same comments as for tzdata. Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Buildroot] [PATCH 6/6] system: allow setting the local timezone for uClibc
  2014-04-07 19:58 ` [Buildroot] [PATCH 6/6] system: allow setting the local timezone for uClibc Yann E. MORIN
@ 2014-04-08 22:39   ` Peter Korsgaard
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2014-04-08 22:39 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

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

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-04-08 22:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 19:58 [Buildroot] [PATCH 0/6 v4] Setting timezone for uClibc, and setting localtime (branch yem/tz) Yann E. MORIN
2014-04-07 19:58 ` [Buildroot] [PATCH 1/6] system: make the zoneinfo list a system option Yann E. MORIN
2014-04-08 21:35   ` Peter Korsgaard
2014-04-07 19:58 ` [Buildroot] [PATCH 2/6] system: add selection of a default localtime Yann E. MORIN
2014-04-08 21:47   ` Peter Korsgaard
2014-04-08 21:50     ` Peter Korsgaard
2014-04-08 21:57       ` Peter Korsgaard
2014-04-07 19:58 ` [Buildroot] [PATCH 3/6] tzdata: allow host build Yann E. MORIN
2014-04-08 22:04   ` Peter Korsgaard
2014-04-07 19:58 ` [Buildroot] [PATCH 4/6] tzdump: new host package Yann E. MORIN
2014-04-08 22:13   ` Peter Korsgaard
2014-04-08 22:18     ` Yann E. MORIN
2014-04-08 22:25       ` Peter Korsgaard
2014-04-07 19:58 ` [Buildroot] [PATCH 5/6] tz: new package Yann E. MORIN
2014-04-08 22:32   ` Peter Korsgaard
2014-04-07 19:58 ` [Buildroot] [PATCH 6/6] system: allow setting the local timezone for uClibc Yann E. MORIN
2014-04-08 22:39   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.