Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-28 Thread Xu, Lizhi via lists.openembedded.org
On Tue, 28 Nov 2023 16:44:46 +0800, Lizhi wrote:
> > > > > > tzdata.bb by default pulls in all possible timezone data packages
> > > > > > which increases size of the final root filesystem considerably.
> > > > > > The customer would like to have extra timezones configurable so
> > > > > > that only tzdata-core is chosen by default and rest of the zones 
> > > > > > are optional.
> > > > > > This change would make the fs size a lot smaller.
> > > > > >
> > > > > > Comparison of customized package volume before and after:
> > > > > > When TZ_PACKAGES contains all tzdata packets, the image size of 
> > > > > > tzdata is 7.4MB.
> > > > > > The difference in mirror size between the two is 7MB.
> > > > > >
> > > > > > When TZ_PACKAGES only retains one tzdata-core, the image size
> > > > > > generated by tzdata is 320KB.
> > > > > >
> > > > > > Signed-off-by: Lizhi Xu 
> > > > >
> > > > > I get what you're trying to do, but this looks horrid. How about
> > > > > splitting into multiple packages based on top level directory (plus
> > > > > the few which sit in the top level directory) using a new
> > > > > PACKAGESPLITFUNCS so you don't have to hardcode the list of packages?
> > > > >
> > > >
> > > > Foolishly, I didn't actually look at what was in the tzdata recipe
> > > > first and it already splits things... I'm lost, can't you just remove
> > > > things from TZ_PACKAGES to get what you're after?
> > > To achieve a final reduction in the size of the tzdata package, simply 
> > > configuring TZ_PACKAGES is not enough. It is also necessary to delete the 
> > > corresponding zoneinfo when generating the final package, this requires 
> > > performing the corresponding deletion operation in the do_install() task 
> > > simultaneously, which is too complex for users.
> > >
> > > Therefore, this patch is provided to simplify the step of reducing 
> > > package size.
> > > After applying this patch, users only need to modify the OP_TZ in tzd.inc 
> > > to determine which time zones are needed in the final generated package, 
> > > in order to facilitate customization of the final size of the tzdata 
> > > package.
> > >
> > > Thanks,
> > > Lizhi
> >
> > This is the wrong way how to achieve smaller rootfs.
> > If you grep oe-core and meta-oe for tzdata, you'll see that you break 
> > things (e.g. glib-2.0 ptest depends on specific tzdata you're trying to 
> > remove).
> If the default value of "OP_TZ" is adjusted to the following value, the 
> problem
> you described will not occur:
> OP_TZ = "tzdata-misc tzdata-posix tzdata-right tzdata-africa \
> tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
> tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific \
>  "
> >
> > Yocto has concept of packages and tzdata is good example how to use them.
> > Just install packages you need instead of generic tzdata package which 
> > pulls all.
> > If you need the empty main tzdata package because of its postinst, then 
> > just reduce the list what is pulled here:
> > RDEPENDS:${PN} = "${TZ_PACKAGES}"
Yes, You are right.
After only containing "tzdata-core" in RDEPENDS, only the data corresponding to
"tzdata-core" will be included in rootfs, thereby reducing the volume of rootfs.
> I didn't understand what you said.
> If we don't adjust tzdata.bb and instead adjust all packages that depend on
> tzdata at runtime, the customer may lose patience.

Lizhi

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191353): 
https://lists.openembedded.org/g/openembedded-core/message/191353
Mute This Topic: https://lists.openembedded.org/mt/102777104/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-28 Thread Peter Marko via lists.openembedded.org
-Original Message-
From: openembedded-core@lists.openembedded.org 
 On Behalf Of Xu, Lizhi via 
lists.openembedded.org
Sent: Tuesday, November 28, 2023 9:45
To: Marko, Peter (ADV D EU SK BFS1) 
Cc: alex.kier...@gmail.com; openembedded-core@lists.openembedded.org
Subject: Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

