Closed mw9 closed 2 years ago
Thanks for putting together the patch.
I will rebuild my qemu environment with it to try and answer some of the TODO items.
I haven't had a chance to track down my tzdata package issue yet. For now, I renamed the problem source tree and checked out a fresh copy from git and just copied over the entire sources folder.
The build I just completed with the patch has New_York is in the staging rootfs and the cramfs image.
$ file ~/source/squeezeos/poky/build/tmp-baby/rootfs/usr/share/zoneinfo/America/New_York
New_York: timezone data, version 2, no gmt time flags, no std time flags, no leap seconds, no transition times, 1 abbreviation char
$ sudo cramfsck -x x squeezeos-image-baby.cramfs
$ file x/usr/share/zoneinfo/America/New_York
x/usr/share/zoneinfo/America/New_York: timezone data, version 2, no gmt time flags, no std time flags, no leap seconds, no transition times, 1 abbreviation char
Good question about the .tab files. I had not noticed them in /usr/share/zoneinfo before.
Initial results would suggest that busybox does not support the new tzdata. The timezone abbreviation is completely missing.
# uname -a
Linux SqueezeboxRadio 2.6.39.4-versatile #4 PREEMPT Sun Mar 21 12:36:26 EDT 2021 armv5tejl GNU/Linux
# date
Sat May 21 15:18:24 2022
vs radio
# uname -a
Linux radio 2.6.26.8-rt16 #1 PREEMPT RT Thu Aug 19 11:11:04 EDT 2021 armv5tejl GNU/Linux
# date
Sat May 21 11:16:53 EDT 2022
Initial results would suggest that busybox does not support the new tzdata. The timezone abbreviation is completely missing.
I have just uploaded my own generated timezone data, and get the same result. So a little research required on that, I think. The documentation talks about 'version 2' and 'version 3', and probably being backwards compatible, but with an element of occasional doubt about it.
As regards other matters:
tzdata
and tzdata-misc
do not include enough timezones.
At present I am including all timezone packages except for tzdata-posix
andtzdata-right
.
+# Provides a few basic cities.
+RDEPENDS += "tzdata"
+# 'tzdata-misc' contains the deffault 'Factory' time zone.
+RDEPENDS += "tzdata-misc"
+# SqueezePlay uses more timezones than are provided by the basic
+# 'tzdata' package.
+RDEPENDS += "tzdata-africa tzdata-americas tzdata-antarctica \
+ tzdata-arctic tzdata-asia tzdata-atlantic tzdata-australia \
+ tzdata-europe tzdata-pacific"
Refer SetUpTZApplet.lua
for some insight:
https://github.com/ralph-irving/squeezeos-squeezeplay/blob/public/8.0/src/squeezeplay_squeezeos/share/applets/SetupTZ/SetupTZApplet.lua#L20
The size of the generated zoneinfo
is a little less that the existing install. If tzdata-posix
andtzdata-right
are included, it would take it over by quite a lot, I think. I must check.
It would be very straightforward to replace the tzdata.bb
package with our own, say tzdata_for_SQP.bb
. That could give us exactly what we would want, including posixrules
, iso3166.tab
, and zone.tab
. I don't know that we particularly need these files, but can we know ?
I do think this is something that will want to be done. There is regular talk of abandoning summer time in Europe, or Some Parts Of Europe, and I guess the same in North America.
Initial results would suggest that busybox does not support the new tzdata. The timezone abbreviation is completely missing.
A -b fat
argument to zic
seems to overcome it. Also worth looking at will be the -r [@lo][/@hi]
argument.
I don't understand at the moment, but there seem to be 32 bit/64 bit issues in play.
I've made a customized 'tzdata', to be installed as poky/meta-squeezeos/packages/tzdata/tzdata-squeezeos_2021e.bb
.
The modified toolchain then changes to simply depend on this. Removes a certain amount of crud.
The built tzdata seems to be usable. Incidentally, I had the the same issue when using it on my Ubuntu 10.04.4 build system. So not just an issue with busybox date
.
DESCRIPTION = "Timezone data for SqueezeOS"
SECTION = "base"
PRIORITY = "optional"
DEPENDS = "tzcode-native"
# This recipe is a customized version of 'tzdata', which builds the time
# zone database '/usr/share/zoneinfo'. It replaces the time zone database
# provided by the CSL tool chain.
# It is intended to be automatically invoked by recipe
# 'external-csl-toolchain_2010q1-202-modified.bb'
# The recipe 'tzdata' cannot be used 'as is' for this purpose, as it
# does not compile suitable databse files for this older 32 bit OS.
PR = "r0"
# Taken from the 'tzdata' recipe - presumably older packages.
RCONFLICTS= "timezones timezone-africa timezone-america timezone-antarctica \
timezone-arctic timezone-asia timezone-atlantic \
timezone-australia timezone-europe timezone-indian \
timezone-iso3166.tab timezone-pacific timezone-zone.tab"
# This package will replace any packages provided by the 'tzdata' recipe.
RCONFLICTS += "tzdata tzdata-africa tzdata-americas tzdata-antarctica \
tzdata-arctic tzdata-asia tzdata-atlantic \
tzdata-australia tzdata-europe tzdata-misc \
tzdata-pacific tzdata-posix tzdata-right"
SRC_URI = "https://data.iana.org/time-zones/releases/tzdata${PV}.tar.gz"
S = "${WORKDIR}"
# time zone data files provided by the source package
TZONES= "africa antarctica asia australasia europe northamerica southamerica \
factory etcetera backward \
"
do_compile () {
# create the timezone (tzif) files
for zone in ${TZONES}; do \
# Need the '-b fat' option to generate tzif files compatible with older 32 bit systems.
${STAGING_BINDIR_NATIVE}/zic -d ${S}${datadir}/zoneinfo -b fat -L /dev/null \
${S}/${zone} ; \
${STAGING_BINDIR_NATIVE}/zic -d ${S}${datadir}/zoneinfo/posix -b fat -L /dev/null \
${S}/${zone} ; \
${STAGING_BINDIR_NATIVE}/zic -d ${S}${datadir}/zoneinfo/right -b fat -L ${S}/leapseconds \
${S}/${zone} ; \
done
# generate a posixrules file
ln -s America/New_York ${S}${datadir}/zoneinfo/posixrules
}
do_install () {
# make target directories available
install -d -m 0755 ${D}${datadir}/zoneinfo
install -d -m 0755 ${D}${sysconfdir}
# copy over generated zoneinfo directory - preserving permissions
cp -pPR ${S}${datadir}/zoneinfo ${D}${datadir}
# supplementary files
install -m 0644 ${S}/iso3166.tab ${D}${datadir}/zoneinfo
install -m 0644 ${S}/zone.tab ${D}${datadir}/zoneinfo
install -m 0644 ${S}/zone1970.tab ${D}${datadir}/zoneinfo
# create /etc/localtime link
ln -s ../usr/share/zoneinfo/Factory ${D}/${sysconfdir}/localtime
}
FILES_${PN} = "${datadir}/zoneinfo ${sysconfdir}"
### TO DO
## Can we depend on a particular version of tzcode-native ?
## This recipe was based on v 2021e
## Can we reduce the considerable growth in file size ?
## Yes:
## By excluding 'posix' and 'right' timezone data, if we don't need it
## Perhaps by identifying and picking off exotics
## SetUpTZApplet.lua barely uses any of the timzones.
## Should it be extended to bring up to date to modern needs, i.e. new time zones ?
## We could then use the revised list to winnow down what we install.
## Check that all required timezones are installed.
## Verify against SqueezePlay, LMS, existingg SqueezeOS, etc.
## E.g. datetime.lua, SetupTZApplet.lua, ...
## How does SqueezeOS/LMS use this stuff ?
## Is the generated zoneinfo database compatible with our old OS ?
## Do we need posixrules -> America/New_York ? None of the tzdata packages provide it.
## Do we need:
# iso3166.tab
# zone.tab
# zone1970.tab
Yes, "they" are trying to keep eastern daylight savings time year round here. It's been in the works for several years, but trying to get the various states and provinces to agree is proving to be a challenge.
I haven't found any references to the three .tab files in the firmware images I checked.
I like your idea to add more timezones to the lua applet and only add the zoneinfo files to match. But how to determine which ones?
I tried to build and test the latest change proposal today but have a conflict with tzdata-misc. Unfortunately, I won't be able to get back to it until later this week.
remove_packaging_data_files
rm -rf /home/ralphy/source/squeezeos/poky/build/tmp-baby/rootfs/usr/lib/opkg/
rm -f '/home/ralphy/source/squeezeos/poky/build/tmp-baby/rootfs/usr/lib/opkg/lists/*'
log_check rootfs
set +x
log_check: Using /home/ralphy/source/squeezeos/poky/build/tmp-baby/work/baby-none-linux-gnueabi/squeezeos-image-1.0-r1/temp/log.do_rootfs.27229 as logfile
log_check: There were error messages in the logfile
log_check: Matched keyword: [ERR]
log_check: Using /home/ralphy/source/squeezeos/poky/build/tmp-baby/work/baby-none-linux-gnueabi/squeezeos-image-1.0-r1/temp/log.do_rootfs.27229 as logfile
log_check: There were error messages in the logfile
log_check: Matched keyword: [ERR]
(offline root mode: not running udev.postinst)
Configuring update-rc.d
Configuring watchdog
Configuring wireless-tools
Configuring wpa-supplicant
Collected errors:
* ERROR: The following packages conflict with tzdata-squeezeos:
* tzdata-misc *
+ '[' '!' -z '' ']'
+ export D=/home/ralphy/source/squeezeos/poky/build/tmp-baby/rootfs
+ D=/home/ralphy/source/squeezeos/poky/build/tmp-baby/rootfs
I like your idea to add more timezones to the lua applet and only add the zoneinfo files to match. But how to determine which ones?
Good question ! I shall plan on a little research over the next couple of weeks or so to see what might be sensible to add to the lua applet.
Perhaps just removing posix
and right
from the zoneinfo files might be perfectly acceptable. It would be enough to get the image size back down to where it was.
I tried to build and test the latest change proposal today but have a conflict with tzdata-misc.
\<snip>
* ERROR: The following packages conflict with tzdata-squeezeos: * tzdata-misc *
Excellent ! So that worked as intended.
Have you tried bitbake -c clean tzdata
? Always worked for me...
I've raised a PR, https://github.com/ralph-irving/squeezeos/pull/17, to provide a concrete implementation of what has been discussed here.
Thanks for doing this. I never managed to get the above changes to build, but was successful using those in PR,#17.
Issue resolved by PR Update timezone data #17.
Further to earlier comments, I think I have found a clean solution to updating SqueezeOS timezone data.
It is really a very early draft pull request, so I've presented it in patch form. I hope this format works.
As you will, there remains an amount of validation to do.