zoukankan      html  css  js  c++  java
  • 创建 linuxrc 文件

    创建 linuxrc,加入如下内容: [arm@localhost my_rootfs]#vi linuxrc

    #!/bin/sh

    #挂载/etc 为 ramfs, 并从/mnt/etc 下拷贝文件到/etc 目录当中 echo "mount /etc as ramfs"

    /bin/mount ­n ­t ramfs ramfs /etc

    /bin/cp ­a /mnt/etc/* /etc

    echo "re­create the /etc/mtab entries"

    # re­create the /etc/mtab entries

    /bin/mount ­f ­t cramfs ­o remount,ro /dev/mtdblock/2 /

    #mount some file system

    echo "­­­­­­­­­­­­mount /dev/shm as tmpfs"

    /bin/mount ­n ­t tmpfs tmpfs /dev/shm

    #挂载/proc 为 proc 文件系统

    echo "­­­­­­­­­­­­mount /proc as proc"

    /bin/mount ­n ­t proc none /proc

    #挂载/sys 为 sysfs 文件系统

    echo "­­­­­­­­­­­­mount /sys as sysfs"

    /bin/mount ­n ­t sysfs none /sys exec /sbin/init

    2. 修改权限

    [arm@localhost my_rootfs]#chmod 775 linuxrc [arm@localhost my_rootfs]#ls linuxrc ­al

    ­rwxrwxr­x  1 root root  533 Jun  4 11:19 linuxrc

    当编译内核时,指定命令行参数如下

    Boot options ­­­> Default kernel command string: 我的命令行参数如下 noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200

    其中的 init 指明 kernel 执行后要加载的第一个应用程序,缺省为/sbin/init,此处指定为/linuxrc

  • 相关阅读:
    H3C ER6300 + 两台 H3C S5120 组网举例
    H3C S5120-52P-WiNet交换机配置
    H3C S5120清除console口密码
    光纤简介
    Windows server 2008 R2 多用户远程桌面
    AutoIt 软件自动化操作
    windows server 2008 R2 计划任务备份系统
    AD域部署使用bginfo软件
    使用WSL吧
    Could not load file or assembly……
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11105659.html
Copyright © 2011-2022 走看看