本博客倡导开放源代码,在此公布之程序源代码如无特别声明均采用GNU通用公共 许可证(GPL)

乐在其中

分享学习Linux的乐趣

  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  23 随笔 :: 0 文章 :: 401 评论 :: 0 Trackbacks
海信MP800H官方固件里的busybox版本是1.1.3,是2006年发布的,确实有点老旧。最新的稳定版是2009年12月发布的1.15.3,与1.1.3版相比修正了很多bug并增加了一些新的应用程序(applet),特别是增加了ftpd。当然也有一些应用被删除了:e2fsprogs(ext2/ext3文件系统工具: mke2fs, e2fsck, tune2fs等),原因是它相对于busybox来说太大了。其实e2fsprogs并非播放机必需的,而且这些工具可以在台式机上获得。因此我决定要把busybox升级到1.15.3。

华硕公布的源码中busybox-1.1.3有一部分被修改过,其中init增加了对SIGABRT(6)信号的处理,当init进程收到此信号时(kill -6 1),将触发固件升级程序。详细过程请看/etc/reexec_init下的脚本。我希望能保留该功能,将它移植到1.15.3(见补丁:busybox-1.15.3-reexec_init.patch.zip

另外,目前busybox测试版1.16.0中新增了ntpd,我把它给backport到1.15.3(见补丁:busybox-1.15.3-ntpd.patch.zip)。ntpd 对MP800H来说相当重要,因为播放机没有电池为时钟供电,只要重新加电系统时间就会重置,有了ntpd就可实现与ntp服务器自动时间同步。

编译busybox-1.15.3
1) 下载源码 http://www.busybox.net/downloads/busybox-1.15.3.tar.bz2
2) 解压
1 $ tar jxf busybox-1.15.3.tar.bz2
3) 打补丁
 1 $ ls -l
 2 总用量 113
 3 drwxr-xr-31 user users   1224 2009-12-13 05:18 busybox-1.15.3
 4 -rw-r--r--  1 user users 108352 2010-03-16 14:51 busybox-1.15.3-ntpd.patch
 5 -rw-r--r--  1 user users   3216 2010-03-16 14:51 busybox-1.15.3-reexec_init.patch
 6 $ cd busybox-1.15.3/
 7 $ patch -p1 < ../BusyBox-1.15.3-ntpd.patch
 8 patching file include/applets.h
 9 patching file include/libbb.h
10 patching file include/usage.h
11 patching file libbb/messages.c
12 patching file networking/Config.in
13 patching file networking/Kbuild
14 patching file networking/ntpd.c
15 patching file networking/ntpd_simple.c
16 $ patch -p1 < ../BusyBox-1.15.3-reexec_init.patch
17 patching file init/Config.in
18 patching file init/init.c
4) 配置busybox
1 $ make menuconfig
配置完成后会生成一个.config文件,注意前面有个点。这是我的配置文件:config-busybox-1.15.3.zip
5) 编译
1 $ make
6) 安装到指定的目录,比如/home/user/dist/busybox
1 $ make CONFIG_PREFIX=/home/usr/dist/BusyBox install

补充
用华硕提供的工具链sdelinux-5.03.06-1进行编译时会报ULLONG_MAX undeclared的错误。解决办法是对其中一个头文件打下面的补丁:
头文件:/usr/local/lib/gcc-lib/mipsel-linux/2.96-sdelinuxmips-040127/include/limits.h
补丁如下:
--- limits.h.orig       2004-02-12 20:38:47.000000000 +0800
+++ limits.h    2010-03-02 08:53:11.984943511 +0800
@@ 
-94,5 +94,12 @@
 #define ULONG_LONG_MAX (LONG_LONG_MAX 
* 2ULL + 1)
 #endif

+/* Minimum and maximum values a `signed long long int' can hold.  */
+#define LLONG_MAX    9223372036854775807LL
+#define LLONG_MIN    (-LLONG_MAX - 1LL)
+
+/* Maximum value an `unsigned long long int' can hold.  (Minimum is 0.)  */
+#define ULLONG_MAX   18446744073709551615ULL
+
 #endif 
/* _MACH_MACHLIMITS_H_ */
 #endif 
/* _LIMITS_H___ */

posted on 2010-03-16 15:58 gouzhuang 阅读(6596) 评论(45)  编辑 收藏 引用 所属分类: 嵌入式Linux

评论

# re: 升级BusyBox 2010-03-17 15:26 atwo
不错的博客,希望能够加入RTL 1073 固件DIY群。
我们的论坛http://1073.konamicn.com/
qq群:97120269

