zoukankan      html  css  js  c++  java
  • 制作基于OK6410的文件系统(2.修改busybox文件系统,使之能启动)

    把busybox生成的_install目录 复制到nfs文件系统的根目录
     
    给开发板上电,会不断提示:
     
    can't open /dev/tty4: No such file or directory
    can't open /dev/tty3: No such file or directory
     
    所以这个文件系统是不正常的,还缺很多必要的文件和目录 ,下面我们一一添加.
     
    1.增加目录 ,在文件系统根目录下运行
     
    mkdir root dev etc bin sbin mnt sys proc lib home tmp var usr
     
    2.建节点console、null
     
    sudo mknod dev/console c 5 1
    sudo mknod dev/null c 1 3
     
     
     
    到此,系统 已经可以启动了,给开发板上电,会进入控制台窗口,但此时的文件系统还有动态链接库还是没有加载,也就是说还运行不了程序。
     
    下面我们复制lib库和初始化一些文件系统
     
    1.在文件系统根目录运行 
     
    rm linuxrc
     
    gedit linuxrc
     
    输入:
     
     
     
    #!/bin/sh
    echo "mount /etc as ramfs"
    /bin/mount -f -t cramfs -o remount,ro /dev/bon/2 /
    /bin/mount -t ramfs ramfs /var
    /bin/mkdir -p /var/tmp
    /bin/mkdir -p /var/run
    /bin/mkdir -p /var/log
    /bin/mkdir -p /var/lock
    /bin/mkdir -p /var/empty
    #/bin/mount -t usbdevfs none /proc/bus/usb
     
    exec /sbin/init
     
     
     
    保存退出后,再运行 
     
    chmod 775 linuxrc
     
     
     
    创建etc/init.d/rcS文件
     
     mkdir etc/init.d
     
    gedit etc/init.d/rcS
     
    复制如下内容 
     
    #! /bin/sh
    #
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
    runlevel=S
    prevlevel=N
    umask 022
    export PATH runlevel prevlevel
     
    /bin/mount -t proc none /proc
    /bin/mount -t tmpfs none /tmp
    /bin/mount -t tmpfs none /var
     
    /bin/mkdir -p /var/lib
    /bin/mkdir -p /var/run
    /bin/mkdir -p /var/log
     
    /sbin/ifconfig lo 127.0.0.1
    /sbin/ifconfig eth0 192.168.0.111 up
     
    /bin/hostname -F /etc/hostname
     
    保存退出后,再运行 
     
    chmod 775etc/init.d/rcS
     
     
     
    创建etc/fstab和etc/inittab文件
     
    fstab内容如下:
     
    #/etc/fstab: static file system information.
    #<File system> <mount pt>     <type>   <options>         <dump> <pass>
    proc /proc proc defaults 0 0
    sysfs /sys sysfs defaults 0 0
    mdev /dev ramfs defaults 0 0
    none /tmp ramfs defaults 0 0
     
    inittab内容如下:
     
    # This is run first except when booting
    ::sysinit:/etc/init.d/rcS
     
    # Start an "askfirst" shell on the console
    #::askfirst:-/bin/bash
    ::askfirst:-/bin/sh
     
    # Stuff to do when restarting the init process
    ::restart:/sbin/init
     
    # Stuff to do before rebooting
    ::ctrlaltdel:/sbin/reboot
    ::shutdown:/bin/umount -a -r
     
    下面复制lib库文件
     
    cp /usr/local/arm/4.4.1/arm-none-linux-gnueabi/libc/lib/* /6410/root/lib/
     
    cp /usr/local/arm/4.4.1/arm-none-linux-gnueabi/libc/usr/lib/* /6410/root/lib
     
    cp /usr/local/arm/4.4.1/arm-none-linux-gnueabi/libc/armv4t/usr/lib/* /6410/root/lib
     
     到此文件系统就已经加载完毕了
     
     
    原文出处:http://hi.baidu.com/rtfsco/blog/item/2c9d6c1806a1c71b5baf5328.html
  • 相关阅读:
    window servet 2012 r2 配置php服务器环境
    thinkphp5 input坑
    tp5命名空间补充
    cookie和session
    thinkphp5.0 模型的应用
    JavaScript--计时器
    Runtime Only VS Runtime+Compil
    Object.keys
    [LeetCode 17]电话号码的字母组合
    数组里的字符串转换成数字或者把数字转换成字符串
  • 原文地址:https://www.cnblogs.com/dolphi/p/2642970.html
Copyright © 2011-2022 走看看