/**************************一. busybox製做成功*********************************************/
實驗目的:ls /root/rootfs/oceanstar_rootfs/my_busybox/ (能夠看到4個文件夾表示製做busybox成功,這個實驗已經作過了)linux
(1). windows電腦下的F:\winshare\rootfs\busybox-1.24.1.tar.bz2shell
(2). 將busybox複製到ubuntu中並解壓:express
* cd /root/rootfs/oceanstar_rootfs/ * cp /mnt/hgfs/Winshare/rootfs/busybox-1.24.1.tar.bz2 /root/rootfs/oceanstar_rootfs/ * ls * tar -jxvf busybox-1.24.1.tar.bz2
(3) 改makefile裏的arch和cross_comubuntu
* cd /root/rootfs/oceanstar_rootfs/busybox-1.24.1 * vi Makefile:添加 ARCH = arm CROSS_COMPILE = /usr/local/arm/arm-2009q3/bin//arm-none-linux-gnueabi-
(4). make menuconfig進行配置windows
* Busybox Settings---> Build Options---> [*]Build BusyBox as a static binary(no shared libs) Busybox Library Tuning---> [*]vi-style line editing commands [*]Fancy shell prompts * Linux Module Utilities---> [ ]Simplified modutils [*]insmod [*]rmmod [*]lsmod [*]modprobe [*]depmod * Linux System Utilities--->[*]mdev [*]Support /etc/mdev.conf [*]Support subdirs/symlinks [*]Support regular expressions substitutions when renaming dev [*]Support command execution at device addition/removal [*]Support loading of firmwares * Coreutils ---> [ ] sync
(5). make -j2(Final link with:: m)
ls(出現一個黃色的busybox就表示表示完成了)ui
(6). 安裝busybox命令行
* make menuconfig Busybox Settings --->Installation Options ("make install" behavior) --->(./_install) BusyBox installation prefix,而後
複製 /root/rootfs/oceanstar_rootfs/my_busyboxcode
* make install
實驗目的:ls /root/rootfs/oceanstar_rootfs/my_busybox/ (能夠看到4個文件夾表示製做busybox成功)ip
/**********開發板設置bootargs掛載添加了busybox移植的rootfs(已經解決)**************************************/
(1). SecurtCRT鏈接運行linux系統的開發板開發
* 打斷3s啓動進入uboot: * 設置bootargs:setenv bootargs root=/dev/nfs nfsroot=192.168.1.141:/root/rootfs/oceanstar_rootfs/my_busybox ip=192.168.1.10:192.168.1.141:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC2,115200 * save
(2). zImage下載
* 前提條件:tftp搭建好,插好網線 * ls /tftpboot/ (看有沒有zImage,若是沒有,參考:zImage:2.15.3.內核配置和編譯體驗(1.24實驗手冊)) * ping 192.168.1.141 * tftp 30008000 zImage * 結果不斷重啓, VFS: Cannot open root device "nfs" or unknown-block(0,255),實驗現象與老師的不一樣,老師的是VFS:Mounted root (nfs filesystem) on device 0:12
總結:nfs掛載失敗,
分析:這堂課有兩個實驗:製做busybox和下載添加了busybox的rootfs,這兩個實驗鏈接起來的地方是開發板uboot中設置bootargs:/root/rootfs/oceanstar_rootfs/my_busybox。
2018.3.14更新:開發板設置bootargs掛載添加了busybox移植的rootfs失敗緣由是內核不支持nfs方式啓動,可參考rootfs:2.18.4.nfs方式啓動自制簡易文件夾形式的rootfs.zhu:配置內核支持nfs方式啓動
解決方法:set bootcmd 'tftp 30008000 zImage; bootm 30008000'(必定要設置)
/***************************跟新版本**********************************************************/
(1). windows電腦下的F:\winshare\rootfs\busybox-1.24.1.tar.bz2
(2). 將busybox複製到ubuntu中並解壓:
* cd /root/porting_x210/rootfs/aston_rootfs * cp /mnt/hgfs/Winshare/rootfs/busybox-1.24.1.tar.bz2 ./ * ls * tar -jxvf busybox-1.24.1.tar.bz2
(3) 改makefile裏的arch和cross_com
* cd busybox-1.24.1
* make distclean
* vi Makefile:添加
ARCH = arm CROSS_COMPILE = /usr/local/arm/arm-2009q3/bin//arm-none-linux-gnueabi-
(4). make menuconfig進行配置
* Busybox Settings--->
Build Options---> [*]Build BusyBox as a static binary(no shared libs) Busybox Library Tuning---> [*]vi-style line editing commands [*]Fancy shell prompts * Coreutils ---> [ ] sync * Linux Module Utilities---> [ ]Simplified modutils [*]insmod [*]rmmod [*]lsmod [* ] Pretty output (NEW) [*]modprobe [* ] Blacklist support (NEW) [*]depmod * Linux System Utilities--->[*]mdev [*]Support /etc/mdev.conf [*]Support subdirs/symlinks [*]Support regular expressions substitutions when renaming dev [*]Support command execution at device addition/removal [*]Support loading of firmwares * Busybox Settings --->Installation Options ("make install" behavior) --->(./_install) BusyBox installation prefix,而後複製 /root/porting_x210/rootfs/rootfs
(5). make -j2(Final link with:: m)
ls(出現一個黃色的busybox就表示表示完成了)
(6). 安裝busybox
* make install
ls /root/porting_x210/rootfs/rootfs(能夠看到4個文件夾表示製做busybox成功)/**********開發板設置bootargs掛載添加了busybox移植的rootfs**************************************/(1). SecurtCRT鏈接運行linux系統的開發板
* 打斷3s啓動進入uboot:
* 設置bootargs:setenv bootargs root=/dev/nfs nfsroot=192.168.1.141:/root/porting_x210/rootfs/rootfs ip=192.168.1.10:192.168.1.141:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC2,115200
* set bootcmd 'tftp 30008000 zImage; bootm 30008000'(必定要設置)
* save
* reset
結果:
[ 9.423975] VFS: Mounted root (nfs filesystem) on device 0:12.
[ 9.428489] Freeing init memory: 172K
can't run '/etc/init.d/rcS': No such file or directory
can't open /dev/tty2: No such file or directory
can't open /dev/tty3: No such file or directory
can't open /dev/tty4: No such file or directory
/#
獲得了命令行,掛載成功,/linuxrc(就是busybus)執行:可是找不到rcS等文件