Skip to contentSkip to conversation

Setting timezone for uClibc, and setting localtime (branch yem/tz)

PATCH New Yann E. MORIN 3 participants 17 messages Apr 7, 2014 – Apr 8, 2014

lore
Share & tools
lore
#0 lore raw

v4 cover Setting timezone for uClibc, and setting localtime (branch yem/tz)

From: "Yann E. MORIN" <[email protected]>

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
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v4 1/6 system: make the zoneinfo list a system option

From: "Yann E. MORIN" <[email protected]>

Cc Alexandre Belloni <[email protected]>

---
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(-)
Config.in.legacy +15 -0
index ce44d0f..393cc1f 100644
@@ -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
package/tzdata/Config.in +3 -20
index 1be6814..1e6cc0f 100644
@@ -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
package/tzdata/tzdata.mk +2 -2
index d5c9f66..5900473 100644
@@ -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.
system/Config.in +23 -0
index ba225ce..d69e880 100644
@@ -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
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/6 system: make the zoneinfo list a system option

Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: "Yann E. MORIN" <[email protected]>

Cc Alexandre Belloni <[email protected]>

---
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(-)
Config.in.legacy +0 -0
index ce44d0f..393cc1f 100644

Config.in.legacy config BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS · line 220

Quoted 6 lines
Config.in.legacy +3 -0
@@ -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.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v4 2/6 system: add selection of a default localtime

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

[alexandre.belloni: move from "tzdata" to "system configuration"]
[yann.morin.1998 at free.fr: move into the BR2_TARGET_TZ_INFO conditionnal block]
---
 package/tzdata/tzdata.mk |  7 ++++++-
 system/Config.in         | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
package/tzdata/tzdata.mk +6 -1
index 5900473..762a31e 100644
@@ -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))
system/Config.in +14 -0
index d69e880..c700729 100644
@@ -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
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 2/6 system: add selection of a default localtime

Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: "Yann E. MORIN" <[email protected]>

[alexandre.belloni: move from "tzdata" to "system configuration"]
[yann.morin.1998 at free.fr: move into the BR2_TARGET_TZ_INFO conditionnal block]
---
 package/tzdata/tzdata.mk |  7 ++++++-
 system/Config.in         | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
package/tzdata/tzdata.mk +0 -0
index 5900473..762a31e 100644

package/tzdata/tzdata.mk define TZDATA_INSTALL_TARGET_CMDS · line 47

Quoted 10 lines
package/tzdata/tzdata.mk +5 -1
@@ -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?

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 2/6 system: add selection of a default localtime

Quoted 19 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

package/tzdata/tzdata.mk +0 -0
@@ -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 \

package/tzdata/tzdata.mk +1 -1
-	    ln -sfn "$${zone}" "$${zone##*/}";    \
+	    ln -sfn "$${zone}" "$${zone##*/}";  \

done

package/tzdata/tzdata.mk define TZDATA_INSTALL_TARGET_CMDS · line 47

Quoted 4 lines
package/tzdata/tzdata.mk +4 -0
+	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.

Quoted 7 lines

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 :/

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 2/6 system: add selection of a default localtime

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> 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.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH v4 3/6 tzdata: allow host build

In reply to Yann E. MORIN

From: Alexandre Belloni <[email protected]>

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.

---
 package/tzdata/tzdata.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
package/tzdata/tzdata.mk +20 -0
index 762a31e..64bec79 100644
@@ -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))
Signature · 1 line
1.8.3.2
#8 lore raw

PATCH 3/6 tzdata: allow host build

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: Alexandre Belloni <[email protected]> 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.

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

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH v4 4/6 tzdump: new host package

In reply to Yann E. MORIN

From: Alexandre Belloni <[email protected]>

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

[yann.morin.1998 at free.fr: split zic header-install to its own cset]
---
 package/tzdump/tzdump.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 package/tzdump/tzdump.mk
package/tzdump/tzdump.mk new file +24 -0
new file mode 100644
index 0000000..471a719
@@ -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
Signature · 1 line
1.8.3.2
#10 lore raw

