Gentoo Archives: gentoo-embedded

From: Ed W <lists@××××××××××.com>
To: gentoo-embedded@l.g.o
Subject: [gentoo-embedded] Stripping down Perl install
Date: Fri, 18 Mar 2011 12:03:45
Message-Id: 4D834506.5000605@wildgooses.com
1 Hi, I'm trying to strip perl down as much as possible for a small
2 embedded server. The end app will just run server type applications
3 (and possibly a perl based web application for configuration). All
4 modules needed will be bundled in the build so I have removed CPAN,
5 debugger, headers, etc
6
7 Another design point is that I have decided that I don't need to support
8 locale's other than the main english, unicode (and unicode european
9 languages).
10
11 OK, so this is my INSTALL_MASK to install perl (ignore the line breaks)
12
13 export INSTALL_MASK="${INSTALL_MASK} */usr/lib/perl5/*.h
14 usr/lib/perl5/5.*/ExtUtils/
15 usr/lib/perl5/5.*/CPAN/
16 usr/lib/perl5/5.*/CPANPLUS/
17 usr/lib/perl5/5.*/*-linux-*/auto/Encode/JP
18 usr/lib/perl5/5.*/*-linux-*/auto/Encode/KR
19 usr/lib/perl5/5.*/*-linux-*/auto/Encode/CN
20 usr/lib/perl5/5.*/*-linux-*/auto/Encode/TW
21 usr/lib/perl5/5.*/*-linux-*/Devel/
22 usr/lib/perl5/5.*/*-linux-*/auto/Devel/
23 usr/lib/perl5/5.*/Module/CoreList.pm
24 usr/lib/perl5/5.*/Module/Build*
25 usr/lib/perl5/5.*/perl5db.pl usr/lib
26 /perl5/5.*/[Pp]od
27 usr/lib/perl5/5.*/unicore/mktables
28 usr/lib/perl5/5.*/unicore/TestProp.pl
29 */usr/lib/perl5/5.*/unicore/*.txt
30 */usr/lib/perl5/*.pod"
31
32 Afterwards I then strip a huge bunch of comments out of some perl files:
33 sed -i -e 's/^#.*//' -e '/^$/d' \
34 ${TARGET}/usr/lib/perl5/5.12.2/unicore/lib/*/*.pl
35
36
37 Now that gets me down to some 20-30MB install size, but the squashfs
38 size of the same is around 4MB (vs around 10-12MB normal).
39
40 The main size reduction from here is reducing the unicode file sizes. I
41 have had a quick hack at this above by eliminating some of the
42 JP/KR/CN/TW stuff, but there is still some 10s MB that could be removed.
43 I think the solution is to understand how mktables works and customise
44 it so that it generates only the required lookup tables? Anyone got any
45 experience or solutions?
46
47 Any other ideas on shrinking the install further? (I'm a bit reluctant
48 to strip too many core modules at this stage until the final build is
49 decided - also most only consume a few KBs...)
50
51 Thanks
52
53 Ed W

Replies

Subject Author
Re: [gentoo-embedded] Stripping down Perl install Arkadi Shishlov <arkadi.shishlov@×××××.com>