全志R528代码编译和烧录以及测试

代表编译

代码存在如下目录中:/home/workspace/tina-r528-v1.2

这里输入如下指令进行编译:

bash 复制代码
su root
source build/envsetup.sh
lunch r528_evb2-tina
make & pack
bash 复制代码
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# source build/envsetup.sh
Setup env done! Please run lunch next.
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# lunch r528_evb2-tina
============================================
TINA_BUILD_TOP=/home/workspace/tina-r528-v1.2
TINA_TARGET_ARCH=arm
TARGET_PRODUCT=r528_evb2
TARGET_PLATFORM=r528
TARGET_BOARD=r528-evb2
TARGET_PLAN=evb2
TARGET_BUILD_VARIANT=tina
TARGET_BUILD_TYPE=release
TARGET_KERNEL_VERSION=5.4
TARGET_UBOOT=u-boot-2018
TARGET_CHIP=sun8iw20p1
============================================
no buildserver to clean
[1] 59144
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# 

开始编译显示如下log:

bash 复制代码
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# make & pack
[2] 59147
===This's tina environment.===
find: '/home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl': No such file or directory
r528_evb2 r528 r528-evb2
build_boot platform:sun8iw20p1 o_option:spl-pub
grep: /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl/Makefile: No such file or directory
Prepare toolchain ...
--------build for mode:all board:r528-------------------
platform set to sun8iw20p1
make -C /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/fes fes
  CHK     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/include/config.h
  CHK     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/autoconf.mk
  UPD     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/include/config.h
  UPD     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/autoconf.mk
--==========--
PACK_CHIP         sun8iw20p1
PACK_PLATFORM     tina
PACK_BOARD        r528-evb2
PACK_KERN        
PACK_DEBUG        uart0
PACK_SIG          none
PACK_SECURE       none
PACK_MODE         normal
PACK_FUNC         android
PACK_PROGRAMMER   none
PACK_TAR_IMAGE    none
PACK_TOPDIR       /home/workspace/tina-r528-v1.2
--==========--

编译完成后log如下:

bash 复制代码
Number of fragments 90
Number of symbolic links  266
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 119
Number of ids (unique uids + gids) 1
Number of uids 1
	root (0)
Number of gids 1
	root (0)
rm -f /home/workspace/tina-r528-v1.2/out/r528-evb2/rootfs.img
rm -f /home/workspace/tina-r528-v1.2/out/r528-evb2/usr.img
dd if=/home/workspace/tina-r528-v1.2/out/r528-evb2/compile_dir/target/linux-r528-evb2/root.squashfs of=/home/workspace/tina-r528-v1.2/out/r528-evb2/rootfs.img bs=128k conv=sync
112+1 records in
113+0 records out
14811136 bytes (15 MB, 14 MiB) copied, 0.0124715 s, 1.2 GB/s
( cd /home/workspace/tina-r528-v1.2/out/r528-evb2 ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs md5sum --binary > md5sums )
( cd /home/workspace/tina-r528-v1.2/out/r528-evb2 ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs openssl dgst -sha256 > sha256sums )
make[5]: Leaving directory '/home/workspace/tina-r528-v1.2/target/allwinner/generic/image'
make[4]: Leaving directory '/home/workspace/tina-r528-v1.2/target/allwinner/r528-evb2'
make[3]: Leaving directory '/home/workspace/tina-r528-v1.2/target/allwinner'
make[2]: Leaving directory '/home/workspace/tina-r528-v1.2'
export MAKEFLAGS= ;make -w -r package/index
make[2]: Entering directory '/home/workspace/tina-r528-v1.2'
Generating package index...
Signing key has not been configured
make[2]: Leaving directory '/home/workspace/tina-r528-v1.2'
make[1]: Leaving directory '/home/workspace/tina-r528-v1.2'

#### make completed successfully (02:42 (mm:ss)) ####


[2]+  Done                    make
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# 

编译完成后如果没有意外将会在out的如下目录生成一个"tina_r528-evb2_uart0.img"的镜像

固件烧录

这里打开烧录工具PhoenixSuit,切换到一键烧录界面加在好镜像,

板子再未上单状态短路flash的1和2管脚:

给板子上电然后就断开flash的1和2管脚:

烧录完成后代码就会正常运行

测试

这里使用如下命令看log:

bash 复制代码
adb shell进去
然后dmesg

这里想修改一下启动的log,比如这里想把上面的感叹号改为一个字母:

bash 复制代码
"Tina is Based on OpenWrt!"  改为"Tina is Based on OpenWrtX"

输入如下命令看看这个字符串都在哪里出现:

bash 复制代码
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# grep -rl "Tina is Based on OpenWrt" ./
 
./package/busybox-init-base-files/busybox-init-base-files_ramfs/etc/banner
./package/busybox-init-base-files/files/etc/banner
./package/base-files/files/etc/banner
./out/r528-evb2/compile_dir/target/rootfs-tmp/etc/banner
./out/r528-evb2/compile_dir/target/rootfs/etc/banner
./out/r528-evb2/compile_dir/target/linux-r528-evb2/base-files/ipkg-sunxi/base-files/etc/banner
./out/r528-evb2/staging_dir/target/rootfs/etc/banner

这里可以确定基本就是"package/"目录下的内容决定的,"out/r528-evb2/"下面的内容是编译出来的结果,如下如下方式修改:

bash 复制代码
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# cat ./package/busybox-init-base-files/busybox-init-base-files_ramfs/etc/banner
 _____  _              __     _
|_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
  | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
  | |  | || | || _ |  |_____||_||_|_||___||_,_|
  |_|  |_||_|_||_|_|  Tina is Based on OpenWrtC
 ----------------------------------------------
 Tina Linux (%C, %R)
 ----------------------------------------------
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# cat ./package/busybox-init-base-files/files/etc/banner
 _____  _              __     _
|_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
  | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
  | |  | || | || _ |  |_____||_||_|_||___||_,_|
  |_|  |_||_|_||_|_|  Tina is Based on OpenWrtD
 ----------------------------------------------
 Tina Linux (%C, %R)
 ----------------------------------------------
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# cat ./package/base-files/files/etc/banner
 _____  _              __     _
|_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
  | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
  | |  | || | || _ |  |_____||_||_|_||___||_,_|
  |_|  |_||_|_||_|_|  Tina is Based on OpenWrtE
 ----------------------------------------------
 Tina Linux (%C, %R)
 ----------------------------------------------
root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# 

编译好代码后从新运行可以看到log如下:

bash 复制代码
PS E:\Documentation\Desktop\20221010> adb shell


BusyBox v1.27.2 () built-in shell (ash)

 _____  _              __     _
|_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
  | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
  | |  | || | || _ |  |_____||_||_|_||___||_,_|
  |_|  |_||_|_||_|_|  Tina is Based on OpenWrtE
 ----------------------------------------------
 Tina Linux (Neptune, 6191F77D)
 ----------------------------------------------

有此可见决定输出的log的是"package/base-files/files/etc/banner"文件

注意编译的时候要把"out/r528-evb2/compile_dir/target/"目录删除掉,否则不会覆盖的

本文生成的镜像从如下地址下载:https://download.csdn.net/download/chengdong1314/88477701

相关推荐
城东1 年前
linux鲁班猫代码初尝试[编译镜像][修改根文件系统重编译]
linux·lubancat·代码编译·根文件系统