linux鲁班猫代码初尝试[编译镜像][修改根文件系统重编译]

编译镜像

官方百度云盘资料:https://doc.embedfire.com/linux/rk356x/quick_start/zh/latest/quick_start/baidu_cloud/baidu_cloud.html

解压虚拟机压缩包:"鲁班猫\8-SDK源码压缩包\开发环境虚拟机镜像\ubuntu20.04.7z"后既可以用VMware打开,打开后可以看到已经有了现成的SDK,如下:

按照:https://doc.embedfire.com/linux/rk356x/build_and_deploy/zh/latest/building_image/debian_rootfs/debian_rootfs.html#id13

文章的说法输入如下命令一键生成镜像:

bash 复制代码
# 一键编译
./build.sh

运行成功后在"rockdev"目录生成"update.img"即为镜像文件,该文件可以通过如下文章的说明下载到芯片中运行:https://chengdong.blog.csdn.net/article/details/132035193

bash 复制代码
Running build_firmware succeeded.
Make update.img
start to make update.img...
Android Firmware Package Tool v2.0
------ PACKAGE ------
Add file: ./package-file
package-file,Add file: ./package-file done,offset=0x800,size=0xa0,userspace=0x1
Add file: ./Image/MiniLoaderAll.bin
bootloader,Add file: ./Image/MiniLoaderAll.bin done,offset=0x1000,size=0x729c0,userspace=0xe6
Add file: ./Image/parameter.txt
parameter,Add file: ./Image/parameter.txt done,offset=0x74000,size=0x168,userspace=0x1
Add file: ./Image/uboot.img
uboot,Add file: ./Image/uboot.img done,offset=0x74800,size=0x400000,userspace=0x800
Add file: ./Image/boot.img
boot,Add file: ./Image/boot.img done,offset=0x474800,size=0x8000000,userspace=0x10000
Add file: ./Image/rootfs.img
rootfs,Add file: ./Image/rootfs.img done,offset=0x8474800,size=0xacb00000,userspace=0x159600
Add CRC...
Make firmware OK!
------ OK ------
********rkImageMaker ver 2.0********
Generating new image, please wait...
Writing head info...
Writing boot file...
Writing firmware...
Generating MD5 data...
MD5 data generated successfully!
New image generated successfully!
Making ./Image/update.img OK.
Running build_updateimg succeeded.
Running build_allsave succeeded.
lubancat@lubancat-vm:~/LubanCat_SDK$ 

把这个文件拷贝到window中通过工具下载既可以下载运行:

修改根文件系统重编译

这里想去掉上图钟的图案,根据研究可知这个图案是在根文件系统里面,根据如下文章的提示修改overlay/etc/update-motd.d/00-header文件的内容:

https://doc.embedfire.com/linux/rk356x/build_and_deploy/zh/latest/building_image/debian_rootfs/debian_rootfs.html#id8

修改后文件的内容如下并保存:

按照如下提示到Debian目录下输入如下命令重新编译:

bash 复制代码
#构建完整的根文件系统镜像
./mk-buster-rootfs.sh

时间很久过去才能够编译成功:

编译成功返回到上一层(SDK)按照上面的步骤输入"./build.sh"命令一键编译生成镜像:

bash 复制代码
root@lubancat-vm:/usr/lib/aarch64-linux-gnu/dri# rm -rf /home/lubancat
root@lubancat-vm:/usr/lib/aarch64-linux-gnu/dri# rm -rf /var/lib/apt/lists/*
root@lubancat-vm:/usr/lib/aarch64-linux-gnu/dri# rm -rf /var/cache/
root@lubancat-vm:/usr/lib/aarch64-linux-gnu/dri# rm -rf /packages
root@lubancat-vm:/usr/lib/aarch64-linux-gnu/dri# 
root@lubancat-vm:/usr/lib/aarch64-linux-gnu/dri# exit
Making rootfs!
Executing post-build.sh...
Adding build-info to /etc/os-release...
Fixing up /etc/fstab...
Fixing up rootfs type: auto
Adding dirs and links...
记录了0+0 的读入
记录了0+0 的写出
0字节已复制,0.0309057 s,0.0 kB/s
mke2fs 1.45.5 (07-Jan-2020)
丢弃设备块: 完成                            
创建含有 707328 个块(每块 4k)和 177056 个 inode 的文件系统
文件系统 UUID:a1e9a681-744c-4613-97b7-70cc87a5b12e
超级块的备份存储于下列块: 
	32768, 98304, 163840, 229376, 294912

正在分配组表: 完成                            
正在写入 inode表: 完成                            
创建日志(16384 个块): 完成
将文件复制到设备: 完成
写入超级块和文件系统账户统计信息: 已完成

Rootfs Image: linaro-xfce-rootfs.img
lubancat@lubancat-vm:~/LubanCat_SDK/debian$ 
lubancat@lubancat-vm:~/LubanCat_SDK/debian$ 

接下来又是漫长的等待后拷贝镜像到window后下载运行登录可以看到界面如下:

bash 复制代码
Running build_firmware succeeded.
Make update.img
start to make update.img...
Android Firmware Package Tool v2.0
------ PACKAGE ------
Add file: ./package-file
package-file,Add file: ./package-file done,offset=0x800,size=0xa0,userspace=0x1
Add file: ./Image/MiniLoaderAll.bin
bootloader,Add file: ./Image/MiniLoaderAll.bin done,offset=0x1000,size=0x729c0,userspace=0xe6
Add file: ./Image/parameter.txt
parameter,Add file: ./Image/parameter.txt done,offset=0x74000,size=0x168,userspace=0x1
Add file: ./Image/uboot.img
uboot,Add file: ./Image/uboot.img done,offset=0x74800,size=0x400000,userspace=0x800
Add file: ./Image/boot.img
boot,Add file: ./Image/boot.img done,offset=0x474800,size=0x8000000,userspace=0x10000
Add file: ./Image/rootfs.img
rootfs,Add file: ./Image/rootfs.img done,offset=0x8474800,size=0xacb00000,userspace=0x159600
Add CRC...
Make firmware OK!
------ OK ------
********rkImageMaker ver 2.0********
Generating new image, please wait...
Writing head info...
Writing boot file...
Writing firmware...
Generating MD5 data...
MD5 data generated successfully!
New image generated successfully!
Making ./Image/update.img OK.
Running build_updateimg succeeded.
Running build_allsave succeeded.
lubancat@lubancat-vm:~/LubanCat_SDK$ 

可以看到确实按照自己的想法运行了,说明整套修改和编译是正常的!

相关推荐
CYRUS_STUDIO1 天前
用 Frida 控制 Android 线程:kill 命令、挂起与恢复全解析
android·linux·逆向
熊猫李1 天前
rootfs-根文件系统详解
linux
dessler1 天前
Hadoop HDFS-高可用集群部署
linux·运维·hdfs
泽泽爱旅行1 天前
awk 语法解析-前端学习
linux·前端
轻松Ai享生活2 天前
5 节课深入学习Linux Cgroups
linux
christine-rr2 天前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神5552 天前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆2 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
乌萨奇也要立志学C++2 天前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
獭.獭.2 天前
Linux -- 信号【上】
linux·运维·服务器