用NFS启动rootfs的浅度总结

本文针对海思hi3716c平台上的Linux Kernel 3.0.8系统通过NFS启动rootfs过程中遇到的问题进行了详细分析,并给出了具体的解决步骤。主要解决了NFS支持配置缺失及网络配置不完整等问题。

平台:海思hi3716c

linux kernel:3.0.8

rootfs: mer-core based on release 20121018.1

使用下面的bootargs:

setenv bootargs 'mem=764M vmalloc=600Mconsole=ttyAMA0,115200 mmz=ddr,0,0xb3c00000,100M mtdparts=hi_sfc:448K(fastboot),64K(bootargs),3520K(recovery),64K(deviceinfo);hinand:6M(baseparam),8M(logo),10M(fastplay),30M(cache),10M(misc),10M(kernel),300M(system),134M(userdata),4M(blackbox),1536M(sdcard)root=/dev/nfs rw nfsroot=192.168.188.141:/home/zhanghui/nfs/rootfs/mer-hybris ip=dhcp'

问题1:

VFS: Cannot open root device"nfs" or unknown-block(0,255)

Pleaseappend a correct "root=" boot option; here are the availablepartitions:

原因是:kernel中的NFS支持没设置好。

解决办法:

理论上说,要用NFS启动rootfs,需要有两个支持:

(1)NFSv3 client support

(2)Root file system on NFS

但是,在hi3716c的kernel目录下,'make menuconfig'时死活没有看到"Root file system on NFS"这个选项。

网上查到"Root file system on NFS"对应的是"CONFIG_ROOT_NFS",于是

#vim arch/arm/configs/godbox_icsmer_defconfig

在上面的文件加入"CONFIG_ROOT_NFS=y"。

然后执行:

#make godbox_icsmer_defconfig

查看.config文件,发现并没有“CONFIG_ROOT_NFS”这个东东。表明没有生效。

找到链接http://cateee.net/lkddb/web-lkddb/ROOT_NFS.html,里面有描述:

Root file system on NFS found in fs/nfs/Kconfig

The configuration item CONFIG_ROOT_NFS:

原来依赖了CONFIG_IP_PNP。

于是,

#vim arch/arm/configs/godbox_icsmer_defconfig

设置"CONFIG_IP_PNG=y"

#make godbox_icsmer_defconfig

检查生成的.config文件,发现CONFIG_ROOT_NFS=y已经在里面了。

#make -j 8 uImage

将生成的内核arch/arm/boot/uImage烧写入FLASH,重启系统。


问题2

在问题1解决后,碰到错误信息:

IP-Config: Incomplete network configurationinformation.

VFS: Unable to mount root fs via NFS,trying floppy.

VFS: Cannot open root device"nfs" or unknown-block(2,0)

Pleaseappend a correct "root=" boot option; here are the availablepartitions:
查看kernel/net/ipv4/ipconfig.c,发现有几行代码:

/*
         * If none of DHCP/BOOTP/RARP was selected, return with an error.
         * This routine gets only called when some pieces of information
         * are missing, and without DHCP/BOOTP/RARP we are unable to get it.
         */
        if (!ic_proto_enabled) {
                printk(KERN_ERR "IP-Config: Incomplete network configuration information.\n");
                return -1;
        }

从这里看,应该至少使能DHCP/BOOTP/RARP中的一个;检查godbox_icsmer_defconfig发现,这三个东东没有。

因此,

#vim arch/arm/configs/godbox_icsmer_defconfig

在其中添加三行:

CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
然后,

#make godbox_icsmer_defconfig

#make -j 8 uImage

将生成的内核arch/arm/boot/uImage烧写入FLASH,重启系统。

问题3:

还有一个没有搞明白的问题。虽然现在用DHCP获取IP可以通过NFS挂载ROOTFS了,但如果在bootargs中改用静态IP,怎么也不行,总是打印"Sending DHCP request"。不知为什么。

在Ubuntu Petalinux 2018.3环境中,当你尝试使用`petalinux-config`命令配置根文件系统 (`rootfs`) 并引入Qt5 SDK来构建项目,但发现未生成`qmake`工具,这可能是由于以下几个原因: 1. **依赖缺失**:确保已经安装了所有必要的构建工具,包括Qt SDK和相关的Linux交叉编译工具链。你可以检查是否已通过`apt-get install`命令安装了`qtbase5-dev-tools`和其他必要的库。 2. **配置问题**:`petalinux-config`可能没有正确识别到你的Qt5安装路径或者配置选项有误。确认你的Qt5安装路径是否添加到了`PETALINUX_QT5_DIR`环境变量,并且该路径下的`qmake`文件确实存在。 3. **版本兼容性**:Petalinux 2018.3可能不支持Qt 5的所有版本,需要确认所使用的Qt版本是否与平台兼容。 4. **脚本冲突**:如果你的系统上还有其他版本的`qmake`或自定义的构建脚本,可能会干扰`petalinux-config`的默认行为。确保清理或优先级设置正确的`PATH`环境变量。 要解决这个问题,你可以按照以下步骤操作: - 检查依赖并更新: ```sh sudo apt-get update && sudo apt-get install -y qtbase5-dev-tools ``` - 确认配置: ```sh source /opt/poky/oe-init-build-env petalinux-config --get-variable PETALINUX_QT5_DIR ``` - 如果配置有问题,手动指定路径: ```sh petalinux-config --append-variable PETALINUX_QT5_DIR=/path/to/qt5/installation ``` - 验证配置后重新运行构建过程: ```sh petalinux-build --run-applications=y ``` 如果还是无法生成`qmake`,可以尝试重建SDK: ```sh petalinux-build -t SDK ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值