以下内容源于朱有鹏嵌入式课程的学习与整理,如有侵权请告知删除。
1、首先验证文件夹形式的rootfs是否可用
(1)按照从零开始构建根文件系统得到一个文件夹形式的rootfs。
(2)按照以NFS方式挂载rootfs查看启动效果,作为将来用ext2格式的rootfs镜像烧录时的参照。
2、利用文件夹形式的rootfs制作ext2格式的镜像
具体操作过程见博客回环设备文件(即/dev/loop*)与losetup命令。
3、烧录根文件系统镜像
(1)首先修改bootargs参数如下,表示根文件系统烧写在inand中,类型是ext2。
set bootargs 'console=ttySAC2,115200 root=/dev/mmcblk0p2 rw init=/linuxrc rootfstype=ext2'
save
(2)利用fastboot将rootfs.ext2烧写到开发板inand中,过程见博客如何将镜像烧写至iNand。
fastboot flash system rootfs.ext2
C:\Users\XJH\Desktop\rootfs>fastboot flash system rootfs.ext2
sending 'system' (10240 KB)... OKAY
writing 'system'... OKAY
C:\Users\XJH\Desktop\rootfs>
可能出现错误1:找不到设备,解决方法是在设备管理器里更新对应的驱动程序。
可能出现错误2:FAILED (data transfer failure (Too many links)),解决方法是关闭防火墙以及一些杀毒软件。
4、验证根文件系统镜像
这种启动方式和nfs挂载rootfs启动方式,两者现象一致,这表明根文件系统制作完成。
不过还是有一些差异,nfs挂载rootfs启动方式的启动信息如下:
[ 2.932834] <6>S5PC1XX TVOUT Driver, (c) 2009 Samsung Electronics
[ 2.939539] s5p-tvout s5p-tvout: hpd status is cable removed
[ 3.490295] eth0: link down
[ 3.491765] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 3.810591] eth0: link up, 100Mbps, full-duplex, lpa 0x4DE1
[ 3.814784] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 4.498234] IP-Config: Complete:
[ 4.499810] device=eth0, addr=192.168.1.88, mask=255.255.255.0, gw=192.168.1.1,
[ 4.507433] host=192.168.1.88, domain=, nis-domain=(none),
[ 4.513338] bootserver=192.168.1.141, rootserver=192.168.1.141, rootpath=
[ 4.520902] DBUG_PORT must not use AFC!
[ 4.524660] Looking up port of RPC 100003/2 on 192.168.1.141
[ 4.536566] Looking up port of RPC 100005/1 on 192.168.1.141
[ 4.555059] VFS: Mounted root (nfs filesystem) on device 0:12.
[ 4.559492] Freeing init memory: 540K
Please press Enter to activate this console.
[root@ZHUJI ]#
这种烧写至inand的启动方式启动信息如下:
[ 2.913095] <6>S5PC1XX TVOUT Driver, (c) 2009 Samsung Electronics
[ 2.919772] s5p-tvout s5p-tvout: hpd status is cable removed
[ 2.930818] DBUG_PORT must not use AFC!
[ 2.935608] EXT2-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
[ 2.943448] VFS: Mounted root (ext2 filesystem) on device 179:2.
[ 2.948809] Freeing init memory: 540K
[ 3.814494] eth0: link down
[ 3.816050] ADDRCONF(NETDEV_UP): eth0: link is not ready
Please press Enter to activate this console. [ 5.443375] eth0: link up, 100Mbps, full-duplex, lpa 0x4DE1
[ 5.447711] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[root@ZHUJI ]#