Home Forum Developers General discussions Slimming down the image

JRPassphrase Registration Control

In order to register on this site, you must first submit the passphrase below.

TODO list for each hardware target can be found as sticky topic in the corresponding forum


Chewi
useravatar
User Info

Slimming down the image

Now that I know the maximum image size is 8MB, at least without tinkering with the partition table, I'd like to present some ideas for slimming down the image.

It's late so I'll write more on this tomorrow but the first question I'd like to ask is... does anything actually need libgfortran.so? It seems highly unlikely. Even my desktop machine doesn't have it! It's taking up 461KB so that is quite a big win just to start with.


Administrator has disabled public posting
admin
useravatar
User Info

Re: Slimming down the image

Hi James,

The maxim image can be bigger then 8MB. Can you please post your uboot envirounment variables (print in uboot prompt)

Best Regards
Dimitar


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Slimming down the image

You can use toolchain/opt/uClinux/bfin-linux-uclibc/bin/bfin-linux-uclibc-readelf to check what shared libraries, if any, applications in /bin need to run.

You can probably remove those:

Code:


-rwxr-xr-x  1 root root 461032 2011-06-21 16:17 libgfortran.so.3*
-rwxr-xr-x  1 root root  25860 2011-06-21 16:17 libgomp.so.1*
-rwxr-xr-x  1 root root  90516 2011-06-21 16:17 libmudflap.so.0*
-rwxr-xr-x  1 root root  94828 2011-06-21 16:17 libmudflapth.so.0*
-rwxr-xr-x  1 root root  81204 2011-06-21 16:17 libobjc.so.2*
-rwxr-xr-x  1 root root 276780 2011-07-11 14:04 libtiff.so.3*

Likewise, there may be applications in /bin that you don't need on a regular basis (you can always download the app for a one-time operation and remove it afterwards).


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Slimming down the image

Thanks, Gilles. I know about readelf but that doesn't tell me about the applications I haven't installed. Since I will be working with Switchfin a lot, I would like to make it work better out of the box. It would be useful if it didn't install big libraries that nothing in the repository actually needs. Of course, someone may have some other software that does need it but I can provide an "Extra toolchain libraries" option if necessary.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Slimming down the image

If you add applications later, it's up to you to make sure the shared libraries they need are available.

Those unneeded libraries are actually installed by the uClinux-dist, not Switchfin. uClinux-dist provides the option to trim down those ELF libraries, but it's safer to run a Makefile to remove those yourself: Run "make menuconfig", and in the "uClinux Distribution Configuration > Blackfin build options" menu, enable "Cull unused ELF shared libraries", ie. CONFIG_INSTALL_ELF_TRIM_LIBS.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Slimming down the image

That's very helpful, thank you. I figured it was probably uClinux-dist that was installing it but I was struggling to find where it was doing this. Maybe it would be worth exposing this option in the Switchfin menuconfig.


Administrator has disabled public posting
admin
useravatar
User Info

Re: Slimming down the image

Hi Gilles,

Oh yes this seems very useful indeed smile
Will test it next time I have to rebuild Switchfin.

Best Regards
Dimitar


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Slimming down the image

I tried enabling CONFIG_INSTALL_ELF_TRIM_LIBS but it deleted libtonezone.so.2, which is needed by Asterisk, because Asterisk wasn't installed yet. So instead, I created a new menuselect option that runs the script after the rest of Switchfin has been built. This has now been committed.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Slimming down the image

Yes, that's why I advised not relying on that option in the menuconfig.


Administrator has disabled public posting
Henning
useravatar
User Info

Re: Slimming down the image

Hello guys,

I hope you enjoyed the holidays, too. :-)

So I'm back at working with Asterisk and I'm trying to reduce the memory footprint of Asterisk. Right now, Asterisk is running with only 10 modules (all I need in the moment), but 120 modules are complied, which is quite a waste of romfs size.

I tried to "uncheck" all not needed modules via "make asterisk-config". But that didn't work. After that I changed the file /package/asterisk/asterisk-1.4.makeops to exclude a lot more modules. But still, the romfs contains 120 modules in /usr/lib/asterisk.

Could someone please tell me (or give a hint), how I can prevent the build-process to compile all these unneeded modules?

best regards
Henning


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Slimming down the image

As this question deals with Asterisk in the absolute, not specifically with Asterisk running on the Atcom, you'll probably have more information by asking in the Asterisk forums/mailing lists.

http://www.asterisk.org/community
http://www.asterisk.org/developer/resources


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: Slimming down the image

Changing asterisk-1.4.makeopts should do the trick but it won't remove any modules that have already been installed. You might have to start with a clean build.


Administrator has disabled public posting
Henning
useravatar
User Info

Re: Slimming down the image

arrrgs, you are right chewi. asterisk-1.4.makeopts does the trick. But as long as I don't delete my romfs (/switchfin//built_xy/root), the old modules are still alive...

So now I'm down to 22 modules, but the gain is marginal. Only about 500 kB . So from that point of view it's not worth the trouble.

But on the other hand, I learnt something today. That's a good thing. smile

Thx
Henning


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: Slimming down the image

Slimming down Asterisk is a bit tricky, as some core features are actually located in modules instead of the main application hmm

That's one of the reasons that lead Anthony Minessale to give up working on Asterisk and writing Freeswitch.


Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 2587  Total Topics: 299  Total Polls: 1  Total Posts: 1727  Dormant
User Info:   Newest User :  user2553   Members Online: 0   Guests Online: 132
Online  There are no members online
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked