0,在Ubuntu新建nfs目录:

#mkdir /home/shuimu/arm_project/rootfs

将FORLINX_6410_yaffs2_v1.0.tgz复制到rootfs中,

解压当前文件夹#tar–zxf FORLINX_6410_yaffs2_v1.0.tgz

1.烧写mmc,uboot,zImage到开发板。

2,在ubuntu上安装nfs-server-kernal。编辑/etc/export文件,设置输出路径。启动nfs服务。

安装:

#sudo apt-get install portmap

#sudo apt-get install nfs-kernel-server

#sudo gedit /etc/exports

在弹出的文本编辑器中编辑exports文件,在最后一行添加:

/forlinx *(rw,sync,no_root_squash)

启动相关服务:

#sudo /etc/init.d/portmap restart

#sudo /etc/init.d/nfs-kernel-server restart

3,在uboot启动后,输入:

#setenv bootargs "root=/dev/nfs nfsroot=192.168.1.1:/home/shuimu/arm_project/rootfs ip=192.168.1.200:192.168.1.1:192.168.1.1:255.255.255.0:witech.com.cn:eth0:off console=ttySAC0,115200"

#saveenv

#printenv

#reset

NOTE:

192.168.1.1 PC 端Ubuntu的IP

192.168.1.200 开发板IP

192.168.1.1 网关

255.255.255.0 子网掩码

saveenv(保存)

printenv查看设置是否正确

恢复nand flash启动:setenv bootargs“root=/dev/mtdblock3 consle=/dev/ttySAC0,115200”

#saveenv

#reset

Android 使用NFS喝Linux还是有点不同的,需要我们注意。

这里有一篇如何使用nfs作为根文件系统的文章,写的不错, 转载到这里了,看了这篇文章以后,根据自己的使用心得,把自己的使用方法也写了下来,供大家参考

[First written by Steve Guo, please keep the mark if forwarding.]Usually the Android uses YAFFS as rootfs and uses the mtd device as storage media, the bad blocks in the mtd device seldom cause YAFFS file system to work abnormally. if the Android

uses NFS as the rootfs, there will not exist such problem. So here is the solution to use NFS as the rootfs of Android.

1.       Setup host machine as NFS server (I will use ubuntu 8.0.4 as an example.).

$ sudo apt-get install nfs-kernel-server portmap

$ sudo mkdir /nfsroot

$ sudo vim /etc/exports

Add one line in /etc/exports,

/nfsroot  192.168.1.101(rw,no_root_squash,sync)

Then restart NFS server.

$ sudo /etc/init.d/nfs-kernel-server restart Here setups an NFS server which exports /nfsroot directory only to 192.168.1.101(Which is the default IP address of Android eth0).

2.       Build a Linux kernel image to use NFS as rootfs.

$make menuconfig

Modify the default setup. In "general setup" section, uncheck the "initial RAM filesystem and RAM disk(initramfs/initrd) support". In "file systems" section, check the "Network File Systems" and mark it as kernel built-in. In "boot options" section,

add the kernel parameter "root=/dev/nfs nfsroot=192.168.1.100:/nfsroot init=/init". 192.168.1.100 is the IP address of host machine running NFS server.

3.       Modify init program.

To make log system work, in the device/system/init modify the device.c by change the statement '!strncmp(uevent->path,"/class/misc/",12) && !strncmp(name, "log_", 4) to '!strncmp(name, "log_", 4)'.

4.       Modify init.rc config file.

Comment out below statements

mount rootfs rootfs /ro remount

mount yaffs mtd@system /system

mount yaffs2 mtd@system /system ro remout

mount yaffs2 mtd@userdata /data nosuid nodev

mount yaffs2 mtd@cache /cache nosuid nodev

5.    Add the user id and group id used by android on the NFS server.

Android does not use /ect/passwd file to record the user name and user id, it uses a fixed method to map the user name to user id through the head file device/include/private/android_filesystem_config.h, e.g. the user "system" has the user

id of 1000.

So to correctly set the file ownership(owner and group), the NFS server should have these users with correct user IDs. Such as system(1000). For ubuntu, you can call like this.

$sudo userdd -u 1000 android_system

This step is not necessary. It only allows you to display a user name in the develop machine.

6.       Prepare the rootfs.

Assume the built output of device lies in device/out/target/product/***/, which is called $OUTPUTDIR later. Do the follwings:

