1.Busybox源碼請(qǐng)網(wǎng)上自行下載,編譯方法請(qǐng)參考百度。
2.交叉編譯工具鏈的設(shè)置也請(qǐng)先設(shè)置好。
如果以上1、2沒有問題,那么可以使用以下腳本,制作一個(gè)給ARM開發(fā)板使用的文件系統(tǒng)。
可以自行定制使用,加入自己的Test demo。
#!/bin/bash #yuanxin.yang develop 2015-07-05 #文件系統(tǒng)和Busybox的路徑====>可自己定制 FILESYSTEM=/Softwave/filesystem #定義自己制作的文件系統(tǒng)存放的位置 BUSYBOX=/Softwave/arm/busybox-1.17.2 #Busybox軟體的位置 LIBS=/usr/local/arm/4.5.1/arm-none-linux-gnueabi #交叉編譯相關(guān)的庫(kù)文件的位置 #判斷文件是否存在 如果存在 就刪除 if [ -d $FILESYSTEM ] then rm -rf $FILESYSTEM &>/dev/null mkdir $FILESYSTEM &>/dev/null else mkdir $FILESYSTEM &>/dev/null fi #拷貝busybox相關(guān)的文件 if ! cp -rf $BUSYBOX/_install/* $FILESYSTEM &>/dev/null then echo "cp busybox failed..." exit 1 fi #拷貝庫(kù) if ! cp -rf $LIBS/lib/ $FILESYSTEM/ &>/dev/null then echo "copy libs fair...." exit 1 fi #拷貝etc if ! cp -rf $BUSYBOX/examples/bootfloppy/etc $FILESYSTEM &>/dev/null then echo "copy etc fair..." exit 1 fi #創(chuàng)建Linux相關(guān)目錄 cd $FILESYSTEM &>/dev/null mkdir boot mnt root sys var net proc tmp dev home opt &>/dev/null #修改配置文件 echo > $FILESYSTEM/etc/fstab #修改etc/profile文件 echo "# /etc/profile: system-wide .profile file for the Bourne shells" > $FILESYSTEM/etc/profile echo "echo \"===========================\"" >> $FILESYSTEM/etc/profile echo "echo \"Welcom to Linux System\"" >> $FILESYSTEM/etc/profile echo "echo \"===========================\"" >> $FILESYSTEM/etc/profile echo "export PS1=\"[jiaobenzhijia@Linux \W] # \"" >> $FILESYSTEM/etc/profile #修改 etc/init.d/rcS echo "#! /bin/sh" > $FILESYSTEM/etc/init.d/rcS echo "/bin/mount -n -t proc none /proc" >> $FILESYSTEM/etc/init.d/rcS echo "/bin/mount -n -t sysfs none /sys " >> $FILESYSTEM/etc/init.d/rcS echo "/bin/mount -t ramfs none /dev " >> $FILESYSTEM/etc/init.d/rcS echo "/bin/mount -n -t ramfs none /tmp " >> $FILESYSTEM/etc/init.d/rcS echo "/sbin/mdev -s" >> $FILESYSTEM/etc/init.d/rcS #配置nfs服務(wù) if ! grep "$FILESYSTEM" /etc/exports &>/dev/null then echo "/filesystem *(rw,sync,no_root_squash)" >> /etc/exports fi #啟動(dòng)服務(wù) iptables -F &>/dev/null service rpcbind restart service nfs restart echo "make filesystem ok....." exit 0
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請(qǐng)查看下面相關(guān)鏈接
標(biāo)簽:蕪湖 綏化 巴中 晉城 福州 撫順 孝感 南充
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux下制作給ARM開發(fā)板使用的文件系統(tǒng)》,本文關(guān)鍵詞 Linux,下,制作,給,ARM,開發(fā),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。