笔记 30 - 1 :rootfs 配置文件定制,lib 文件夹,etc / inittab

笔记 30 - 1 :rootfs 配置文件定制,lib 文件夹,etc / inittab 244 - a接着复制库文件库文件的来源244 - b 示例源代码在文末 245chmod w lib246247du -mh lib/248249该文件夹下该文件的示例源码# /etc/inittab init(8) configuration for BusyBox## Copyright (C) 1999-2004 by Erik Andersen andersencodepoet.org### Note, BusyBox init doesnt support runlevels. // 注意BusyBox初始化不支持运行级别# The runlevels field is completely ignored by BusyBox init. If you want runlevels, use sysvinit.# // runlevels字段被 BusyBox 初始化完全忽略。如果您需要运行级别请使用 sysvinit。## Format for each entry: id:runlevels:action:process // 书写格式## // id:runlevels:action:process## id: WARNING: This field has a non-traditional meaning for BusyBox init!# // 此字段对BusyBox初始化具有非传统含义!## // id 字段由 BusyBox 初始化程序用于指定指定进程运行的控制终端。# The id field is used by BusyBox init to specify the controlling tty for the specified process to run on.# The contents of this field are appended to /dev/ and used as-is. // 此字段的内容将被追加到“/dev”并直接使用。# There is no need for this field to be unique, although if it isnt you may have strange results.# If this field is left blank, then the inits stdin/out will be used. // 如果此字段留空则将使用 init 的stdin/out。# // 此字段无需唯一但若不唯一可能会出现异常结果。## // id:runlevels:action:process## runlevels: The runlevels field is completely ignored. // runlevels 字段被完全忽略。## action: Valid actions include: sysinit, respawn, askfirst, wait, once, restart, ctrlaltdel, and shutdown.## Note: askfirst acts just like respawn, // 注意:askfirst 的行为类似于 respawn# but before running the specified process it displays the line Please press Enter to activate this console.# // 但在运行指定进程之前会显示提示信息“请按回车键激活此控制台”然后等待用户技下回车键后才启动指定进程。# and then waits for the user to press enter before starting the specified process.# // 但在运行指定进程之前它会显示“请按Enter键激活此控制台”然后等待用户按下回车键后再启动指定的进程。## Note: unrecognized actions (like initdefault) will cause init to emit an error message,# and then go along with its business.# // 注意:未识别的操作(如 initdefault )将导致初始化程序发出错误消息然后继续其业务。## process: Specifies the process to be executed and its command line. // 指定要执行的进程及其命令行。## Note: BusyBox init works just fine without an inittab. // BusyBox 初始化在没有 inittab 的情况下也能正常工作。# If no inittab is found, it has the following default behavior: // 如果未找到 inittab 它将具有以下默认行为:# ::sysinit:/etc/init.d/rcS# ::askfirst:/bin/sh# ::ctrlaltdel:/sbin/reboot# ::shutdown:/sbin/swapoff -a# ::shutdown:/bin/umount -a -r# ::restart:/sbin/init# tty2::askfirst:/bin/sh# tty3::askfirst:/bin/sh# tty4::askfirst:/bin/sh## Boot-time system configuration/initialization script. // 启动时系统配置/初始化脚本。# This is run first except when booting in single-user mode. // 此脚本在单用户模式下启动时会优先运行。#::sysinit:/etc/init.d/rcS# /bin/sh invocations on selected ttys## Note below that we prefix the shell commands with a - to indicate to the# shell that it is supposed to be a login shell.# // 请注意我们在 shell 命令前加上“-”来指示该 shell 应作为登录 shell .# Normally this is handled by login, but since we are bypassing login in this case,# BusyBox lets you do this yourself...# // 通常这种情况由登录处理但由于在此情况下我们绕过了登录BusyBox 允许您自行完成此操作...## // 在控制台启动一个“ askfirst”shell (无论那是什么)# Start an askfirst shell on the console (whatever that may be)::askfirst:-/bin/sh## Start an askfirst shell on /dev/tty2-4tty2::askfirst:-/bin/sh tty3::askfirst:-/bin/sh tty4::askfirst:-/bin/sh# /sbin/getty invocations for selected ttystty4::respawn:/sbin/getty38400tty5 tty5::respawn:/sbin/getty38400tty6# 如何在串行线(用于终端)上放置 getty 的示例# Example of how to put a getty on a serial line (for a terminal)#::respawn:/sbin/getty -L ttyS0 9600 vt100#::respawn:/sbin/getty -L ttyS1 9600 vt100## Example how to put a getty on a modem line.#::respawn:/sbin/getty 57600 ttyS2# Stuff to do when restarting the init process // 重启初始化进程时需要执行的操作::restart:/sbin/init# Stuff to do before rebooting::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount-a-r::shutdown:/sbin/swapoff-a250谢谢