$cp -rf $OUTPUTDIR/root/* /nfsroot

$cp -rf $OUTPUTDIR/system /nfsroot

$cp -rf $OUTPUTDIR/data /nfsroot

使用心得:

我在使用NFS过程中第二步骤与作者的不同,我是设置的Uboot的启动参数,没有像作者那样在linux内核 中固定参数,我在Uboot中设置的参数是这样的:

setenv bootargs "root=/dev/nfs nfsroot=192.168.0.232:/forlinux/root ip=192.168.0.231:192.168.0.232:192.168.0.201:255.255.255.0:witech.com.cn:eth0

ff

init=/linuxrc console=ttySAC0,115200 "

saveenv

其中 192.168.0.232是主机IP(运行Ubuntu系统的PC),192.168.0.231是Android嵌入式设备的IP地址,在这里设定。192.168.0.201是我的网络的网关,当然这三个IP地址可以跟据你的当前网络情况来设置,不一定跟我的相同。

:/forlinux/root  是NFS开放的目录,里面存放着Android的文件系统,跟作者第一步骤中 /nfsroot  192.16 8.1.101(rw,no_root_squash,sync) 雷同,他开放的是 /nfsroot目录,我开放的是 /forlinux/root目录。

设定好参数后就可以顺利的挂载NFS文件系统了。

安卓手机挂载Linux,android 挂载NFS教程相关推荐

  1. android 音频显示器,安卓手机投屏(带声音同步)教程

    原标题:安卓手机投屏(带声音同步)教程 安卓手机投屏(带声音同步)教程 刚刚有网友咨询:手机投屏到大屏幕的同时怎么做到音视频分离,因为他有拉杆音箱.想要在手机投屏大屏幕的同时,声音在音箱里面. 安卓手 ...

  2. 在安卓手机安装Linux

    利用Linux Deploy这个软件,我们可以在安卓手机上安装Linux系统,当嵌入式用 具体看Linux Deploy在安卓手机安装LINUX系统 手机需要root权限且 Linux deploy ...

  3. 如何把你的安卓手机变成Linux?

     如何把你的安卓手机变成Linux? 使用KBOX或者Limbo PC Emulator: http://www.linux-magazine.com/Online/Features/Conver ...

  4. 安卓手机投屏软件_直播教程 | 安卓手机投屏队伍语音解决方案1

    安卓手机投屏队伍语音解决方案1 主播大大好啊! 我们之前的文章讲过安卓手机投屏到直播电脑的手游直播教程,使用台式机+投屏的方式,这样无论是游戏体验,还是直播的观看体验,都会好很多,这是也是被手游主播普 ...

  5. 基于安卓手机使用Termux搭建web服务器教程

    基于安卓手机使用Termux搭建web服务器教程 一.软件的准备 Termux Android5.0以上的手机(最好root) Xshell 6(windows软件) 二.前期Termux的设置与安装 ...

  6. 安卓手机安装Linux教程 多图

    这里是效果 想玩linux,电脑不想装双系统,性能不够跑不了虚拟机,树莓派买不起,怎么办?安卓手机啊 本文就以Nexus 5X(PureNexus 7.1.2)为例,介绍如何在手机上跑Linux,这是 ...

  7. android手机装windows,安卓手机上运行WindowsXP系统图文教程

    之前分享过很多关于安卓手机连接电脑远程桌面的小技巧,是不是玩腻了很没劲,没关系!下面咱就来点货真价实的,简单几步让你的安卓智能手机直接运行Windows XP系统,感觉一下子"高大上&quo ...

  8. android go 刷机教程,所有安卓手机详细 线刷 卡刷教程!看完小白变大神!

    安卓手机通病 越用越卡 !刷机成为了唯一解决办法!今天教大家刷机 就算你没用过别的品牌手机 看玩基本也就会了!大神勿喷! 卡刷: 首先进入re模式 方法:上下电源键选择 电源键或者home键确定 小米 ...

  9. android 自动升级 图,手机系统更新好不好 安卓手机系统更新方法【图文教程】...

    智能手机的功能如此丰富,在于系统的智能化,目前人们所用的手机系统大多是 苹果 的ios系统以及谷歌的安卓系统.除了苹果手机外大部分智能手机使用的都是安卓系统,手机用智能系统后的功能是多了很多,但几乎每 ...

最新文章

  1. net通过oledb 和ibm自带连接方式,连接db2数据库出错
  2. python+flask+vue开发(1)--虚拟环境创建
  3. 风控建模中的样本偏差与拒绝推断
  4. java.sql.SQLException: ORA-01438: 值大于此列指定的允许精确度
  5. 2021浙江高考宁波四中成绩查询,2021浙江高考成绩查询时间公布 几号能查分
  6. 小程序消息服务器webapi,小程序订阅消息
  7. 10.Java 面试题整理(CORBA 方面)
  8. 【渝粤教育】国家开放大学2018年秋季 0248-21T电工电子技术 参考试题
  9. 用VS.NET 2005制作安装程序
  10. mac 安装mysql 找不到_mac安装mysql遇到的坑
  11. 5S管理活动的实施和运行方案
  12. zabbix监控平台设置报警发送邮件
  13. 一年级有计算机教学吗,一年级信息技术教学计划范文
  14. 约克大学计算机语言班,约克大学语言班申请
  15. 最强赛亚人服务器维护,最强赛亚人官方,最强赛亚人手游官方正版预约 v1.1.0-手游汇...
  16. 嵌入式开发人员应该关心机器学习的 5 个理由
  17. Hadoop集群读写性能测试以及MR测试
  18. 番茄花园 Ghost XP SP3 2012 06 电脑城极速装机版
  19. 在同一个浏览器上打开同一个网址只打开一个窗口的方法
  20. 【Java】简单银行案例实现

热门文章

  1. (转) 一步一步学习ASP.NET 5 (四)- ASP.NET MVC 6四大特性
  2. Android Service 的一些笔记
  3. Android SDK Manager 在win8.1上的闪退问题【转载】
  4. The Ransom of Red Chief
  5. [Leetcode][LCP 19][JAVA][秋叶收藏集][动态规划]
  6. [Leedcode][JAVA][第15题][三数之和][数组][双指针]
  7. python如何输入空行_在python中,如何在接受用户输入时跳过空行?
  8. android 怎么自定义任务栈,Android中的Activity详解--启动模式与任务栈
  9. 【复习】使用 SQLiteDatabase 操作 SQLite 数据库
  10. 多C++标准版本指定