你的几篇博文对于固件开发很大帮助。
我在自己的1073上,升级busybox,采用ipkg install busybox方式,不知道跟你的编译方式有什么区别。

另外就是交叉编译环境如何建立,最好给予指导,谢谢。  回复  更多评论
  

# re: 升级BusyBox 2010-03-18 11:38 gouzhuang
@atwo
ipkg 安装的busybox应该是optware,optware都是动态连接/opt/lib下的库。自己编译的busybox是连接/lib下的库。
关于交叉编译工具的制作,我会在后续的博文中发表。  回复  更多评论
  

# re: 升级BusyBox 2010-06-12 10:36 jackboy
@gouzhuang
我安你的方法重新編譯busybox, 有試過打補丁和不打你提供的補丁,但都是提示 ULLong MAX is not defined, 編譯失敗, 編譯工具鏈是ASUS的包里的, 不知道這是什么緣故呢  回复  更多评论
  

# re: 升级BusyBox 2010-06-17 17:09 gouzhuang
@jackboy
哦,这个我漏掉了。我修改了工具链的一个头文件: /usr/local/lib/gcc-lib/mipsel-linux/2.96-sdelinuxmips-040127/include/limits.h

请打下面的补丁:
--- limits.h.orig 2004-02-12 20:38:47.000000000 +0800
+++ limits.h 2010-03-02 08:53:11.984943511 +0800
@@ -94,5 +94,12 @@
#define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
#endif

+/* Minimum and maximum values a `signed long long int' can hold. */
+#define LLONG_MAX 9223372036854775807LL
+#define LLONG_MIN (-LLONG_MAX - 1LL)
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
+#define ULLONG_MAX 18446744073709551615ULL
+
#endif /* _MACH_MACHLIMITS_H_ */
#endif /* _LIMITS_H___ */
  回复  更多评论
  

# re: 升级BusyBox 2010-08-18 05:06 jims
1.1.3版的busybox不能用ifconfig修改mac地址,请问这个新版的ifconfig命令可以修改网卡的mac地址吗?
如果不行,还有什么办法可以修改mac地址呢?  回复  更多评论
  

# re: 升级BusyBox 2010-08-18 09:13 gouzhuang
@jims
1.15.3 ifconfig 有修改mac地址的功能,配置busybox时需要打开下面的ifconfig选项:
Enable option "hw" (ether only)

这个功能还需要网卡驱动程序的支持,在海信的MP800H上我没有试过。  回复  更多评论
  

# re: 升级BusyBox 2010-08-18 10:12 jims
@gouzhuang
MP800H这台机器dragon发布过一个网卡MAC修改工具:http://dragon.17kl.com/post/4.html
只有编译好的程序,就是不知道他是怎么实现的,我的busybox是1.10.3,用ip link命令写:
ifconfig eth0 down
ip link set address xx:xx:xx:xx:xx:xx eth0 up
ifconfig eth0 up
显示:ip: either "dev" is duplicate, or "xx:xx:xx:xx:xx:xx" is garbage
可能是网卡驱动不支持吧.
看1.1.3源码iplink.c里有相关的set_address函数,可惜手头上没有编译环境,没办法编译。不知道有没有其它方式可以实现?直接写flash又不知道指令和方法。  回复  更多评论
  

# re: 升级BusyBox 2010-08-18 11:06 gouzhuang
@jims
我推测dragon的方法应该是直接修改flash。mac地址应该是保存在flash的第4个分区上。这个分区可以通过设备/dev/mtdblock/3访问。用下面的命令可以抓取这个分区的映像存到usb存储上:
dd if=/dev/mtdblock/3 of=/tmp/usbmounts/sda1/mtd3.img

在映像文件里可用二进制编辑器搜索到MAC地址的字符串,格式为:XX.XX.XX.XX.XX.XX,字母大写。找到这个字符串在文件中的字节偏移量offset。

注意:下面的命令我没有测试过,可能有损坏播放机的风险!!!
用dd命令修改MAC地址(要求echo命令支持-n参数):
echo -n 'XX.XX.XX.XX.XX.XX' | dd of=/dev/mtdblock/3 bs=1 seek=offset

其中offset为前面找到的字节偏移量。
  回复  更多评论
  

# re: 升级BusyBox 2010-08-18 22:41 jims
@gouzhuang
不小心贴出来自己的mac地址,gouzhuang兄可不可以把它给编辑掉呢?  回复  更多评论
  

# re: 升级BusyBox 2010-08-19 08:55 gouzhuang
@jims
我无法编辑,只能删除了  回复  更多评论
  

