欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Linux下制作給ARM開發(fā)板使用的文件系統(tǒng)

 更新時間:2018年12月17日 15:19:16   作者:Engineer-Bruce_Yang  
今天小編就為大家分享一篇關(guān)于Linux下制作給ARM開發(fā)板使用的文件系統(tǒng),小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧

1.Busybox源碼請網(wǎng)上自行下載,編譯方法請參考百度。

2.交叉編譯工具鏈的設(shè)置也請先設(shè)置好。

如果以上1、2沒有問題,那么可以使用以下腳本,制作一個給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)的庫文件的位置
#判斷文件是否存在 如果存在 就刪除
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
#拷貝庫
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
#啟動服務(wù)
iptables -F &>/dev/null
service rpcbind restart 
service nfs restart 
echo "make filesystem ok....."
exit 0

總結(jié)

以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,謝謝大家對腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請查看下面相關(guān)鏈接

相關(guān)文章

最新評論