I've put a little time into generating a hyper small footprint linaro
headless image. From UDS the two sizes to try and fit into as I
understand are 64M and 128M installed. So with that in mind, via live
helper I created a headless image where none of the recommended
packages were installed. This brings the installed size of the root fs
down to 165Meg installed (excluding hwpacks)

With a little script-foo which I've created to be part of the
live-helper build I can get the rootfs installed size down to
82,240,000. This is without turning to the usual things to slim things
down like busybox as well as without going through /bin /sbin /usr/bin
/usr/lib /lib and pulling out specific function that isn't needed.

What I have done is gone after the low hanging fruit. That is i18n
locales, documentation, zoneinfo, charmaps and some X11 & firefox
things that obviously aren't needed since those things aren't
installed in headless anyway. All of that gets us down to `125Meg. To
get the next approx 40Meg I have to take out /var/lib/dpkg and
/var/lib/apt. This could make a certain amount of sense for a demo
system running on out NAND flash. This is somewhat problematic however
in so much if you want to use linaro-media-create with hwpacks, well
you need apt to work and that comes with the as mentioned 40 Meg price
tag.

Anyway this seemed to be a good Friday night over a beverage type of
hack to gain a little data just to see the effort required.

All in all I do think this is a reasonable approach to get to a "nano"
sized system that would fit into flash. To get that last mile tho, I
think we'd need to turn to busybox, audit the libs and binaries,
adjust the kernel build such that modules are kept to a minimum and
only function actually needed is built in the kernel as well as
working out the last bit of install via something
linaro-media-create-like so that one could at least get things onto an
SD card without too much hackery for test yet not gain the full 123
meg noted below.

Raw Data:
--------------

du of the 82 Meg system, hwpack not yet installed
4       ./proc
4       ./home
4       ./sys
9784    ./lib
3364    ./sbin
4       ./selinux
12      ./dev
4       ./srv
12      ./root
928     ./var
4       ./tmp
3688    ./bin
61456   ./usr
4       ./opt
2260    ./etc
4       ./mnt
4       ./boot
4       ./media
82240

du of the 125 Meg system (without /var/lib/apt and /var/lib/dpkg
chopped out) hwpack not installed yet
4       ./proc
4       ./home
4       ./sys
9784    ./lib
3364    ./sbin
4       ./selinux
12      ./dev
4       ./srv
12      ./root
44064   ./var
4       ./tmp
3688    ./bin
61456   ./usr
4       ./opt
2260    ./etc
4       ./mnt
4       ./boot
4       ./media
125376  .

du of installed system (based on the 125Meg image) after hwpack
installed and system is booted
4       ./home
4       ./opt
4       ./srv
4       ./mnt
65312   ./usr  <--- grew by 4 Meg
3764    ./bin
3444    ./sbin
16      ./root
4       ./tmp
75816   ./var     <-- var is ~31 Meg larger after hwpack install!!
4       ./selinux
0       ./sys
4       ./media
2276    ./etc
86524   ./lib     <-- lib after hwpack install is ~79 Meg larger!!
10400   ./boot  <-- grew by 10 Meg
188     ./dev
16      ./lost+found
0       ./proc
248484  .    <-- grew by ~123Meg

For those interested in following in my footsteps, my live helper
maverick config is located in here:

lp:~tom-gall/linaro/live-helper.config.maverick.headless-nano

du of original 165 Meg headless image without recommended packages.
4       ./proc
4       ./home
4       ./sys
852     ./lib/udev
4       ./lib/firmware
508     ./lib/security
148     ./lib/plymouth
200     ./lib/terminfo
40      ./lib/init
4       ./lib/modules
16      ./lib/lsb
9784    ./lib
3364    ./sbin
4       ./selinux
4       ./dev/pts
4       ./dev/shm
12      ./dev
4       ./srv
12      ./root
16      ./var/spool
4       ./var/lock
4       ./var/mail
12      ./var/log
43392   ./var/lib
4       ./var/run
4       ./var/tmp
4       ./var/opt
4       ./var/backups
612     ./var/cache
4       ./var/local
44064   ./var
4       ./tmp
3688    ./bin
34604   ./usr/lib
1580    ./usr/sbin
54756   ./usr/share
4       ./usr/games
4       ./usr/src
10260   ./usr/bin
40      ./usr/include
56      ./usr/local
101308  ./usr
4       ./opt
20      ./etc/udev
64      ./etc/pam.d
8       ./etc/rc5.d
8       ./etc/cron.monthly
36      ./etc/cron.daily
8       ./etc/rc4.d
4       ./etc/profile.d
8       ./etc/rsyslog.d
144     ./etc/console-setup
16      ./etc/skel
68      ./etc/initramfs-tools
8       ./etc/cron.hourly
28      ./etc/modprobe.d
56      ./etc/apt
48      ./etc/security
48      ./etc/default
20      ./etc/apparmor.d
8       ./etc/rc3.d
12      ./etc/kbd
8       ./etc/X11
664     ./etc/ssl
8       ./etc/insserv
4       ./etc/insserv.conf.d
8       ./etc/cron.d
16      ./etc/bash_completion.d
8       ./etc/alternatives
24      ./etc/sysctl.d
32      ./etc/dhcp3
12      ./etc/ld.so.conf.d
28      ./etc/iproute2
12      ./etc/apparmor
8       ./etc/terminfo
16      ./etc/update-motd.d
24      ./etc/dpkg
8       ./etc/rcS.d
4       ./etc/lsb-base
12      ./etc/firefox
8       ./etc/sudoers.d
172     ./etc/init
4       ./etc/opt
8       ./etc/ca-certificates
8       ./etc/rc1.d
36      ./etc/network
8       ./etc/python
8       ./etc/linaro
8       ./etc/rc6.d
8       ./etc/ldap
16      ./etc/logrotate.d
16      ./etc/logcheck
20      ./etc/kernel
8       ./etc/depmod.d
108     ./etc/init.d
8       ./etc/rc0.d
12      ./etc/vim
8       ./etc/rc2.d
8       ./etc/python2.6
12      ./etc/dbus-1
8       ./etc/cron.weekly
2280    ./etc
4       ./mnt
4       ./boot
4       ./media
165248  .


Regards,
Tom

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to