# re: 升级BusyBox 2010-10-04 18:53 hibaby
按博主的方法compile busybox 1.15.3成功,不过编译过程中有大量mipsel-linux-gcc: unrecognized option `-static-libgcc'
的错误,不知道有没有问题。
另外,想compile busybox 1.17.2,结果提示
mipsel-linux-gcc: Internal compiler error: program cc1 got fatal signal 6
google了一下,没找到什么好的解决方法,不知道有没有博主有没有兴趣研究跟进一下。  回复  更多评论
  

# re: 升级BusyBox 2010-10-05 10:09 hibaby
@hibaby
已经搞定1.17.2版本的busybox,需要修改ipaddress.c和iplink.c,取消ionice ,取消文件系统相关指令,编译通过。
不过还遇到一个问题,新版的1.17.2和1.15.3同样存在的问题,在ps命令和top命令看进程时,VSZ的占用大小和以前1.1.3的不同,不知道什么原因造成的。  回复  更多评论
  

# re: 升级BusyBox 2010-10-05 20:42 gouzhuang
@hibaby
用华硕的工具链确实会报“unrecognized option `-static-libgcc'”的警告,因为gcc版本很老(2.96),还不支持这个选项,不过这个警告可以忽略。我用自制的工具链(gcc 4.4.2)编译时就无此警告。

关于ps和top显示VSZ大小的问题,我以前没有注意,能说详细一点吗?另外,除了busybox还有其他变化吗?  回复  更多评论
  

# re: 升级BusyBox 2010-10-06 16:53 hibaby
@gouzhuang
top命令结果如下,可以看到VSZ的值和MEM利用率肯定有问题。
Mem: 120736K used, 129204K free, 0K shrd, 200K buff, 17256K cached
CPU: 0% usr 21% sys 0% nic 78% idle 0% io 0% irq 0% sirq
Load average: 0.24 0.62 0.47 4/86 842
PID PPID USER STAT VSZ %MEM %CPU COMMAND
842 827 root R 1576 1% 21% top
162 150 root S 794m 324% 0% DvdPlayer
139 135 root R 794m 324% 0% DvdPlayer
790 150 root D 794m 324% 0% DvdPlayer
265 150 root S 794m 324% 0% DvdPlayer
252 150 root S 794m 324% 0% DvdPlayer
179 150 root S 794m 324% 0% DvdPlayer

另外,PS命令下
172 root 794m S DvdPlayer
173 root 794m S DvdPlayer
174 root 794m S DvdPlayer
175 root 794m S DvdPlayer
176 root 794m S DvdPlayer
177 root 794m S DvdPlayer
178 root 794m S DvdPlayer
179 root 794m S DvdPlayer
180 root 794m S DvdPlayer
181 root 794m S DvdPlayer
252 root 794m S DvdPlayer
258 root 794m S DvdPlayer
259 root 794m S DvdPlayer
260 root 794m S DvdPlayer
261 root 794m S DvdPlayer
265 root 794m S DvdPlayer
277 root 1568 S /sbin/udhcpc -p /var/lock/udhcpc_eth0.pid -t 15 -b -
282 root 0 SW [scsi_eh_2]
404 root 1572 S telnetd
405 root 1584 S -sh
如果用1.1.3版本的
172 root 9644 S DvdPlayer
173 root 9644 S DvdPlayer
174 root 9644 S DvdPlayer
175 root 9644 S DvdPlayer
176 root 9644 S DvdPlayer
177 root 9644 S DvdPlayer
178 root 9644 S DvdPlayer
179 root 9644 S DvdPlayer
180 root 9644 S DvdPlayer
181 root 9644 S DvdPlayer
252 root 9644 S DvdPlayer
258 root 9644 S DvdPlayer
259 root 9644 S DvdPlayer
260 root 9644 S DvdPlayer
261 root 9644 S DvdPlayer
265 root 9644 S DvdPlayer
277 root 400 S /sbin/udhcpc -p /var/lock/udhcpc_eth0.pid -t 15 -b -s
282 root SW [scsi_eh_2]
404 root 340 S telnetd
405 root 532 S -sh
  回复  更多评论
  

# re: 升级BusyBox 2010-10-06 18:55 hibaby
@gouzhuang
另外,我用你的buildroot环境重新编译了一下,发现busybox的文件大小缩小了很多,文件大小缩小了近200K,不知道是哪些代码被替换了。
但是ps和top的显示结果还是和前面的一样。
PS:1.15.3,1.16.2同样存在问题。  回复  更多评论
  

# re: 升级BusyBox 2010-10-06 23:22 gouzhuang
@hibaby
buildroot的gcc版本很新,目标代码大小优化有了很大提高,我没动过busybox代码。
 
关于VSZ的问题,可以肯定是busybox 1.1.3的bug,它把常驻内存大小RSS当成了虚拟内存大小VSZ,证据如下:
busybox 1.1.3 ps 输出:
  PID  Uid     VmSize Stat Command
    
1 0           300 S   init      
    
2 0               SWN [ksoftirqd/0]
    
3 0               SW< [events/0]
    
4 0               SW< [khelper]
    
5 0               SW< [kthread]
    
6 0               SW< [kblockd/0]
    
7 0               SW  [khubd]
    
8 0               SW  [pdflush]
    
9 0               SW  [pdflush]
   
11 0               SW< [aio/0]
   
10 0               SW  [kswapd0]
   
12 0               SW  [eth0]
   
13 0               SW  [mtdblockd]
   
21 0           304 S   init      
   
22 0           308 S   init      
   
23 0           308 S   init      
   
24 0           308 S   init      
   
79 0           168 S   ./RootApp DvdPlayer
   
82 0           352 S   inetd
   
85 1           320 S   portmap
   
92 0           364 S   rpc.statd
   
99 0           364 S   rpc.statd
  
114 0               SW  [nfsd]
  
121 0               SW  [lockd]
  
128 0               SW< [rpciod/0]
  
115 0               SW  [nfsd]
  
131 0           392 S   rpc.mountd
  
147 0               SWN [jffs2_gcd_mtd2]
  
148 0           168 S   ./RootApp DvdPlayer
  
150 0          3652 S < DvdPlayer
  
151 0           168 S   ./RootApp DvdPlayer
  
163 0          3652 S   DvdPlayer
  
164 0          3652 R   DvdPlayer
  
165 0          3652 S   DvdPlayer
  
167 0          3652 S   DvdPlayer
  
169 0          3652 R   DvdPlayer
  
170 0          3652 S   DvdPlayer
  
171 0          3652 S   DvdPlayer
  
172 0          3652 S   DvdPlayer
  
173 0          3652 S   DvdPlayer
  
174 0          3652 S   DvdPlayer
  
175 0          3652 S   DvdPlayer
  
176 0          3652 S   DvdPlayer
  
177 0          3652 S   DvdPlayer
  
178 0          3652 S   DvdPlayer
  
239 0          3652 S   DvdPlayer
  
242 0          3652 S   DvdPlayer
  
243 0          3652 S   DvdPlayer
  
244 0          3652 S   DvdPlayer
  
245 0          3652 S   DvdPlayer
  
246 0          3652 S   DvdPlayer
  
274 0           348 S   /usr/sbin/ntpd -218.75.4.130 -114.80.81.1 -122.
  
288 0          1464 S   /usr/sbin/nmbd -D
  
290 0          2092 S   /usr/sbin/smbd -D
  
368 0               SW< [Ieee80211/0]
  
369 0               SW< [wlan0/0]
  
432 0           300 S   telnetd
  
433 0           476 S   -sh
 
1041 0           348 S   /sbin/udhcpc -/var/lock/udhcpc_eth0.pid -15 --s
 
1046 0               SW  [scsi_eh_0]
 
1047 0               SW  [usb-storage]
 
1093 0               SWN [kjournald]
 
1166 0           476 S   /bin/sh
 
1167 0           340 R   ps

busybox 1.15.3 ps 输出:
  PID USER       VSZ STAT COMMAND
    
1 root      1200 S    init      
    
2 root         0 SWN  [ksoftirqd/0]
    
3 root         0 SW<  [events/0]
    
4 root         0 SW<  [khelper]
    
5 root         0 SW<  [kthread]
    
6 root         0 SW<  [kblockd/0]
    
7 root         0 SW   [khubd]
    
8 root         0 SW   [pdflush]
    
9 root         0 SW   [pdflush]
   
11 root         0 SW<  [aio/0]
   
10 root         0 SW   [kswapd0]
   
12 root         0 SW   [eth0]
   
13 root         0 SW   [mtdblockd]
   
21 root      1200 S    init      
   
22 root      1200 S    init      
   
23 root      1200 S    init      
   
24 root      1200 S    init      
   
79 root       400 S    ./RootApp DvdPlayer
   
82 root      1212 S    inetd
   
85 daemon     648 S    portmap
   
92 root       612 S    rpc.statd
   
99 root       612 S    rpc.statd
  
114 root         0 SW   [nfsd]
  
121 root         0 SW   [lockd]
  
128 root         0 SW<  [rpciod/0]
  