PATCH 4/6 tzdump: new host package

Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: Alexandre Belloni <[email protected]> tzdump takes timezone info in the installed tzdata format, and outputs timezone info parseable by uClibc.

[yann.morin.1998 at free.fr: split zic header-install to its own cset]
---
 package/tzdump/tzdump.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 package/tzdump/tzdump.mk
package/tzdump/tzdump.mk new file +0 -0
new file mode 100644
index 0000000..471a719

package/tzdump/tzdump.mk line 9

Quoted 9 lines
package/tzdump/tzdump.mk new file +9 -0
@@ -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.

package/tzdump/tzdump.mk line 14

Quoted 5 lines
package/tzdump/tzdump.mk new file +5 -0
+
+define HOST_TZDUMP_BUILD_CMDS
+	(cd $(@D) ;\
+		$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o tzdump tzdump.c ; \
+	)

We don't really need the subshell here.

package/tzdump/tzdump.mk line 19

Quoted 5 lines
package/tzdump/tzdump.mk new file +5 -0
+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.

Signature · 1 line
Bye, Peter Korsgaard
#11 lore raw

PATCH v4 4/6 tzdump: new host package

Peter, All,

On 2014-04-09 00:13 +0200, Peter Korsgaard spake thusly:

Quoted 23 lines
Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: Alexandre Belloni <[email protected]> tzdump takes timezone info in the installed tzdata format, and outputs timezone info parseable by uClibc.

[yann.morin.1998 at free.fr: split zic header-install to its own cset]
---
 package/tzdump/tzdump.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 package/tzdump/tzdump.mk
package/tzdump/tzdump.mk new file +3 -0
new file mode 100644
index 0000000..471a719
@@ -0,0 +1,24 @@
+################################################################################
+#
+# tzdump
Quoted 8 lines

package/tzdump/tzdump.mk line 9

Quoted 6 lines
package/tzdump/tzdump.mk new file +6 -0
+#
+################################################################################
+
+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

Quoted 8 lines

package/tzdump/tzdump.mk line 19

Quoted 3 lines
package/tzdump/tzdump.mk new file +3 -0
+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... :-(

Quoted 1 line

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.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#12 lore raw

PATCH 4/6 tzdump: new host package

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hi,

Quoted 10 lines
Quoted 3 lines
Quoted 1 line

+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.

Signature · 1 line
Bye, Peter Korsgaard
#13 lore raw

PATCH v4 5/6 tz: new package

In reply to Yann E. MORIN

From: Alexandre Belloni <[email protected]>

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

[yann.morin.1998 at free.fr: make it a blind package; little tweak to help text]
---
 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
package/Config.in +1 -0
index cc28d51..5cec558 100644
@@ -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
 
package/tz/Config.in new file +4 -0
new file mode 100644
index 0000000..943dc5c
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_TZ
+	bool
+	help
+	  Timezone info for uClibc.
package/tz/tz.mk new file +30 -0
new file mode 100644
index 0000000..e74c41b
@@ -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))
Signature · 1 line
1.8.3.2
#14 lore raw

PATCH 5/6 tz: new package

Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: Alexandre Belloni <[email protected]> uClibc can not use timezone info from tzdata as-is, but accepts setting the local timezone in /etc/TZ.

[yann.morin.1998 at free.fr: make it a blind package; little tweak to help text]

+++ b/package/tz/tz.mk

package/tz/tz.mk new file +16 -0
@@ -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                                               \

package/tz/tz.mk line 26

Quoted 10 lines
package/tz/tz.mk new file +10 -0
+	)
+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.

Signature · 1 line
Bye, Peter Korsgaard
#15 lore raw

PATCH v4 6/6 system: allow setting the local timezone for uClibc

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

---
Changes v3 -> v4
- do not double-depend on glibc||uClibc

---
 system/Config.in | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
system/Config.in +5 -3
index c700729..d15c3aa 100644
@@ -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.
Signature · 1 line
1.8.3.2