> On Tue, 28 Nov 2023 08:13:57 +, Marko, Peter wrote:
> > > > > > tzdata.bb by default pulls in all possible timezone data 
> > > > > > packages which increases size of the final root filesystem 
> > > > > > considerably.
> > > > > > The customer would like to have extra timezones configurable 
> > > > > > so that only tzdata-core is chosen by default and rest of the zones 
> > > > > > are optional.
> > > > > > This change would make the fs size a lot smaller.
> > > > > >
> > > > > > Comparison of customized package volume before and after:
> > > > > > When TZ_PACKAGES contains all tzdata packets, the image size of 
> > > > > > tzdata is 7.4MB.
> > > > > > The difference in mirror size between the two is 7MB.
> > > > > >
> > > > > > When TZ_PACKAGES only retains one tzdata-core, the image size 
> > > > > > generated by tzdata is 320KB.
> > > > > >
> > > > > > Signed-off-by: Lizhi Xu 
> > > > >
> > > > > I get what you're trying to do, but this looks horrid. How about 
> > > > > splitting into multiple packages based on top level directory 
> > > > > (plus the few which sit in the top level directory) using a new 
> > > > > PACKAGESPLITFUNCS so you don't have to hardcode the list of packages?
> > > > >
> > > >
> > > > Foolishly, I didn't actually look at what was in the tzdata recipe 
> > > > first and it already splits things... I'm lost, can't you just 
> > > > remove things from TZ_PACKAGES to get what you're after?
> > > To achieve a final reduction in the size of the tzdata package, simply 
> > > configuring TZ_PACKAGES is not enough. It is also necessary to delete the 
> > > corresponding zoneinfo when generating the final package, this requires 
> > > performing the corresponding deletion operation in the do_install() task 
> > > simultaneously, which is too complex for users.
> > >
> > > Therefore, this patch is provided to simplify the step of reducing 
> > > package size.
> > > After applying this patch, users only need to modify the OP_TZ in tzd.inc 
> > > to determine which time zones are needed in the final generated package, 
> > > in order to facilitate customization of the final size of the tzdata 
> > > package.
> > >
> > > Thanks,
> > > Lizhi
> > 
> > This is the wrong way how to achieve smaller rootfs.
> > If you grep oe-core and meta-oe for tzdata, you'll see that you break 
> > things (e.g. glib-2.0 ptest depends on specific tzdata you're trying to 
> > remove).
> If the default value of "OP_TZ" is adjusted to the following value, the 
> problem you described will not occur:
> OP_TZ = "tzdata-misc tzdata-posix tzdata-right tzdata-africa \
> tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
> tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific \  "
> > 
> > Yocto has concept of packages and tzdata is good example how to use them.
> > Just install packages you need instead of generic tzdata package which 
> > pulls all.
> > If you need the empty main tzdata package because of its postinst, then 
> > just reduce the list what is pulled here:
> > RDEPENDS:${PN} = "${TZ_PACKAGES}"
> I didn't understand what you said. 
> If we don't adjust tzdata.bb and instead adjust all packages that depend on 
> tzdata at runtime, the customer may lose patience.
>
> Lizhi

I meant that your patch can be probably reduced to following:
- RDEPENDS:${PN} = "${TZ_PACKAGES}"
+ MAIN_TZ_PACKAGES ?= "${TZ_PACKAGES}"
+ RDEPENDS:${PN} = "${MAIN_TZ_PACKAGES}"
And they you can just do following in your distro:
MAIN_TZ_PACKAGES:pn-tzdata = "tzdata-americas tzdata-europe"

Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191348): 
https://lists.openembedded.org/g/openembedded-core/message/191348
Mute This Topic: https://lists.openembedded.org/mt/102777104/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-28 Thread Xu, Lizhi via lists.openembedded.org
On Tue, 28 Nov 2023 08:13:57 +, Marko, Peter wrote:
> > > > > tzdata.bb by default pulls in all possible timezone data packages
> > > > > which increases size of the final root filesystem considerably.
> > > > > The customer would like to have extra timezones configurable so
> > > > > that only tzdata-core is chosen by default and rest of the zones are 
> > > > > optional.
> > > > > This change would make the fs size a lot smaller.
> > > > >
> > > > > Comparison of customized package volume before and after:
> > > > > When TZ_PACKAGES contains all tzdata packets, the image size of 
> > > > > tzdata is 7.4MB.
> > > > > The difference in mirror size between the two is 7MB.
> > > > >
> > > > > When TZ_PACKAGES only retains one tzdata-core, the image size
> > > > > generated by tzdata is 320KB.
> > > > >
> > > > > Signed-off-by: Lizhi Xu 
> > > >
> > > > I get what you're trying to do, but this looks horrid. How about
> > > > splitting into multiple packages based on top level directory (plus
> > > > the few which sit in the top level directory) using a new
> > > > PACKAGESPLITFUNCS so you don't have to hardcode the list of packages?
> > > >
> > >
> > > Foolishly, I didn't actually look at what was in the tzdata recipe
> > > first and it already splits things... I'm lost, can't you just remove
> > > things from TZ_PACKAGES to get what you're after?
> > To achieve a final reduction in the size of the tzdata package, simply 
> > configuring TZ_PACKAGES is not enough. It is also necessary to delete the 
> > corresponding zoneinfo when generating the final package, this requires 
> > performing the corresponding deletion operation in the do_install() task 
> > simultaneously, which is too complex for users.
> >
> > Therefore, this patch is provided to simplify the step of reducing package 
> > size.
> > After applying this patch, users only need to modify the OP_TZ in tzd.inc 
> > to determine which time zones are needed in the final generated package, in 
> > order to facilitate customization of the final size of the tzdata package.
> >
> > Thanks,
> > Lizhi
> 
> This is the wrong way how to achieve smaller rootfs.
> If you grep oe-core and meta-oe for tzdata, you'll see that you break things 
> (e.g. glib-2.0 ptest depends on specific tzdata you're trying to remove).
If the default value of "OP_TZ" is adjusted to the following value, the problem
you described will not occur:
OP_TZ = "tzdata-misc tzdata-posix tzdata-right tzdata-africa \
tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific \
 "
> 
> Yocto has concept of packages and tzdata is good example how to use them.
> Just install packages you need instead of generic tzdata package which pulls 
> all.
> If you need the empty main tzdata package because of its postinst, then just 
> reduce the list what is pulled here:
> RDEPENDS:${PN} = "${TZ_PACKAGES}"
I didn't understand what you said. 
If we don't adjust tzdata.bb and instead adjust all packages that depend on 
tzdata at runtime, the customer may lose patience.

Lizhi

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191346): 
https://lists.openembedded.org/g/openembedded-core/message/191346
Mute This Topic: https://lists.openembedded.org/mt/102777104/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-28 Thread Peter Marko via lists.openembedded.org
-Original Message-
From: openembedded-core@lists.openembedded.org 
 On Behalf Of Xu, Lizhi via 