115 root         0 SW   [nfsd]
  
131 root       668 S    rpc.mountd
  
147 root         0 SWN  [jffs2_gcd_mtd2]
  
148 root       400 S    ./RootApp DvdPlayer
  
150 root      780m S <  DvdPlayer
  
151 root       400 S    ./RootApp DvdPlayer
  
163 root      780m S    DvdPlayer
  
164 root      780m S    DvdPlayer
  
165 root      780m S    DvdPlayer
  
167 root      780m S    DvdPlayer
  
169 root      780m S    DvdPlayer
  
170 root      780m S    DvdPlayer
  
171 root      780m S    DvdPlayer
  
172 root      780m S    DvdPlayer
  
173 root      780m S    DvdPlayer
  
174 root      780m S    DvdPlayer
  
175 root      780m S    DvdPlayer
  
176 root      780m S    DvdPlayer
  
177 root      780m S    DvdPlayer
  
178 root      780m S    DvdPlayer
  
239 root      780m S    DvdPlayer
  
242 root      780m S    DvdPlayer
  
243 root      780m S    DvdPlayer
  
244 root      780m S    DvdPlayer
  
245 root      780m S    DvdPlayer
  
246 root      780m S    DvdPlayer
  
274 root      1200 S    /usr/sbin/ntpd -218.75.4.130 -114.80.81.1 -122.
  
288 root      3496 S    /usr/sbin/nmbd -D
  
290 root      5648 S    /usr/sbin/smbd -D
  
368 root         0 SW<  [Ieee80211/0]
  
369 root         0 SW<  [wlan0/0]
  
432 root      1204 S    telnetd
  
433 root      1220 S    -sh
 
1041 root      1200 S    /sbin/udhcpc -/var/lock/udhcpc_eth0.pid -15 --s
 
1046 root         0 SW   [scsi_eh_0]
 
1047 root         0 SW   [usb-storage]
 
1093 root         0 SWN  [kjournald]
 
1166 root      2088 S    /bin/sh
 
1168 root      1204 S    telnetd
 
1169 root      1216 S    -sh
 
