V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
extreme
V2EX  ›  Linux

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

  •  
  •   extreme · 2015-02-16 20:56:02 +08:00 · 6987 次点击
    这是一个创建于 3368 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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

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

    8 条回复    2015-02-18 19:58:32 +08:00
    sewyu
        1
    sewyu  
       2015-02-17 11:53:38 +08:00
    这个对技术要求太高了 真看不懂
    WorkTimer
        2
    WorkTimer  
       2015-02-17 13:29:07 +08:00
    http://www.openwrt.org.cn/bbs/thread-13190-1-1.html

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

    我也只是猜猜,这种第二次才成功真是理解不能。。
    WorkTimer
        5
    WorkTimer  
       2015-02-18 07:58:33 +08:00 via iPad
    @extreme 可以直接在路由上安装,xwindow 用 xming 显示
    extreme
        6
    extreme  
    OP
       2015-02-18 09:36:52 +08:00
    @squid157 我的想法是用OpenWRT的Tool Chain编译Debian Wheezy,不过没找到相关资料。
    besto
        7
    besto  
       2015-02-18 16:14:41 +08:00
    extreme
        8
    extreme  
    OP
       2015-02-18 19:58:32 +08:00
    @besto 感谢,这个方法挺好的!不过搬到OpenWRT上,还是那些错误……
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5586 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:22 · PVG 15:22 · LAX 00:22 · JFK 03:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.