from:
一般情况下,Uimage 是内核和文件系统的组合。
确认:在内核配置中你已经关闭你不需要的东西-通过文件系统和删除你不需要的。
想要找到romfs中比较大的程序,可以尝试:
- uClinux-dist> find -P ./romfs/ -type f -printf "%s %p\n" | sort -nr | less
会打印出romfs文件列表,降序排列。如:
------------------------------------------------------------------
- 461296 ./romfs/lib/libgfortran.so.3
- 247564 ./romfs/lib/libc.so.0
- 186268 ./romfs/lib/libthread_db.so.1
- 171708 ./romfs/bin/busybox
- 95004 ./romfs/lib/libmudflapth.so.0
- 90684 ./romfs/lib/libmudflap.so.0
- 81268 ./romfs/lib/libobjc.so.2
- 62416 ./romfs/lib/libgcc_s.so.1
- 62280 ./romfs/lib/libm.so.0
- 39312 ./romfs/lib/libpthread.so.0
- 25860 ./romfs/lib/libgomp.so.1
- 20396 ./romfs/lib/ld-uClibc.so.0
---------------------------------------------------------------------
你需要删除其中你不需要的比较大的一个。这说起来比较容易做起来比较难,你可以通过romfs运行一个小的shell脚本,来查找在/lib目录中暂时没有引用到的库,通过
这些库,并打印出他们的依赖关系。
例如:
-----------------------------------------------------------------------
- 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 |
- 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
- ld-uClibc.so.0
- libcrypt.so.0
- libc.so.0
- libdl.so.0
- libgcc_s.so.1
- libid3tag.so.0
- libjpeg.so.62
- libmad.so.0
- libm.so.0
- libpng12.so.0
- libpthread.so.0
- libthread_db.so.1
- libutil.so.0
- 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):
- Blackfin build options --->
- [*] Install ELF shared libraries
- [ ] 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.
阅读(1362) | 评论(0) | 转发(0) |