最近在小黄鱼入手了一个RK3399的开发板,RK的芯片我也是第一次使用。FireFly配套提供了完善的教程,可以在他们的WIKI上找到。上面有的内容就不在本文叙述了,大家可以参考教程https://wiki.t-firefly.com/zh_CN/Firefly-RK3399/linux_compile_gpt.html
这篇文章主要如何对板子做一些基础的配置。
开发环境:
$ sudo apt install nfs-kernel-server
$ sudo mkdir /home/zhongyi/mnt
$ sudo chmod 777 /home/zhongyi/mnt
打开/etc/exports
文件:
$ sudo vim /etc/exports
在文件内容的最后一行添加以下:
/home/zhongyi/mnt *(rw,sync,no_subtree_check)
$ sudo exportfs -a
$ sudo systemctl restart nfs-kernel-server
新建一个临时目录并挂接 nfs:
$ mkdir ~/project/mnt
$ sudo mount -t nfs 127.0.0.1:/home/zhongyi/mnt ~/project/mnt/
进入临时目录新建一个文件:
$ cd ~/project/mnt/
$ touch test.txt
进入 nfs 目录进行查看:
$ cd /mnt/nfs/
$ ls
test.txt
看到test.txt
文件说明 NFS 服务端已搭建成功!
取消挂接:
$ sudo umount ~/project/mnt
FireFly-RK3399自带的kernel默认是没有开启NFS服务的。因此,想要挂载到虚拟机上,必须在开发板上安装NFS服务。而FireFly-RK3399默认是可以直接连接无线网络的,因此,就省去了配置PC网卡的麻烦。
FireFly-RK3399连接无线网络的方法可以参考这个文章 https://www.ebaina.com/articles/140000013427。
FireFly-RK3399 自带的软件源安装太慢了,因此要更换掉。
sudo cp /etc/apt/sources.list /etc/apt/sources.list_back
sudo vim /etc/apt/sources.list
将以下内容添加到源列表中。
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
sudo apt-get update
sudo apt-get upgrade
/* 执行安装nfs组件 */
sudo apt-get install nfs-common
安装完成后,执行cat /proc/filesystems
查看nfs组件是否安装成功。
/* 查看nfs是否安装 */
firefly@firefly:~$ cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev ramfs
nodev bdev
nodev proc
nodev cpuset
nodev cgroup
nodev cgroup2
nodev tmpfs
nodev devtmpfs
nodev configfs
nodev debugfs
nodev tracefs
nodev securityfs
nodev sockfs
nodev pipefs
nodev rpc_pipefs
nodev devpts
ext3
ext2
ext4
squashfs
vfat
iso9660
nodev nfs
nodev nfs4
ntfs
$ mkdir ~/nfs
mount -t nfs -o nolock 192.168.137.100:/home/zhongyi/mnt /root/mnt
将生成的配置文件备份一份
cp ./rockchip_linux_myconfig.config ./arch/arm64/configs/rockchip_linux_myconfig.config
make ARCH=arm64 rockchip_linux_myconfig.config;make rk3399-evb-ind-lpddr4-linux.img -j10
确认编译配置正确
➜ kernel git:(firefly) ✗ grep "NFS" ./.config
# CONFIG_USB_FUNCTIONFS is not set
CONFIG_KERNFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_NFS_SWAP=y
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_FLEXFILE_LAYOUT=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
CONFIG_NFS_V4_1_MIGRATION=y
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFSD is not set
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
确认编译时间和配置
➜ kernel git:(firefly) ✗ ls -al | grep boot.img
-rw-rw-r-- 1 zhongyi zhongyi 29837312 Sep 24 22:20 boot.img
-rw-rw-r-- 1 zhongyi zhongyi 19324928 Sep 24 22:20 zboot.img
编译打包
生成的固件在/home/zhongyi/code/rk3399_linux_release_v2.5.1_20210301/rockdev/pack/FIREFLY-RK3399_Ubuntu-r21062_v2.5.1b_220924.img
cd /home/zhongyi/code/rk3399_linux_release_v2.5.1_20210301/rockdev/pack/
sudo upgrade_tool uf FIREFLY-RK3399_Ubuntu-r21062_v2.5.1b_220924.img
具体编译打包可以参考:https://wiki.t-firefly.com/zh_CN/Firefly-RK3399/linux_compile_gpt.html#zhun-bei-gong-zuo
系统升级参考:https://wiki.t-firefly.com/zh_CN/Firefly-RK3399/03-upgrade_firmware.html
end
全部0条评论
快来发表一下你的评论吧 !