/Linuxrc 執(zhí)行init 進(jìn)程初始化文件。主要工作是把已安裝根文件系統(tǒng)中的/etc 安裝為ramfs,
并拷貝/mnt/etc/目錄下所有文件到/etc,這里存放系統(tǒng)啟動(dòng)后的許多特殊文件;接著Linu
xrc 重新構(gòu)建文件分配表inittab;之后執(zhí)行系統(tǒng)初始化進(jìn)程/sbin/init。
/mnt/etc/init.d/rcS 完成各個(gè)文件系統(tǒng)的 mount,再執(zhí)行/usr/etc/rc.local;通過rcS 可
以調(diào)用 dhcp 程序配置網(wǎng)絡(luò)。rcS 執(zhí)行完了以后,init 就會(huì)在一個(gè) console 上,按照 ini
ttab 的指示開一個(gè) shell,或者是開 getty + login,這樣用戶就會(huì)看到提示輸入用戶名的
提示符。
/usr/etc/rc.local 這是被init.d/rcS 文件調(diào)用執(zhí)行的特殊文件,與Linux 系統(tǒng)硬件平臺(tái)相關(guān),
如安裝核心模塊、進(jìn)行網(wǎng)絡(luò)配置、運(yùn)行應(yīng)用程序、啟動(dòng)圖形界面等。
/usr/etc/profile rc.local 首先執(zhí)行該文件配置應(yīng)用程序需要的環(huán)境變量等。
Linuxrc
#!/bin/sh
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/3 /
/bin/mount -f -t ramfs ramfs /etc
exec /sbin/init
rcS
/mnt/etc/init.
d/
#!/bin/sh
/bin/mount -a
exec /usr/etc/rc.local
rc.local
/usr/etc/
#!/bin/sh
. /usr/etc/profile
echo "HELLO! Embest"
echo "ifconfig eth0 192.168.0.10"
ifconfig eth0 192.168.0.10 ?? 可自行配置開發(fā)板IP
Profile
/usr/etc/
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin ?? 設(shè)置命令工具所在位置
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。