i.mx6 rcS file parsing

Reference Hirofumi:

https://blog.csdn.net/u013686019/article/details/26846571

#! /bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
runlevel=S   

Operating system level is set to S (single user mode), i.e., single-user mode, only a console terminal, for "root" account for system maintenance.
prevlevel = N 

umask 022 

Create a file or folder, their default permissions -umask basic code permission (mask bit), predetermined, basic code rwxrwxrwx folder (777), the basic code file rw-rw-rw- (666)


export PATH runlevel prevlevel

#
# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#

trap ":" INT QUIT TSTP

Capture INT, QUIT, TSTP signal
trap to capture shell command signal, there are three basic forms:
(. 1) trap "cmd" signal-list
trap signal-list received signal with the same listed Execute cmd
( 2) trap signal-list
performs the default operation signal itself
(3) trap "" signal- list
ignore signals specified signal-list

/bin/hostname iTOP-iMX6-XIANG

Set the host name

#/bin/mount -n -t proc none /proc
#/bin/mount -n -t sysfs none /sys
#/bin/mount -n -t usbfs none /proc/bus/usb
#/bin/mount -t ramfs none /dev

[ -e /proc/1 ] || /bin/mount -n -t proc none /proc
[ -e /sys/class ] || /bin/mount -n -t sysfs none /sys
[ -e /dev/tty ] || /bin/mount -t ramfs none /dev

Mount "virtual" file system, -t specify the type of file system, -n just simply mount, and not to write / etc / mtab file
echo / sbin / mdev> / proc / sys / kernel / hotplug

Call mdev manager dynamically create plugging device. The above call kernel at each occurrence change in a transmitting apparatus into a user-space application / sbin / mdev to process information corresponding to the operation of the device in further mdev / dev directory, add or delete.
/ sbin / mdev -s

The kernel can automatically create device nodes in the / dev directory

#/bin/hotplug

Hotplug handler is provided mdev core, the core mdev accepts messages from and respond accordingly, such as U disk mount.


# mounting file system specified in /etc/fstab
mkdir -p /dev/pts
mkdir -p /dev/shm
/bin/mount -n -t devpts none /dev/pts -o mode=0622
/bin/mount -n -t tmpfs tmpfs /dev/shm
#/bin/mount -n -t ramfs none /tmp
#/bin/mount -n -t ramfs none /var

Then create the specified folder to mount file systems

mkdir -p / var / empty
mkdir -p / var / log
mkdir -p / var / log / boa
mkdir -p / var / lock
mkdir -p / var / run
mkdir -p / var / tmp

#ln -sf /dev/ttyS2 /dev/tty2
#ln -sf /dev/ttyS2 /dev/tty3
#ln -sf /dev/ttyS2 /dev/tty4

syslogd

Recording a variety of information generated by the system or application, and the information written to the log 


/etc/rc.d/init.d/netd start
echo " " > /dev/tty1
echo "Starting networking..." > /dev/tty1

Start the Web Service

#sleep 1
#/etc/rc.d/init.d/httpd start
#echo " " > /dev/tty1
#echo "Starting web server..." > /dev/tty1
#sleep 1
#/etc/rc.d/init.d/leds start
#echo " " > /dev/tty1
#echo "Starting leds service..." > /dev/tty1
#echo " "
#sleep 1

mkdir /mnt/disk
sleep 1
/sbin/ifconfig lo 127.0.0.1
/etc/init.d/ifconfig-eth0

Performing ifconfig-eth0, network configuration

Guess you like

Origin blog.csdn.net/u013215852/article/details/86079741