構建最小根檔案系統:
下面將繼續介紹根檔案系統的其他內容:
1./proc目錄
關於linux根檔案系統/proc目錄的介紹,可以參考這個文章:下面將講解如何在最小根檔案系統的基礎上掛載proc檔案系統:
~/workdir/fstest$ mkdir proc
~/workdir/fstest$ cd etc/
~/workdir/fstest/etc$ vi inittab
console::askfirst:-/bin/sh
::sysinit:/etc/init.d/rcs
~/workdir/fstest/etc$ mkdir init.d
~/workdir/fstest/etc$ cd init.d/
~/workdir/fstest/etc/init.d$ vi rcs
#!/bin/sh
mount -a
~/workdir/fstest/etc/init.d$ chmod +x rcs
~/workdir/fstest/etc/init.d$ cd ..
~/workdir/fstest/etc$ vi fstab
#device mount-point type options dump fsck order
proc /proc proc defaults 0 0
說明:開機時,會執行/etc/init.d/rcs檔案,從而執行到該檔案的:mount -a,此時,會根據/etc/fstab的內容,來掛載檔案系統。此時,當我們再次啟動檔案系統時,就可以檢視核心相對應的資訊。
2.自動建立裝置節點的mdev機制
mdev是udev的簡化版本,它也是通過讀取核心資訊來建立裝置檔案。要使用mdev,需要核心支援sysfs檔案系統,為了減少對flash的讀寫,還要支援tmpfs檔案系統。先確保核心已經設定了config_sysfs、config_tmpfs配置項。
~/workdir/fstest$ cd etc/
~/workdir/fstest/etc$ vi fstab
#device mount-point type options dump fsck order
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev tmpfs defaults 0 0
~/workdir/fstest/etc/init.d$ vi rcs
#!/bin/sh
mount -a
mkdir /dev/pts
mount -t devpts devpts /dev/pts
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
構建根檔案系統
wget make defconfig make cross compile arm linux gnueabi make install編譯完install後會預設安裝在busybox原始碼目錄下 install目錄內,但是此檔案系統並不完整,只有四個目錄 root ls bin linuxrc ...
構建根檔案系統
wget make defconfig make cross compile arm linux gnueabi make install編譯完install後會預設安裝在busybox原始碼目錄下 install目錄內,但是此檔案系統並不完整,只有四個目錄 root ls bin linuxrc ...
構建根檔案系統
tar xjf busybox 1.7.0.tar.bz2 cd busybox 1.7.0 make menuconfig 編譯busybox 1.7.0出現如下錯誤 busybox 1.7.0 make menuconfig makefile 405 mixed implicit and nor...