lists.openembedded.org
Sent: Tuesday, November 28, 2023 3:38
To: alex.kier...@gmail.com
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

> On Fri, 24 Nov 2023 16:50:04 +, Alex Kiernan wrote:
> > > > tzdata.bb by default pulls in all possible timezone data packages 
> > > > which increases size of the final root filesystem considerably.
> > > > The customer would like to have extra timezones configurable so 
> > > > that only tzdata-core is chosen by default and rest of the zones are 
> > > > optional.
> > > > This change would make the fs size a lot smaller.
> > > >
> > > > Comparison of customized package volume before and after:
> > > > When TZ_PACKAGES contains all tzdata packets, the image size of tzdata 
> > > > is 7.4MB.
> > > > The difference in mirror size between the two is 7MB.
> > > >
> > > > When TZ_PACKAGES only retains one tzdata-core, the image size 
> > > > generated by tzdata is 320KB.
> > > >
> > > > Signed-off-by: Lizhi Xu 
> > >
> > > I get what you're trying to do, but this looks horrid. How about 
> > > splitting into multiple packages based on top level directory (plus 
> > > the few which sit in the top level directory) using a new 
> > > PACKAGESPLITFUNCS so you don't have to hardcode the list of packages?
> > >
> > 
> > Foolishly, I didn't actually look at what was in the tzdata recipe 
> > first and it already splits things... I'm lost, can't you just remove 
> > things from TZ_PACKAGES to get what you're after?
> To achieve a final reduction in the size of the tzdata package, simply 
> configuring TZ_PACKAGES is not enough. It is also necessary to delete the 
> corresponding zoneinfo when generating the final package, this requires 
> performing the corresponding deletion operation in the do_install() task 
> simultaneously, which is too complex for users. 
>
> Therefore, this patch is provided to simplify the step of reducing package 
> size.
> After applying this patch, users only need to modify the OP_TZ in tzd.inc to 
> determine which time zones are needed in the final generated package, in 
> order to facilitate customization of the final size of the tzdata package.
>
> Thanks,
> Lizhi