1184 root      1204 R    ps -ef
optware procps 软件包的ps aux 输出
/opt/bin/ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   
TIME COMMAND
root         
1  0.0  0.2   1200   300 ?        S    20:55   0:00 init     
root         
2  0.0  0.0      0     0 ?        SN   20:55   0:00 [ksoftirqd/0]
root         
3  0.0  0.0      0     0 ?        S<   20:55   0:01 [events/0]
root         
4  0.0  0.0      0     0 ?        S<   20:55   0:00 [khelper]
root         
5  0.0  0.0      0     0 ?        S<   20:55   0:00 [kthread]
root         
6  0.0  0.0      0     0 ?        S<   20:55   0:00 [kblockd/0]
root         
7  0.0  0.0      0     0 ?        S    20:55   0:00 [khubd]
root         
8  0.0  0.0      0     0 ?        S    20:55   0:00 [pdflush]
root         
9  0.0  0.0      0     0 ?        S    20:55   0:00 [pdflush]
root        
11  0.0  0.0      0     0 ?        S<   20:55   0:00 [aio/0]
root        
10  0.0  0.0      0     0 ?        S    20:55   0:00 [kswapd0]
root        
12  0.6  0.0      0     0 ?        S    20:55   0:45 [eth0]
root        
13  0.0  0.0      0     0 ?        S    20:55   0:02 [mtdblockd]
root        
21  0.0  0.2   1200   304 ?        Ss   20:55   0:00 init     
root        
22  0.0  0.2   1200   308 vc/2     Ss+  20:55   0:00 init     
root        
23  0.0  0.2   1200   308 vc/3     Ss+  20:55   0:00 init     
root        
24  0.0  0.2   1200   308 vc/4     Ss+  20:55   0:00 init     
root        
79  0.0  0.1    400   168 ?        S    20:55   0:00 ./RootApp DvdPlayer
root        
82  0.0  0.2   1212   352 ?        Ss   20:55   0:00 inetd
daemon      
85  0.0  0.2    648   320 ?        S    20:55   0:00 portmap
root        
92  0.0  0.3    612   364 ?        Ss   20:55   0:00 rpc.statd
root        
99  0.0  0.3    612   364 ?        Ss   20:55   0:00 rpc.statd
root       
114  0.0  0.0      0     0 ?        S    20:55   0:00 [nfsd]
root       
121  0.0  0.0      0     0 ?        S    20:55   0:00 [lockd]
root       
128  0.0  0.0      0     0 ?        S<   20:55   0:00 [rpciod/0]
root       
115  0.0  0.0      0     0 ?        S    20:55   0:00 [nfsd]
root       
131  0.0  0.3    668   392 ?        Ss   20:55   0:00 rpc.mountd
root       
147  0.0  0.0      0     0 ?        SN   20:55   0:00 [jffs2_gcd_mtd2]
root       
148  0.0  0.1    400   168 ?        S    20:55   0:00 ./RootApp DvdPlayer
root       
150  0.1  3.0 799008  3652 ?        S<   20:55   0:07 DvdPlayer
root       
151  0.0  0.1    400   168 ?        S    20:55   0:00 ./RootApp DvdPlayer
root       
163  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
164  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
165  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
167  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
169  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
170  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
171  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
172  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
173  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
174  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
175  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
176  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
177  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
178  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
239  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
242  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
243  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
244  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
245  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
246  0.0  3.0 799008  3652 ?        S    20:55   0:00 DvdPlayer
root       
274  0.0  0.2   1200   348 ?        Ss   20:55   0:00 /usr/sbin/ntpd -218.75.4.130 -114.80.81.1 -122.226.192.4 -211.166.12
root       
288  0.0  1.2   3496  1464 ?        Ss   20:56   0:00 /usr/sbin/nmbd -D
root       
290  0.0  1.7   5648  2092 ?        Ss   20:56   0:00 /usr/sbin/smbd -D
root       
368  0.0  0.0      0     0 ?        S<   21:10   0:04 [Ieee80211/0]
root       
369  0.0  0.0      0     0 ?        S<   21:10   0:00 [wlan0/0]
root       
432  0.0  0.2   1204   300 ?        Ss   21:10   0:01 telnetd
root       
433  0.0  0.3   1220   476 pts/0    Ss   21:10   0:00 -sh
root      
1041  0.0  0.2   1200   348 ?        Ss   21:54   0:00 /sbin/udhcpc -/var/lock/udhcpc_eth0.pid -15 --/etc/udhcpc.script -i
root      
1046  0.0  0.0      0     0 ?        S    22:03   0:00 [scsi_eh_0]
root      
1047  0.0  0.0      0     0 ?        S    22:03   0:00 [usb-storage]
root      
1093  0.0  0.0      0     0 ?        SN   22:03   0:00 [kjournald]
root      
1166  0.0  0.3   2088   476 pts/0    S+   22:48   0:00 /bin/sh
root      
1168  0.1  0.2   1204   300 ?        Ss   22:48   0:00 telnetd
root      
1169  0.2  0.3   1216   448 pts/1    Ss   22:48   0:00 -sh
root      
1187  0.0  0.4   1520   508 pts/1    R+   22:49   0:00 /opt/bin/ps aux
  回复  更多评论
  

# re: 升级BusyBox 2010-10-06 23:40 hibaby
@gouzhuang
可是top命令里面mem的利用率都超过100%了,这个也不太正常吧。而且dvdplayer占用内存780m,这个有点夸张。  回复  更多评论
  

# re: 升级BusyBox 2010-10-07 00:38 gouzhuang
@hibaby
dvdplayer除了使用常规内存外还映射了大量的播放机专用硬件的地址空间。通过下面的命令可以查看dvdplayer的内存地址映射情况:
 
cat /proc/<DvdPlayer 的进程号>/maps
00400000-00cbe000 r-xp 00000000 1f:01 1095       /usr/local/bin/DvdPlayer
10000000-100af000 rw-p 008be000 1f:01 1095       /usr/local/bin/DvdPlayer
100af000
-10300000 rwxp 100af000 00:00 0          [heap]
2aaa8000
-2aaa9000 rw-00000000 00:07 0          /SYSVdeadcafe (deleted)
40000000-70020000 rw-40000000 00:00 0 
7c7fc000
-7c800000 rwxp 7c7fc000 00:00 0 
7c9fc000
-7ca00000 rwxp 7c9fc000 00:00 0 
7cbfc000
-7cc00000 rwxp 7cbfc000 00:00 0 
7cdfc000
-7ce00000 rwxp 7cdfc000 00:00 0 
7cffc000
-7d000000 rwxp 7cffc000 00:00 0 
7d1fc000
-7d200000 rwxp 7d1fc000 00:00 0 
7d5fc000
-7d600000 rwxp 7d5fc000 00:00 0 
7d7fc000
-7d800000 rwxp 7d7fc000 00:00 0 
7d9fc000
-7da00000 rwxp 7d9fc000 00:00 0 
7dbfc000
-7dc00000 rwxp 7dbfc000 00:00 0 
7ddfc000
-7de00000 rwxp 7ddfc000 00:00 0 
7dffc000
-7e000000 rwxp 7dffc000 00:00 0 
7e1fc000
-7e200000 rwxp 7e1fc000 00:00 0 
7e3fc000
-7e400000 rwxp 7e3fc000 00:00 0 
7e5fc000
-7e600000 rwxp 7e5fc000 00:00 0 
7e7fc000
-7e800000 rwxp 7e7fc000 00:00 0 
7e9fc000
-7ea00000 rwxp 7e9fc000 00:00 0 
7ebfc000
-7ec00000 rwxp 7ebfc000 00:00 0 
7edfc000
-7ee00000 rwxp 7edfc000 00:00 0 
7effc000
-7f000000 rwxp 7effc000 00:00 0 
7f1fc000
-7f200000 rwxp 7f1fc000 00:00 0 
7f83e000
-7f853000 rwxp 7f83e000 00:00 0          [stack]
 
其中仅40000000-70020000这一段就有768M。

  回复  更多评论
  

# re: 升级BusyBox 2010-10-07 11:16 hibaby
@gouzhuang
看来还真如此,这个机制还真挺特别的。  回复  更多评论
  

# re: 升级BusyBox 2010-10-13 22:53 ccbcfan
@gouzhuang

可以直接替换busybox吗?那么ftpd、ntpd是不是要手工建立链接?能不能把你编译的busybox 1.15.3提供下载呀?我编译时还是出错了!  回复  更多评论
  

# re: 升级BusyBox 2010-10-14 10:07 gouzhuang
@ccbcfan
如果使用相同的uclibc,busybox可直接替换,链接手工建即可。我编译的busybox可在这里下载:
http://cid-33323d948b0eaf12.office.live.com/browse.aspx/.Public/linux-mipsel/busybox
有动态连接和静态连接两个版本。  回复  更多评论
  

# re: 升级BusyBox 2010-10-19 13:19 z1022
sdfsfsdsdfa  回复  更多评论
  

# re: 升级BusyBox 2010-10-19 13:26 z1022
@gouzhuang
请问是不是用你静态busybox直接取代固件內的文件
  回复  更多评论
  

# re: 升级BusyBox 2010-10-20 12:16 gouzhuang
@z1022
静态busybox要比动态的大一些,但是动态的依赖于特定的uclibc。静态的不与其它程序共享libc,因此会多占有一些内存。可根据你的需要选用。  回复  更多评论
  

# re: 升级BusyBox 2010-10-21 18:04 z1022
@gouzhuang
Thanks  回复  更多评论
  

# re: 升级BusyBox 2010-10-22 10:38 ccbcfan
@gouzhuang
谢谢,能否再编译一个支持ifconfig修改网卡mac地址的busybox? 本地编译环境没有patch命令?

  回复  更多评论
  

# re: 升级BusyBox 2010-10-22 14:58 gouzhuang
@ccbcfan
重新编译了busybox:
1. ifconfig 增加了 hw 选项支持
2. 增加了patch命令
动态链接:busybox-1.15.3+patch+ifconfig_hw-shared.tar.bz2
静态链接:busybox-1.15.3+patch+ifconfig_hw-static.tar.bz2
下载地址:http://cid-33323d948b0eaf12.office.live.com/browse.aspx/.Public/linux-mipsel/busybox  回复  更多评论
  

# re: 升级BusyBox 2010-10-27 15:20 ccbcfan
@gouzhuang
ifconfig eth0 hw ether xxxxxxxxx

工作正常,可以随意修改mac了,对于使用有mac验证的播放内核和网络资源就方便多了!谢谢!  回复  更多评论
  

# re: 升级BusyBox 2010-11-01 21:29 z1022
@gouzhuang
可否再编译一个支持e2fsprogs(ext2/ext3文件系统工具: mke2fs, e2fsck, tune2fs等)的busybox? 我的播放机
初始化需要用以上command format 內置硬碟  回复  更多评论
  

# re: 升级BusyBox 2010-11-02 13:59 gouzhuang
@z1022
编好了:
busybox-1.15.3+e2fsprogs-shared.tar.bz2
busybox-1.15.3+e2fsprogs-static.tar.bz2
下载地址:
http://cid-33323d948b0eaf12.office.live.com/browse.aspx/.Public/linux-mipsel/busybox  回复  更多评论
  

# re: 升级BusyBox 2010-11-02 18:31 z1022
@gouzhuang

謝謝, 可不可以給我e2fsprogs补丁? 我想嘗試
編譯busybox   回复  更多评论
  

