根檔案系統製作

來源:互聯網
上載者:User

標籤:

一.建立根檔案系統目錄與檔案

    1.建立目錄        *mkdir  /home/ARM11/kernel/rootfs        *cd /home/ARM11/kernel/rootfs        *mkdir bin dev etc lib proc sbin sys usr mnt tmp var         *mkdir usr/bin usr/lib usr/sbin lib/modules        2.建立裝置檔案       * cd rootfs/dev       * mknod -m 666 console c 5 1        *mknod -m 666 null c 1 3    3.加入設定檔       *tar xvzf  etc.tar.gz       *mv etc/* ./etc (這裡注意是rootfs目錄下的etc目錄,不是根目錄下的etc目錄)      4.添加核心模組        *cd  /home/ARM11/kernel/tin6410_linux/linux-tiny6410 (進入到我們要安裝到開發板的核心源碼檔案下)        *make modules ARCH=arm CROSS_COMPILE=arm-linux-        *make modules ARCH=arm INSTALL_MOD_PATH=/home/ARM11/kernel/rootfs (INSTALL_MOD_PATH 制定我們要將收集的核心模組再放在哪裡,這裡我們制定存放在我們製作的根檔案目錄下,並且自動儲存在/lib/modules下)    5.編譯和安裝Busybox --BusyBox 是一個整合了一百多個最常用linux命令和工具的軟體        * tar xvzf busybox-1.13.3.tar.gz        * make menuconfig --配置busybox               *   Busybox Settings -->Build Options                         *選中Build BusyBox as static binary (no shared lib)   -- 靜態連結                        *    ()Cross Compiler prefix  -- 括弧裡填入arm-linux-                 *   Busybox Settings -->Build Options                         *選中Don‘t use /usr    --選中該項可以避免busybox被安裝到宿主系統的/usr目錄下,破壞宿主系統。                        *()BusyBox installation prefix --填入製作跟檔案系統所在的目錄          * make --編譯          * make install --安裝到製作的跟檔案系統下二.掛載根檔案系統到核心    1.檔案系統類型    2.使用Initramfs        *cd /home/ARM11/kernel/rootfs/        *ln -s ./bin/busybox init --建立軟連結        *配置linux核心以支援initramfs             *make menuconfig ARCH=arm                      *選中                *--括弧裡填入製作的根檔案系統所在的目錄。          *make uImage ARCH=arm CROSS_COMPILE=arm-linux-  --編譯核心          *啟動uboot               *setenv bootargs noinitrd console=ttySAC0,115200 --設定串口0               *saveenv --儲存環境變數               *tftp --下載核心到記憶體                *bootm  addr  啟動核心    3.使用NFS檔案系統        *配置linux核心以支援NFS             *make menuconfig ARCH=arm                        *取消選中                  *選中File systems -->Network File Systems -->Root file system on NFS             *make uImage ARCH=arm CROSS_COMPILE=arm-linux-  --編譯核心             *啟動uboot                    *setenv bootargs noinitrd console=ttySAC0,115200 init=/init root=dev/nfs rw nfsroot=192.168.0232:/home/ARM11/kernel/rootfs,proto=tcp,nfsvers=3 ip=192.168.0.137:192.168.0.232:192.168.0.1:255.255.255.0::eth0:off                    *saveenv                    *tftp --下載核心到記憶體                    *bootm  addr  啟動核心      -----至此從移植uboot,到用uboot載入系統核心,再到往核心上掛載檔案系統,完成了將linux系統移植到了我tiny6410開發板上。                        --自己選擇的路,在艱難,跪著也要走下去,fighting!

根檔案系統製作

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.