有没有什么办法可以在 MT7620A 上运行 Debian Mipsel Chroot

2015-02-16 20:56:02 +08:00
 extreme

OpenWRT路由器。
/proc/cpuinfo:
system type : Ralink MT7620A ver:2 eco:6
machine : HiWiFi HC5761
processor : 0
cpu model : MIPS 24KEc V5.0
BogoMIPS : 766.77
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

尝试使用debootstrap,但总是到"chroot /mnt/debian mount -t proc proc /proc"就报错。一般是Illegal instruction或Segmentation fault。

于是在服务器上运行qemu-system-mipsel,花了几个小时安装完了Debian Wheezy Mipsel(根目录和RAW格式的文件: http://downloads.yzs.me/debian-wheezy-mipsel/),下载到OpenWRT上,解压完成后,满怀希望,高高兴兴地执行:
chroot /mnt/debian/ /bin/bash
结果就是一句:Illegal instruction
神奇的是,第三次执行,居然成功了。
不管执行什么,都有出现Illegal instruction或Segmentation fault的可能性,特别是第一次被执行的二进制文件,一般第二次执行才成功。
执行一次apt-get install,就有三四个错误……

这是使用file检测文件的结果:
root@OpenWrt:~# file /bin/busybox /mnt/debian/bin/mount
/bin/busybox: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), corrupted section header size
/mnt/debian/bin/mount: setuid ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=5663293f6505c924e35116af0a377e44fa31ecb7, stripped

不知各位有没有更好的解决方案?

6994 次点击
所在节点    Linux
8 条回复
sewyu
2015-02-17 11:53:38 +08:00
这个对技术要求太高了 真看不懂
WorkTimer
2015-02-17 13:29:07 +08:00
http://www.openwrt.org.cn/bbs/thread-13190-1-1.html

这个是我 2013年.3月 做的。使用这种方法比用chroot,更方便而且更节省内存。只需要在编译内核的时候修改一下,内核命令行。
希望可以给你一些帮助
extreme
2015-02-17 15:33:23 +08:00
@WorkTimer 可以直接安装?用什么输出画面的……
squid157
2015-02-17 23:05:49 +08:00
file的结果也是说处理器指令集不太一样,但好像MIPS32是MIPS-II之后发展出来的,不知道是不是兼容。。而且处理器是24K,估计74K的也不行,所以也要确定Debian那里是24K的。。

我也只是猜猜,这种第二次才成功真是理解不能。。
WorkTimer
2015-02-18 07:58:33 +08:00
@extreme 可以直接在路由上安装,xwindow 用 xming 显示
extreme
2015-02-18 09:36:52 +08:00
@squid157 我的想法是用OpenWRT的Tool Chain编译Debian Wheezy,不过没找到相关资料。
besto
2015-02-18 16:14:41 +08:00
extreme
2015-02-18 19:58:32 +08:00
@besto 感谢,这个方法挺好的!不过搬到OpenWRT上,还是那些错误……

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/171385

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX