From 81c5d62e66f370b7888fbf68c706c7f5248a9cd9 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Thu, 4 Dec 2014 22:41:50 -0500 Subject: [PATCH] Add installation of separate tzdata package Timezone data is not bundled anymore with glibc. --- config/packages-list | 1 + stage2/hv-install-1 | 1 + stage2/packages-update | 2 ++ stage2/pkg/tzdata | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 stage2/pkg/tzdata diff --git a/config/packages-list b/config/packages-list index 6f22dd9..74cd679 100644 --- a/config/packages-list +++ b/config/packages-list @@ -396,6 +396,7 @@ TIFF="tiff-4.0.2" TK="tk8.5.9-src" TRANSMISSION="transmission-2.60" TUNCTL="tunctl-1.5" +TZDATA="tzdata2014j" EUDEV="eudev-1.7" UNRAR="unrar-4.2.4" diff --git a/stage2/hv-install-1 b/stage2/hv-install-1 index 8d2aebd..9329e56 100755 --- a/stage2/hv-install-1 +++ b/stage2/hv-install-1 @@ -11,6 +11,7 @@ rscr mult "Performing pre-install" pre-install ipkg -m noac -l "kernel-headers" -s "kernel-headers" ${KERNEL} ipkg -m noac ${MANPAGES} ipkg ${GLIBC} +ipkg -m noac -s tzdata -c ${TZDATA} rscr once "Adjusting toolchain" toolchain-adjust rscr mult "Testing toolchain" toolchain-test diff --git a/stage2/packages-update b/stage2/packages-update index d9c6a4a..86ca8b7 100755 --- a/stage2/packages-update +++ b/stage2/packages-update @@ -46,6 +46,8 @@ lpkg 1 ${EUDEV} lpkg 1 ${XZ_UTILS} # These packages are only for stage2 +fpkg -e "tar.gz" ${TZDATA} \ + "http://www.iana.org/time-zones/repository/releases" fpkg -e "tar.bz2" ${BC} "http://alpha.gnu.org/gnu/bc" fpkg -e "tar.gz" ${PERL} "http://www.cpan.org/src/5.0" fpkg -s "manpages" ${MANPAGES} "http://tldp.org" diff --git a/stage2/pkg/tzdata b/stage2/pkg/tzdata new file mode 100644 index 0000000..7785f23 --- /dev/null +++ b/stage2/pkg/tzdata @@ -0,0 +1,38 @@ +#!/bin/bash + +hvbuild() +{ + mkdir -pv ${LFS_TMP}/${PACKAGE} + decompress_package ${TZDATA} ${LFS_TMP}/${PACKAGE} + + cd ${LFS_TMP}/${PACKAGE} + + ZONEINFO=/usr/share/zoneinfo + + mkdir -pv ${ZONEINFO}/{posix,right} + + for tz in etcetera southamerica northamerica europe africa antarctica \ + asia australasia backward pacificnew systemv; do + zic -L /dev/null -d ${ZONEINFO} -y "sh yearistype.sh" ${tz} + zic -L /dev/null -d ${ZONEINFO}/posix -y "sh yearistype.sh" ${tz} + zic -L leapseconds -d ${ZONEINFO}/right -y "sh yearistype.sh" ${tz} + done + + cp -v zone.tab zone1970.tab iso3166.tab ${ZONEINFO} + + zic -d ${ZONEINFO} -p America/New_York + + if [ -h /etc/localtime ]; then + rm /etc/localtime + fi + + # TIMEZONE is defined in sysinfos + if [ ! -f ${ZONEINFO}/${TIMEZONE} ]; then + echo "Invalid timezone: ${ZONEINFO}/${TIMEZONE}" + exit 1 + fi + + ln -s ${ZONEINFO}/${TIMEZONE} /etc/localtime + + unset ZONEINFO +} -- 2.20.1