# re: 升级BusyBox 2010-11-03 10:10 gouzhuang
@z1022
e2fsprogs补丁:http://cid-33323d948b0eaf12.office.live.com/self.aspx/.Public/linux-mipsel/busybox/busybox-1.15.3-old^_e2fsprogs.patch.bz2
打补丁步骤:
$ cd busybox-1.15.3/
$ mv e2fsprogs t
$ mv t/old_e2fsprogs e2fsprogs
$ rm -rf t
$ bzcat /path/to/patch/busybox-1.15.3-old_e2fsprogs.patch.bz2 |patch -p1
  回复  更多评论
  

# re: 升级BusyBox 2010-11-03 13:06 z1022
@gouzhuang
非常多谢你的帮忙
请问是补丁需要自写己还是从什么地方下载呢?
  回复  更多评论
  

# re: 升级BusyBox 2010-11-03 23:15 z1022
用 buildroot 编译 补丁了的 busybox 1.15.3 源码应放在那里  回复  更多评论
  

# re: 升级BusyBox 2010-11-03 23:36 gouzhuang
@z1022
我把busybox-1.15.3的几个补丁打包放在这里了:
http://cid-33323d948b0eaf12.office.live.com/self.aspx/.Public/linux-mipsel/busybox/busybox-1.15.3-patches.tar.bz2  回复  更多评论
  

# re: 升级BusyBox 2010-11-03 23:43 gouzhuang
@z1022
>用 buildroot 编译 补丁了的 busybox 1.15.3 源码应放在那里
把补丁放在buildroot/package/busybox目录下,补丁文件命名为busybox-1.15.3-xxxx.patch,buildroot会自动打这个补丁。但是e2fsprogs的补丁不能用这个方法,因为这个补丁需要事先对源码目录进行调整。  回复  更多评论
  

# re: 升级BusyBox 2010-11-04 10:19 z1022
可不可以把了e2fsprogs补丁的busybox 1.15.3 源码放在buildroot download 目录下,再用 buildroot  回复  更多评论
  

# re: 升级BusyBox 2010-11-04 10:23 gouzhuang
@z1022
>可不可以把了e2fsprogs补丁的busybox 1.15.3 源码放在buildroot download 目录下,再用 buildroot
这是可以的  回复  更多评论
  

# re: 升级BusyBox 2010-11-18 10:43 z1022
@gouzhuang

不好意思再次麻烦你。

用你静态busybox直接取代固件内的文件之后

但是当我尝试用浏览器访问 Web界面我碰到下面的信息 e.g. http://192.168.8.100

httpd: bind: Address already in use

下纲站很像有解决方法。如果是可以解决,能否再编译一个busybox?

http://lists.busybox.net/pipermail/buildroot/2008-May/020872.html
http://lists.busybox.net/pipermail/buildroot/2008-May/020902.html
  回复  更多评论
  

# re: 升级BusyBox 2010-11-19 09:38 gouzhuang
@z1022
>httpd: bind: Address already in use
这说明80端口已经被别的程序占用了。请检查一下你的/etc/inetd.conf

另外,这条信息是在什么地方看到的?  回复  更多评论
  

# re: 升级BusyBox 2010-11-19 17:31 z1022
@gouzhuang
用浏览器(IE8) 访问 Web界面 http://192.168.8.100

cat inetd.conf as below

#
# /etc/inetd.conf A simple inetd.conf
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
# To re-read this file after changes, just do a 'killall -HUP inetd'
#
#
#ftp stream tcp nowait root /usr/sbin/ftpd ftpd -u 100
telnet stream tcp nowait root /usr/sbin/telnetd telnetd
#auth stream tcp nowait nobody /usr/sbin/nullidentd nullidentd
www stream tcp nowait www-data /usr/sbin/httpd httpd -h /var/www
#
# End of inetd.conf
  回复  更多评论
  

# re: 升级BusyBox 2010-11-22 13:41 gouzhuang
@z1022
你需要给httpd加一个 -i 参数:
www stream tcp nowait www-data /usr/sbin/httpd httpd -ih /var/www
  回复  更多评论
  

# re: 升级BusyBox 2010-11-22 18:42 z1022
@gouzhuang

谢谢你的回答

我在纲上找了很久也不知如何制作e2fsorigs补丁。 我想应该是用diff command。 但是没有来源档,如何用diff command 。请简单描述一下给我学习学习。  回复  更多评论
  

# re: 升级BusyBox 2010-11-23 15:34 gouzhuang
@z1022
近期会写一篇介绍如何制作补丁的文章,请关注。  回复  更多评论
  

只有注册用户登录后才能发表评论。