zoukankan      html  css  js  c++  java
  • BusyBox rcS&fstab配置

    rcS为系统初始化脚本,完成最开始的一些配置工作,可开启应用程序。

    #!/bin/sh
    mount -a      ;mount文件,要mount的文件有fstab指定。

    . /etc/profile ;配置环境变量;可不配置,每个终端启动时都会读取.profile和/etc/profile。


    echo "configuring network... "   ;配置网络
    ifconfig eth0 down
    ifconfig eth0 192.168.1.254

    ifconfig lo 127.0.0.1 up
    route add -net 127.0.0.0 netmask 255.0.0.0 lo
    route add default gw 192.168.1.1

    /usr/sbin/telnetd &            ;开启telnet

    echo "------------rcS over.-------------------- "

    -----------------------------------------------------------------------------

    最简单的rcS也应该mount fs,开启网口。

    telnet,ftp可后续根据需要开启。

    -----------------------------------------------------------------------------

    fstab配置:

    #<file name> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    none /tmp ramfs defaults 0 0
    sysfs /sys  sysfs defaults 0 0
    devpts /dev/pts    devpts defaults 0 0

    -----------------------------------------------------------------------------

    可在rcS中配置环境变量 profile

    # /etc/profile: system-wide .profile file for the Bourne shells
    echo
    echo -n "Processing /etc/profile... "
    # no-op
    echo "Done"
    echo

  • 相关阅读:
    判断一个点是否在一个不规则多边形内算法
    vue-cli 3.0 安装和创建项目流程
    微信小程序分享朋友圈的实现思路与解决办法
    vue2.0中关于active-class
    Nginx服务启动脚本
    Linux系统优化
    URL检测脚本
    Mysql读写分离php脚本
    Memcahed服务异常监控脚本
    一致性哈希算法PHP测试片段
  • 原文地址:https://www.cnblogs.com/embedded-linux/p/4821888.html
Copyright © 2011-2022 走看看