YY3568编译ubuntu源码详细步骤(新手友好)
yy3568官方提供的参考文档有很多问题,大量内容抄自Rockchip RK3588 - Rockchip Linux SDK编译的内容(后来发现这个文章实际上很多内容又copy来自RockChip官方的开发手册),天下文章一大抄,抄没有错,但是抄的时候东放一点、西放一点,导致SDK的使用背景、步骤介绍和模块要点不介绍,一些技术名词在文档中突然出现,让新手根本就不知道这个工具是干什么用的,还要根据代码或命令去猜测,这就是大错误了!,而原文则没有这种情况;再就是官方提供了多种编译ubuntu的方案,比如这处内容ubuntu,还有这处内容编译Ubuntu源码,提供的SDK下载的链接也不同,不知道哪个是对的,而且又都不完整,新手只能一个个试;其次是yy3568官方文档的作者似乎没有真的在对应的ubuntu 22.04环境下编译过,所以一些提前需要安装的package没有出现,比如bsdmainutils,这个不安装编译就会出现mk-recovery.sh - build_hook failed!错误,但这个package文档没有提到;最后,很多细节参数没有提供,比如整体编译至少需要80G的空间、编译环境需要ubuntu X64而不能是ARM64,我多次因为编译时占满了空间而被迫重装虚拟机。所以我重写一个新手如何从头编译ubuntu并烧录镜像的文档,希望能降低YY3568的使用门槛。编译环境[*]可以使用windows 安装ubuntu 22.04虚拟机作为源码编译环境,注意本方案使用ubuntu 22.04 LTS,其它版本很可能出问题
[*]编译环境必须是x86_64架构,
[*]编译环境用于SDK的挂载空间必须80G以上
1. 编译SDK
[*]下载ubuntu源吗,链接地址。解压源码# 准备环境
sudo apt-get install -y repo git ssh make gcc libssl-dev liblz4-tool expect g++ patchelf chrpath gawk texinfo chrpath \
diffstat binfmt-support qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib unzip \
device-tree-compiler python-pip libncurses-dev bsdmainutils python2
root@3568:~/yy3568/sdk#sudo ln -s /usr/bin/python3.10 /usr/bin/python
root@3568:~/yy3568/sdk# python --version
Python 3.10.12
mkdir yy3568
cd yy3568
root@privatehub:~/yy3568# ll
total 15021264
drwxr-xr-x 4 root root 4096 Nov 13 15:17 ./
drwx------ 9 root root 4096 Nov 13 14:55 ../
-rw-r--r-- 1 root root 4294967296 Nov 12 15:49 yy3568_linux_release_v1.1_20241014_sdk.tar.gz00
-rw-r--r-- 1 root root 4294967296 Nov 12 15:52 yy3568_linux_release_v1.1_20241014_sdk.tar.gz01
-rw-r--r-- 1 root root 4294967296 Nov 12 15:53 yy3568_linux_release_v1.1_20241014_sdk.tar.gz02
-rw-r--r-- 1 root root 2496838384 Nov 12 15:42 yy3568_linux_release_v1.1_20241014_sdk.tar.gz03
cat yy3568_linux_release_v1.1_20241014_sdk.tar.gz0* | tar -xzvf -
# 配置git并下载代码
git config --global --add safe.directory /root/yy3568/sdk/.repo/manifests
# 我这里能成功可能因为我的路由器有透明代理,这个技术就说了,懂的都懂
.repo/repo/repo sync -l
compile ubuntu source先选择配置文件./build.sh lunch
#选择第10个yy3568-ubuntu_defconfig
10可以使用help参数查看root@ubuntu:~/yy3568# ./build.sh help
Log saved at /root/yy3568/output/log/2024-11-27_01-27-04Usage: build.sh
Available options:
chip[:<chip>[:<config>]] choose chip
defconfig[:<config>] choose defconfig
*_defconfig switch to specified defconfig
available defconfigs:
rockchip_defconfig
rockchip_rk3566_evb2_lp4x_v10_32bit_defconfig
rockchip_rk3566_evb2_lp4x_v10_defconfig
rockchip_rk3568_evb1_ddr4_v10_32bit_defconfig
rockchip_rk3568_evb1_ddr4_v10_defconfig
rockchip_rk3568_uvc_evb1_ddr4_v10_defconfig
yy3568-debian11-docker_defconfig
yy3568-debian11_defconfig
yy3568-ubuntu-docker_defconfig
yy3568-ubuntu_defconfig
olddefconfig resolve any unresolved symbols in .config
savedefconfig save current config to defconfig
menuconfig interactive curses-based configurator
config modify SDK defconfig
print-parts print partitions
mod-parts interactive partition table modify
edit-parts edit raw partitions
new-parts:<offset>:<name>:<size>... re-create partitions
insert-part:<idx>:<name>[:<size>] insert partition
del-part:(<idx>|<name>) delete partition
move-part:(<idx>|<name>):<idx> move partition
rename-part:(<idx>|<name>):<name> rename partition
resize-part:(<idx>|<name>):<size> resize partition
kernel[:cmds] build kernel
modules[:cmds] build kernel modules
linux-headers[:cmds] build linux-headers
kernel-config[:cmds] modify kernel defconfig
wifibt[:<dst dir>[:<chip>[:<tty>]]] build Wifi/BT
buildroot-config[:<config>] modify buildroot defconfig
buildroot-make[:<arg1>:<arg2>] run buildroot make
rootfs[:<rootfs type>] build default rootfs
buildroot build buildroot rootfs
yocto build yocto rootfs
debian build debian rootfs
ubuntu build ubuntu rootfs
recovery build recovery
pcba build PCBA
security_check check contidions for security boot
createkeys build security boot keys
security_ramboot build security ramboot
security_uboot build uboot with security
security_boot build boot with security
security_recovery build recovery with security
security_rootfs build rootfs with security
loader[:cmds] build loader (uboot|spl)
uboot[:cmds] build u-boot
spl[:cmds] build spl
uefi[:cmds] build uefi
firmware pack and check firmwares
updateimg build update image
otapackage build OTA update image
sdpackage build SDcard update image
all build all images
save save images and build info
allsave build all images and save them
cleanup
post-rootfs <rootfs dir> trigger post-rootfs hook scripts
shell setup a shell for developing
help usageDefault option is 'allsave'.
# 开始编译,默认参数是allsave,进入漫长的等待
./build.sh
# 最后出现下面的内容说明编译成功完成
==========================================
Start packingupdate image
==========================================
Generating package-file for update :
# NAMEPATH
package-file package-file
parameter parameter.txt
bootloader MiniLoaderAll.bin
uboot uboot.img
misc misc.img
boot boot.img
recovery recovery.img
backupRESERVED
userdata userdata.img
oem oem.img
rootfsrootfs.img
Packing /root/yy3568/output/firmware/update.img for update... # 这就是我们下一步要烧录进入开发板的镜像文件
Android Firmware Package Tool v2.2
------ PACKAGE ------
Add file: ./package-file
package-file,Add file: ./package-file done,offset=0x800,size=0xe1,userspace=0x1
Add file: ./parameter.txt
parameter,Add file: ./parameter.txt done,offset=0x1000,size=0x1f4,userspace=0x1,flash_address=0x00000000
Add file: ./MiniLoaderAll.bin
bootloader,Add file: ./MiniLoaderAll.bin done,offset=0x1800,size=0x719c0,userspace=0xe4
Add file: ./uboot.img
uboot,Add file: ./uboot.img done,offset=0x73800,size=0x400000,userspace=0x800,flash_address=0x00004000
Add file: ./misc.img
misc,Add file: ./misc.img done,offset=0x473800,size=0xc000,userspace=0x18,flash_address=0x00006000
Add file: ./boot.img
boot,Add file: ./boot.img done,offset=0x47f800,size=0x2908600,userspace=0x5211,flash_address=0x00008000
Add file: ./recovery.img
recovery,Add file: ./recovery.img done,offset=0x2d88000,size=0x30ce800,userspace=0x619d,flash_address=0x00028000
Add file: ./userdata.img
userdata,Add file: ./userdata.img done,offset=0x5e56800,size=0x444000,userspace=0x888,flash_address=0x00058000
Add file: ./oem.img
oem,Add file: ./oem.img done,offset=0x629a800,size=0x35fd000,userspace=0x6bfa,flash_address=0x00068000
Add file: ./rootfs.img
rootfs,Add file: ./rootfs.img done,offset=0x9897800,size=0x1f4000000,userspace=0x3e8000,flash_address=0x000a8000
Add CRC...
Make firmware OK!
------ OK ------
********rkImageMaker ver 2.23********
Generating new image, please wait...
Writing head info...
Writing boot file...
Writing firmware...
Generating MD5 data...
MD5 data generated successfully!
New image generated successfully!
页:
[1]