Chinaunix首页 | 论坛 | 博客
  • 博客访问: 16279
  • 博文数量: 4
  • 博客积分: 70
  • 博客等级: 民兵
  • 技术积分: 35
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-14 11:47
文章分类
文章存档

2011年(4)

我的朋友

分类: LINUX

2011-12-09 11:32:42

from:
 
一般情况下,Uimage 是内核和文件系统的组合。
确认:在内核配置中你已经关闭你不需要的东西-通过文件系统和删除你不需要的。
想要找到romfs中比较大的程序,可以尝试:
  1. uClinux-dist> find -P ./romfs/ -type f -printf "%s %p\n" | sort -nr | less

会打印出romfs文件列表,降序排列。如:
------------------------------------------------------------------
  1. 461296 ./romfs/lib/libgfortran.so.3
  2. 247564 ./romfs/lib/libc.so.0
  3. 186268 ./romfs/lib/libthread_db.so.1
  4. 171708 ./romfs/bin/busybox
  5. 95004 ./romfs/lib/libmudflapth.so.0
  6. 90684 ./romfs/lib/libmudflap.so.0
  7. 81268 ./romfs/lib/libobjc.so.2
  8. 62416 ./romfs/lib/libgcc_s.so.1
  9. 62280 ./romfs/lib/libm.so.0
  10. 39312 ./romfs/lib/libpthread.so.0
  11. 25860 ./romfs/lib/libgomp.so.1
  12. 20396 ./romfs/lib/ld-uClibc.so.0

---------------------------------------------------------------------
你需要删除其中你不需要的比较大的一个。这说起来比较容易做起来比较难,你可以通过romfs运行一个小的shell脚本,来查找在/lib目录中暂时没有引用到的库,通过
这些库,并打印出他们的依赖关系。
例如:
-----------------------------------------------------------------------
  1. rgetz@imhotep:~/blackfin/trunk/uClinux-dist> for i in $(bfin-elf-readelf -d $(find -P ./romfs -perm -001 -type f | grep -v "./lib/") | grep NEEDED | awk '{print $5}' | sort | uniq |
  2. sed -e 's/\[//' -e 's/\]//' ) ; do echo $i; bfin-elf-readelf -d ./romfs/lib/$i 2>/dev/null | grep NEEDED | awk '{print $5}' | sed -e 's/\[//' -e 's/\]//' ; done | sort | uniq

  3. ld-uClibc.so.0
  4. libcrypt.so.0
  5. libc.so.0
  6. libdl.so.0
  7. libgcc_s.so.1
  8. libid3tag.so.0
  9. libjpeg.so.62
  10. libmad.so.0
  11. libm.so.0
  12. libpng12.so.0
  13. libpthread.so.0
  14. libthread_db.so.1
  15. libutil.so.0
  16. libz.so.1
-----------------------------------------------------------------------------
通过这个脚本,可以产生一个列表,你不能删除列表中的任何东西。(除非你只构建在FLAT格式,并且不打算使用FDPIC)
你可以暂时把其他的库拷贝到你的外存中,SD卡等。在合适的时候再把他们拷贝回去。
 
 
other:
 
The first thing to do is select/unselect (depending on if you want to install the shared libraries):
  1. Blackfin build options --->
  2.      [*] Install ELF shared libraries
  3.      [ ] Cull unused ELF shared libraries
This should be done after you have removed the libraries - but -- it will remove all shared libraries (or shared libraries which are not referenced by the current applications
in the romfs directory. For example - if you have no threaded applications in the romfs directory, it will remove the pthread library (libpthread.so.0), but this will make it so
no threaded applications will ever run on the system (without also replacing the pthread library.
 
阅读(1330) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~