This is the wrong way how to achieve smaller rootfs.
If you grep oe-core and meta-oe for tzdata, you'll see that you break things 
(e.g. glib-2.0 ptest depends on specific tzdata you're trying to remove).

Yocto has concept of packages and tzdata is good example how to use them.
Just install packages you need instead of generic tzdata package which pulls 
all.
If you need the empty main tzdata package because of its postinst, then just 
reduce the list what is pulled here:
RDEPENDS:${PN} = "${TZ_PACKAGES}"

Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191345): 
https://lists.openembedded.org/g/openembedded-core/message/191345
Mute This Topic: https://lists.openembedded.org/mt/102777104/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-27 Thread Xu, Lizhi via lists.openembedded.org
On Fri, 24 Nov 2023 16:50:04 +, Alex Kiernan wrote:
> > > tzdata.bb by default pulls in all possible timezone data packages which
> > > increases size of the final root filesystem considerably.
> > > The customer would like to have extra timezones configurable so that only
> > > tzdata-core is chosen by default and rest of the zones are optional.
> > > This change would make the fs size a lot smaller.
> > >
> > > Comparison of customized package volume before and after:
> > > When TZ_PACKAGES contains all tzdata packets, the image size of tzdata is 
> > > 7.4MB.
> > > The difference in mirror size between the two is 7MB.
> > >
> > > When TZ_PACKAGES only retains one tzdata-core, the image size generated by
> > > tzdata is 320KB.
> > >
> > > Signed-off-by: Lizhi Xu 
> >
> > I get what you're trying to do, but this looks horrid. How about
> > splitting into multiple packages based on top level directory (plus
> > the few which sit in the top level directory) using a new
> > PACKAGESPLITFUNCS so you don't have to hardcode the list of packages?
> >
> 
> Foolishly, I didn't actually look at what was in the tzdata recipe
> first and it already splits things... I'm lost, can't you just remove
> things from TZ_PACKAGES to get what you're after?
To achieve a final reduction in the size of the tzdata package, simply 
configuring 
TZ_PACKAGES is not enough. It is also necessary to delete the corresponding 
zoneinfo 
when generating the final package, this requires performing the corresponding 
deletion 
operation in the do_install() task simultaneously, which is too complex for 
users. 

Therefore, this patch is provided to simplify the step of reducing package size.
After applying this patch, users only need to modify the OP_TZ in tzd.inc to 
determine which time zones are needed in the final generated package, in order
to facilitate customization of the final size of the tzdata package.

Thanks,
Lizhi

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191333): 
https://lists.openembedded.org/g/openembedded-core/message/191333
Mute This Topic: https://lists.openembedded.org/mt/102777104/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-24 Thread Alex Kiernan
On Fri, Nov 24, 2023 at 2:12 PM Alex Kiernan via
lists.openembedded.org 
wrote:
>
> On Fri, Nov 24, 2023 at 6:21 AM Xu, Lizhi via lists.openembedded.org
>  wrote:
> >
> > tzdata.bb by default pulls in all possible timezone data packages which
> > increases size of the final root filesystem considerably.
> > The customer would like to have extra timezones configurable so that only
> > tzdata-core is chosen by default and rest of the zones are optional.
> > This change would make the fs size a lot smaller.
> >
> > Comparison of customized package volume before and after:
> > When TZ_PACKAGES contains all tzdata packets, the image size of tzdata is 
> > 7.4MB.
> > The difference in mirror size between the two is 7MB.
> >
> > When TZ_PACKAGES only retains one tzdata-core, the image size generated by
> > tzdata is 320KB.
> >
> > Signed-off-by: Lizhi Xu 
>
> I get what you're trying to do, but this looks horrid. How about
> splitting into multiple packages based on top level directory (plus
> the few which sit in the top level directory) using a new
> PACKAGESPLITFUNCS so you don't have to hardcode the list of packages?
>

Foolishly, I didn't actually look at what was in the tzdata recipe
first and it already splits things... I'm lost, can't you just remove
things from TZ_PACKAGES to get what you're after?

-- 
Alex Kiernan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191209): 
https://lists.openembedded.org/g/openembedded-core/message/191209
Mute This Topic: https://lists.openembedded.org/mt/102777104/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-24 Thread Alex Kiernan
On Fri, Nov 24, 2023 at 6:21 AM Xu, Lizhi via lists.openembedded.org
 wrote:
>
> tzdata.bb by default pulls in all possible timezone data packages which
> increases size of the final root filesystem considerably.
> The customer would like to have extra timezones configurable so that only
> tzdata-core is chosen by default and rest of the zones are optional.
> This change would make the fs size a lot smaller.
>
> Comparison of customized package volume before and after:
> When TZ_PACKAGES contains all tzdata packets, the image size of tzdata is 
> 7.4MB.
> The difference in mirror size between the two is 7MB.
>
> When TZ_PACKAGES only retains one tzdata-core, the image size generated by
> tzdata is 320KB.
>
> Signed-off-by: Lizhi Xu 

I get what you're trying to do, but this looks horrid. How about
splitting into multiple packages based on top level directory (plus
the few which sit in the top level directory) using a new
PACKAGESPLITFUNCS so you don't have to hardcode the list of packages?

-- 
Alex Kiernan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191202): 
https://lists.openembedded.org/g/openembedded-core/message/191202
Mute This Topic: https://lists.openembedded.org/mt/102777104/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[PATCH V2] [OE-core] tzdata: Reduced time zone configuration

2023-11-23 Thread Xu, Lizhi via lists.openembedded.org
tzdata.bb by default pulls in all possible timezone data packages which 
increases size of the final root filesystem considerably.
The customer would like to have extra timezones configurable so that only
tzdata-core is chosen by default and rest of the zones are optional.
This change would make the fs size a lot smaller.

Comparison of customized package volume before and after:
When TZ_PACKAGES contains all tzdata packets, the image size of tzdata is 7.4MB.
The difference in mirror size between the two is 7MB.

When TZ_PACKAGES only retains one tzdata-core, the image size generated by
tzdata is 320KB.

Signed-off-by: Lizhi Xu 
---
 meta/recipes-extended/timezone/README.txt |   8 ++
 meta/recipes-extended/timezone/tzd.inc|   3 +
 meta/recipes-extended/timezone/tzdata-cus.inc | 114 ++
 meta/recipes-extended/timezone/tzdata.bb  |   1 +
 4 files changed, 126 insertions(+)
 create mode 100644 meta/recipes-extended/timezone/README.txt
 create mode 100644 meta/recipes-extended/timezone/tzd.inc
 create mode 100644 meta/recipes-extended/timezone/tzdata-cus.inc

diff --git a/meta/recipes-extended/timezone/README.txt 
b/meta/recipes-extended/timezone/README.txt
new file mode 100644
index 00..e0c6bfdc2e
--- /dev/null
+++ b/meta/recipes-extended/timezone/README.txt
@@ -0,0 +1,8 @@
+# Timezones Config 
+Set the parameter "OP_TZ" in the file "tzd.inc" to increase or 
+decrease the time zone in rootfs, as shown in the following example:
+
+1. Add time zone Asia and Americas, set OP_TZ=" tzdata-asia tzdata-americas"
+
+2. Delete time zone Americas, set OP_TZ=" tzdata-asia"
+
diff --git a/meta/recipes-extended/timezone/tzd.inc 
b/meta/recipes-extended/timezone/tzd.inc
new file mode 100644
index 00..fd59531063
--- /dev/null
+++ b/meta/recipes-extended/timezone/tzd.inc
@@ -0,0 +1,3 @@
+OP_TZ=" tzdata-americas \
+   tzdata-asia \
+"
diff --git a/meta/recipes-extended/timezone/tzdata-cus.inc 
b/meta/recipes-extended/timezone/tzdata-cus.inc
new file mode 100644
index 00..db97ac7a02
--- /dev/null
+++ b/meta/recipes-extended/timezone/tzdata-cus.inc
@@ -0,0 +1,114 @@
+require tzd.inc
+# Packages are primarily organized by directory with a major city in most time
+# zones in the base package
+TZ_PACKAGES = " \
+tzdata-core \
+${OP_TZ} \
+"
+
+# delete posix
+do_install:append() { 
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-posix" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/posix
+   fi
+}
+
+# delete right
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-right" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/right
+   fi
+}
+
+# delete america
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-americas" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/America
+   rm -rf ${D}${datadir}/zoneinfo/US
+   rm -rf ${D}${datadir}/zoneinfo/Brazil
+   rm -rf ${D}${datadir}/zoneinfo/Canada
+   rm -rf ${D}${datadir}/zoneinfo/Mexico
+   rm -rf ${D}${datadir}/zoneinfo/Chile
+   fi
+}
+
+# delete europe
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-europe" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/Europe
+   fi
+}
+
+# delete africa
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-africa" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/Africa
+   fi
+}
+
+# delete atlantic
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-atlantic" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/Atlantic
+   fi
+}
+
+# delete pacific
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-pacific" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/Pacific
+   fi
+}
+
+# delete antarctica
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-antarctica" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/Antarctica
+   fi
+}
+
+# delete australia
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-australia" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/Australia
+   fi
+}
+
+# delete arctic
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-arctic" 2>&1; then
+   rm -rf ${D}${datadir}/zoneinfo/Arctic
+   fi
+}
+
+# delete misc
+do_install:append() {  
+   if ! echo "${TZ_PACKAGES}" | grep -c "tzdata-misc" 2>&1; then
+   rm ${D}${datadir}/zoneinfo/Cuba
+   rm ${D}${datadir}/zoneinfo/Egypt
+   rm ${D}${datadir}/zoneinfo/Eire
+   rm ${D}${datadir}/zoneinfo/Factory
+   rm ${D}${datadir}/zoneinfo/GB-Eire
+   rm ${D}${datadir}/zoneinfo/Hongkong
+   rm ${D}${datadir}/zoneinfo/Iceland
+   rm