busybox-tty

今天遇到 busybox can’t access tty 記錄一下


更新記錄

item note
20160926 第一版

目錄


問題原因

問題原因:由於glibc rootfs變大了,,不能跟uclibc一樣的uboot設定值,造成檔案不完整

  • 開機發生 can’t access tty
    1
    2
    3
    Freeing unused kernel memory: 188K (c06c5000 - c06f4000)
    /bin/sh: can't access tty; job control turned off
    / # ls -l /

比較內容

  • 比較uclibc及glibc兩者
    找一下google,都說是inittab設定問題
    一樣的/etc/inittab在uclibc都正常,不是inittab問題

  • 查看lib
    發現少了檔案

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    ls -l /lib
    total 9536
    lrwxrwxrwx 1 1000 1000 1 Apr 1 2016 a7_softfp_neon-vfpv4 -> .
    -rwxr-xr-x 1 1000 1000 786530 Mar 26 2016 ld-2.16.so
    lrwxrwxrwx 1 1000 1000 10 Apr 1 2016 ld-linux.so.3 -> ld-2.16.so
    -rwxr-xr-x 1 1000 1000 18857 Mar 26 2016 libBrokenLocale-2.16.so
    lrwxrwxrwx 1 1000 1000 23 Apr 1 2016 libBrokenLocale.so.1 -> libBrokenLocale-2.16.so
    -rwxr-xr-x 1 1000 1000 38199 Mar 26 2016 libSegFault.so
    -rwxr-xr-x 1 1000 1000 75196 Mar 26 2016 libanl-2.16.so
    lrwxrwxrwx 1 1000 1000 14 Apr 1 2016 libanl.so.1 -> libanl-2.16.so
    -rwxr-xr-x 1 1000 1000 8843181 Mar 26 2016 libc-2.16.so
  • uclibc sdk程序
    注意rootfs大小只有6M

    1
    2
    3
    4
    setenv bootargs 'mem=128M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:1M(boot),4M(kernel),6M(rootfs)'

    mw.b 0x42000000 ff 1000000;tftp 0x42000000 rootfs-hisdk-hiv300.jffs2
    sf probe 0x0;sf erase 0x500000 0x600000;sf write 0x42000000 0x500000 0x600000;
  • glibc rootfs變大了
    修改如下

    1
    2
    3
    4
    setenv bootargs 'mem=128M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:1M(boot),4M(kernel),16M(rootfs)'

    mw.b 0x42000000 ff 0x1600000;tftp 0x42000000 rootfs-hisdk-hiv300.jffs2
    sf probe 0x0;sf erase 0x500000 0x1600000;sf write 0x42000000 0x500000 0x1600000;
  • 正常了

    1
    2
    3
    4
    5
    6
    7
    8
    9
    ata2: SATA link down (SStatus 0 SControl 300)
    ata3: SATA link down (SStatus 0 SControl 300)
    ata4: SATA link down (SStatus 0 SControl 300)
    VFS: Mounted root (jffs2 filesystem) on device 31:2.
    Freeing unused kernel memory: 188K (c06c5000 - c06f4000)

    xx
    [RCS]: /etc/init.d/S00devs
    [RCS]: /etc/init.d/S01udev