zoukankan      html  css  js  c++  java
  • 根文件系统概览

    /etc/
    /inittab 初始化脚本
    /init.d/rcS 启动挂载
    /fstab 文件系统挂载表
    /profile
    
    /hostname 主机名
    /hosts
    /passwd 密码信息
    /shadow 密码信息
    /issue 交互登录前,显示的提示信息
    
    (1) inittab
    # Startup the system
    null::sysinit:/bin/mount -o remount,rw /
    null::sysinit:/bin/mount -t proc proc /proc
    null::sysinit:/bin/mount -a
    null::sysinit:/bin/hostname -F /etc/hostname# Now run any rc scripts
    
    ::sysinit:/etc/init.d/rcS # Now invoke shell
    ::askfirst:/bin/ash # Logging junk
    null::sysinit:/bin/touch /var/log/messages
    null::respawn:/sbin/syslogd -n -m 0
    null::respawn:/sbin/klogd -n # Stuff to do for the 3-finger salute
    ::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting
    null::shutdown:/usr/bin/killall klogd
    null::shutdown:/usr/bin/killall syslogd
    null::shutdown:/bin/umount -a -r
    null::shutdown:/sbin/swapoff -a
    
    (2) rcS
    
    #!/bin/ash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    runlevel=S
    prevlevel=N
    umask 022
    export PATH runlevel prevlevel
    #mount rootfs success
    /bin/mount -a
    #
    /bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
    mdev -s
    # Configure net interface
    /sbin/ifconfig lo 127.0.0.1 up
    /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
    /sbin/ifconfig eth0 192.168.2.25 netmask 255.255.255.0
    /sbin/route add default gw 192.168.2.1
    
    (3)fstab
    #device mount-point type option dump fsck order
    proc /proc proc defaults 0 0
    none /tmp ramfs defaults 0 0
    sysfs /sys sysfs defaults 0 0
    mdev /dev ramfs defaults 0 0
    (4)profile
    #Set search library path
    
    #Set user path
    USER="id -un"
    LOGNAME=$USER
    PS1='[u@h=W]#'
    PATH=$PATH
    HOSTNAME='/bin/hostname'
    export USER LOGNAME PS1 PATH
    
    (5)hostname
    
    (6)issue

    制作根文件系统树

  • 相关阅读:
    SVN服务器搭建(一)
    排序算法二:冒泡排序
    【LeetCode】136. Single Number
    【LeetCode】217. Contains Duplicate
    【LeetCode】189. Rotate Array
    【LeetCode】122. Best Time to Buy and Sell Stock II
    【LeetCode】26. Remove Duplicates from Sorted Array
    【LeetCode】20. Valid Parentheses
    【LeetCode】680. Valid Palindrome II
    【LeetCode】345. Reverse Vowels of a String
  • 原文地址:https://www.cnblogs.com/gjianw217/p/4796833.html
Copyright © 2011-2022 走看看