This tutorial is suitable for compiling Ubuntu 20.04 firmware for YY3568 development boards. We are here based on rockchip's latest linux sdk, which kernel version is 5.10, making ubuntu-20.04 firmware for YY3568 board step by step. We uses ubuntu 22.04 x86_64 as host compilation environment here.
$ export YY_UBUNTU_DL_URL=https://mirrors.bfsu.edu.cn/ubuntu-cdimage/ubuntu-base/releases
$ wget ${YY_UBUNTU_DL_URL}/20.04.5/release/ubuntu-base-20.04.5-base-arm64.tar.gz
$ sudo rm -rf ubuntu-20.04-rootfs && mkdir ubuntu-20.04-rootfs
$ sudo tar -xf ubuntu-base-20.04.5-base-arm64.tar.gz -C ubuntu-20.04-rootfs/
$ export YY_UBUNTU_TARGET_DIR=${PWD}/ubuntu-20.04-rootfs
$ sudo mount -t proc proc ${YY_UBUNTU_TARGET_DIR}/proc
$ sudo mount -t sysfs sysfs ${YY_UBUNTU_TARGET_DIR}/sys
$ sudo mount -o bind /dev ${YY_UBUNTU_TARGET_DIR}/dev
$ sudo mount -o bind /dev/pts ${YY_UBUNTU_TARGET_DIR}/dev/pts
$ sudo cp -v /etc/resolv.conf ${YY_UBUNTU_TARGET_DIR}/etc/resolv.conf
$ echo "nameserver 8.8.8.8" | sudo tee -a ${YY_UBUNTU_TARGET_DIR}/etc/resolv.conf
$ echo "nameserver 114.114.114.114" |sudo tee -a ${YY_UBUNTU_TARGET_DIR}/etc/resolv.conf
$ sudo chroot ${YY_UBUNTU_TARGET_DIR}
# apt update -y
# apt upgrade -y
# useradd -s '/bin/bash' -r -m -G adm,sudo,plugdev,lpadmin youyeetoo
# passwd youyeetoo # set user password
# passwd # set root password (optional)
# apt install -y sudo net-tools systemd udhcpc
# apt install lxqt-* lxqt # install desktop
# rm -rf /var/lib/apt/lists/*
# rm -rf /var/cache/*
# exit
After finishing customizaton, we need to umount proc, sysfs, tmpdevfs and pts
$ export YY_UBUNTU_TARGET_DIR=${PWD}/ubuntu-20.04-rootfs
$ sudo umount ${YY_UBUNTU_TARGET_DIR}/dev/pts
$ sudo umount ${YY_UBUNTU_TARGET_DIR}/dev
$ sudo umount ${YY_UBUNTU_TARGET_DIR}/sys
$ sudo umount ${YY_UBUNTU_TARGET_DIR}/proc
Finally, we create the rootfs image with following commands
$ export YY_UBUNTU_TARGET_DIR=${PWD}/ubuntu-20.04-rootfs
$ IMAGE_SIZE_MB=$(( $(sudo du -sh -m ${YY_UBUNTU_TARGET_DIR} | cut -f1) + 500 ))
$ ROOTFSIMAGE=ubuntu-rootfs-${YY_UBUNTU_VER}.ext4
$ echo "Gen rootfs image, size=${IMAGE_SIZE_MB}MB"
$ dd if=/dev/zero of=${ROOTFSIMAGE} bs=1M count=0 seek=${IMAGE_SIZE_MB}
$ sudo mkfs.ext4 -d ${YY_UBUNTU_TARGET_DIR} ${ROOTFSIMAGE}
Official Download:
http://dd.youyeetoo.cn:5000/sharing/2bkwX9vRn
Google Download: https://drive.google.com/drive/folders/1hc9Pba-3YFhbOi8uFTaKcUUW-OI8MbAM?usp=drive_link
$ mkdir yy3568
$ cd yy3568
$ tar -xf ../yy3568-ubuntu-linux-sdk-230821.tar.gz
$ cd sdk
$ git checkout HEAD .
$ export YY_SDK_ROOT=${PWD} # Optional
sudo apt-get update && sudo apt-get install git ssh make gcc libssl-dev \
liblz4-tool expect expect-dev 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 ncurses-dev \
libgucharmap-2-90-dev bzip2 expat gpgv2 cpp-aarch64-linux-gnu
Copy the ubuntu-rootfs-20.04.ext4 images we've created before to the directory ubuntu
of the SDK.
$ cd $YY_SDK_ROOT
$ ./build.sh rk3568-yy3568_defconfig
$ ./build.sh
After successful compilation, we will get the firmware under the output/RK3568-YY3568/latest/IMAGES/
directory
$ upgrade_tool uf output/RK3568-YY3568/latest/IMAGES/update.img
If we just want to upgrade rootfs images, we could use the following commands
$ cd $YY_SDK_ROOT
$ upgrade_tool ul output/firmware/MiniLoaderAll.bin
$ upgrade_tool di -p output/firmware/parameter.txt
$ upgrade_tool di -rootfs output/firmware/rootfs.img # replace your real rootfs image
$ upgrade_tool rd