diff --git a/README.md b/README.md index d9ad23e3..4f4202a2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,38 @@ # phytium-linux-buildroot Buildroot是一种简单、高效且易于使用的工具,可以通过交叉编译生成嵌入式Linux系统。Buildroot的用户手册位于docs/manual/manual.pdf。 -phytium-linux-buildroot基于Buildroot,适配了飞腾e2000开发板,支持ubuntu文件系统、debian文件系统、initrd文件系统、buildroot最小文件系统的编译。 +phytium-linux-buildroot基于Buildroot,适配了飞腾e2000、d2000开发板,支持ubuntu文件系统、debian文件系统、initrd文件系统、buildroot最小文件系统的编译。 # 开发环境 ## 系统要求 -Buildroot被设计为在Linux系统上运行,我们在ubuntu20.04系统上运行phytium-linux-buildroot。 -需要安装如下软件包: -`$ sudo apt-get install debootstrap qemu-system-common qemu-user-static binfmt-support debian-archive-keyring` +Buildroot被设计为在Linux系统上运行,我们只支持在ubuntu20.04、ubuntu22.04、debian11这三种主机系统上运行phytium-linux-buildroot,不支持其他系统。 +首先,Buildroot需要主机系统上安装如下Linux程序,请检查是否已安装: +``` +• Build tools: +– which +– sed +– make (version 3.81 or any later) +– binutils +– build-essential (only for Debian based systems) +– gcc (version 4.8 or any later) +– g++ (version 4.8 or any later) +– bash +– patch +– gzip +– bzip2 +– perl (version 5.8.7 or any later) +– tar +– cpio +– unzip +– rsync +– file (must be in /usr/bin/file) +– bc +• Source fetching tools: +– wget +– git +``` +除此之外,还需要安装如下软件包: +`$ sudo apt install debootstrap qemu-user-static binfmt-support debian-archive-keyring` +对于debian11系统,需要设置PATH环境变量:`PATH=$PATH:/usr/sbin` ## 下载phytium-linux-buildroot `$ git clone https://gitee.com/phytium_embedded/phytium-linux-buildroot.git` @@ -68,18 +94,26 @@ configs/phytium_e2000_linux_5.10_rt.config (3)镜像的输出位置 生成的根文件系统、内核位于output/images目录。 -### 支持Pythium-optee -本项目还支持编译Pythium-optee,关于Pythium-optee的信息请参考:`https://gitee.com/phytium_embedded/phytium-optee` -defconfig默认不编译Pythium-optee,如果需要编译Pythium-optee请执行: +### 支持Phytium-optee +本项目还支持编译Phytium-optee,关于Phytium-optee的信息请参考:`https://gitee.com/phytium_embedded/phytium-optee` +defconfig默认不编译Phytium-optee,如果需要编译Phytium-optee请执行: (1)使用phytium_e2000_xxx_defconfig作为基础配置项,合并支持optee的配置: `$ ./support/kconfig/merge_config.sh configs/phytium_e2000_xxx_defconfig configs/phytium_e2000_optee.config` -目前Pythium-optee支持的开发板有e2000d demo、e2000q demo,默认配置为e2000d demo。如果需要更改,请将 +目前Phytium-optee支持的开发板有e2000d demo、e2000q demo,默认配置为e2000d demo。如果需要更改,请将 `configs/phytium_e2000_optee.config`中`BR2_PACKAGE_PHYTIUM_OPTEE_BOARD`变量的值修改为`"e2000qdemo"`。 +注意:phytium-linux-buildroot的最新代码已包含了Phytium-optee的依赖,如果您使用的phytium-linux-buildroot不是最新版本, +在执行编译之前需要额外安装依赖: +``` +sudo apt install python3-pip +pip install pycryptodome +pip install pyelftools +pip install cryptography +``` (2)编译 `$ make` (3)镜像的输出位置 生成的根文件系统、内核、TEE OS位于output/images目录。 -后续部署及使用方法,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/optee` +后续部署及使用方法,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/optee` ## 清理编译结果 (1)`$ make clean` @@ -130,7 +164,7 @@ $ sudo mkfs.ext4 /dev/sdb1 $ sudo mkfs.ext4 /dev/sdb2 $ sudo mount /dev/sdb1 /mnt $ sudo cp xxx/phytium-linux-buildroot/output/images/Image /mnt -$ sudo cp xxx/phytium-linux-buildroot/output/images/e2000q-demo-ddr4.dtb /mnt +$ sudo cp xxx/phytium-linux-buildroot/output/images/e2000q-demo-board.dtb /mnt $ sync $ sudo umount /dev/sdb1 $ sudo mount /dev/sdb2 /mnt @@ -147,7 +181,7 @@ SATA盘: ``` =>setenv bootargs console=ttyAMA1,115200 audit=0 earlycon=pl011,0x2800d000 root=/dev/sda2 rw; =>ext4load scsi 0:1 0x90100000 Image; -=>ext4load scsi 0:1 0x90000000 e2000q-demo-ddr4.dtb; +=>ext4load scsi 0:1 0x90000000 e2000q-demo-board.dtb; =>booti 0x90100000 - 0x90000000 ``` U盘: @@ -155,7 +189,7 @@ U盘: =>setenv bootargs console=ttyAMA1,115200 audit=0 earlycon=pl011,0x2800d000 root=/dev/sda2 rootdelay=5 rw; =>usb start =>ext4load usb 0:1 0x90100000 Image; -=>ext4load usb 0:1 0x90000000 e2000q-demo-ddr4.dtb; +=>ext4load usb 0:1 0x90000000 e2000q-demo-board.dtb; =>booti 0x90100000 - 0x90000000 ``` @@ -204,12 +238,11 @@ U盘: # ubuntu系统安装桌面 ## e2000 ubuntu系统安装桌面 -`phytium_e2000_ubuntu_desktop_defconfig`默认安装了kde桌面,配置并编译它就可以获得带kde桌面的 +`phytium_e2000_ubuntu_desktop_defconfig`默认安装了xfce桌面,配置并编译它就可以获得带xfce桌面的 ubuntu系统。如果需要在开发板上安装其他桌面,重新配置并编译`phytium_e2000_ubuntu_defconfig`, 然后在开发板启动这个不带桌面的ubuntu系统: ### 登录 -ubuntu系统包含了超级用户root,和一个普通用户user,密码和用户名相同。 -如果普通用户下不能使用sudo,需要在root用户下执行`$ chmod u+s /usr/bin/sudo` +ubuntu系统包含了超级用户root,和一个普通用户user,密码和用户名相同。 ### 动态获取 IP 地址 ``` $ sudo dhclient @@ -245,9 +278,37 @@ $ make ``` # ubuntu及debian系统支持linux-headers -linux-headers用于在开发板上编译内核外部模块,buildroot将`linux-headers-$(uname -r)`安装在根文件系统的/usr/src目录下, -并为它创建了一个软链接``/lib/modules/$(uname -r)/build``。 -关于如何编译内核外部模块,可参考https://www.kernel.org/doc/html/latest/kbuild/modules.html +linux-headers包含构建内核外部模块所需的头文件,编译ubuntu和debian的defconfig会生成linux-headers。 +关于如何编译内核外部模块,可参考https://www.kernel.org/doc/html/latest/kbuild/modules.html + +## 交叉编译内核模块 +编译ubuntu和debian的defconfig,会在`output/target/usr/src`目录中安装linux-headers-version。 +使用buildroot的工具链来交叉编译内核模块,buildroot工具链位于`output/host/bin`,工具链的sysroot为 +`output/host/aarch64-buildroot-linux-gnu/sysroot`。 + +交叉编译内核外部模块的命令为: +``` +$ make ARCH=arm64 \ +CROSS_COMPILE=/home/xxx/phytium-linux-buildroot/output/host/bin/aarch64-none-linux-gnu- \ +-C /home/xxx/phytium-linux-buildroot/output/target/usr/src/linux-headers-5.10.153-phytium-embeded \ +M=$PWD \ +modules +``` + +## 开发板上编译内核模块 +buildroot将linux-headers-version安装在根文件系统的`/usr/src`目录下, +并为它创建了一个软链接`/lib/modules/version/build`。 +注意,由于linux-headers是在x86-64主机交叉编译生成的,在开发板上直接使用它编译内核模块会报错: +`/bin/sh: 1: scripts/basic/fixdep: Exec format error`。 +因此,需要将x86-64格式的fixdep等文件替换为ARM aarch64格式的(以linux 5.10内核为例): +(1)`scp -r username@host:/home/xxx/phytium-linux-buildroot/board/phytium/common/linux-5.10/scripts /usr/src/linux-headers-5.10.153-phytium-embeded` +(2)或者在编译ubuntu和debian的defconfig之前,将board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh和 +board/phytium/common/post-custom-skeleton-debian-base-11.sh中的如下两行取消注释,再执行编译。 +`# cp -r board/phytium/common/linux-5.10/scripts $destdir` +`# cp -r board/phytium/common/linux-4.19/scripts $destdir` + +在开发板上编译内核外部模块的命令为: +`make -C /lib/modules/5.10.153-phytium-embeded/build M=$PWD modules` # buildroot编译新的应用软件 本节简单介绍如何通过buildroot交叉编译能运行在开发板上的应用软件,完整的教程请参考buildroot用户手册manual.pdf。 @@ -298,3 +359,16 @@ chown -R user:user /home/user 将user用户加入audio组,可解决user用户下没声音的问题 gpasswd -a user audio ``` + +3. 下载ubuntu及debian太慢或报错? +目前下载ubuntu及debian的源为清华大学镜像,如果遇到下载很慢,或者下载报错: +`E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?` +从而导致编译的phytium_e2000_debian_desktop_defconfig或phytium_e2000_ubuntu_desktop_defconfig没有桌面问题, +请将清华源更换为中科大源,即将以下文件 +``` +board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh +board/phytium/common/ubuntu-package-installer +board/phytium/common/post-custom-skeleton-debian-base-11.sh +board/phytium/common/debian-package-installer +``` +中的`mirrors.tuna.tsinghua.edu.cn`改为`mirrors.ustc.edu.cn` diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 776e7d93..c89b7b0a 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -33,7 +33,12 @@ do_distrorfs_second_stage() { # set apt sources list to install additional packages asl=/etc/apt/sources.list rm -f $asl - echo deb http://mirrors.aliyun.com/debian/ bullseye main >> $asl + cat <<-EOF > $asl + deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free + deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free + deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free + deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free + EOF chmod +777 /tmp apt update DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C \ @@ -71,8 +76,8 @@ do_distrorfs_second_stage() { fi if [ $5 = E2000 ]; then - echo 'defaults.pcm.!card phytiume2000i2s' >> /etc/asound.conf - echo 'defaults.ctl.!card phytiume2000i2s' >> /etc/asound.conf + echo 'defaults.pcm.!card phytiumpe220xi2' >> /etc/asound.conf + echo 'defaults.ctl.!card phytiumpe220xi2' >> /etc/asound.conf fi # clean cached packages diff --git a/board/phytium/common/post-custom-skeleton-debian-base-11.sh b/board/phytium/common/post-custom-skeleton-debian-base-11.sh index 8dab7013..f51d15f7 100755 --- a/board/phytium/common/post-custom-skeleton-debian-base-11.sh +++ b/board/phytium/common/post-custom-skeleton-debian-base-11.sh @@ -228,7 +228,7 @@ deploy_kernel_headers_510 () { find $destdir -name "*.o" -type f -exec rm -rf {} \; cd $pdir cd ../.. - cp -r board/phytium/common/linux-5.10/scripts $destdir + # cp -r board/phytium/common/linux-5.10/scripts $destdir rm -rf $srctree rm -rf $objtree @@ -264,7 +264,7 @@ deploy_kernel_headers_419 () { find $destdir -name "*.o" -type f -exec rm -rf {} \; cd $pdir cd ../.. - cp -r board/phytium/common/linux-4.19/scripts $destdir + # cp -r board/phytium/common/linux-4.19/scripts $destdir rm -rf "$objtree/debian" rm -rf $srctree diff --git a/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh b/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh index c1ec1bfb..6357e89e 100755 --- a/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh +++ b/board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh @@ -230,7 +230,7 @@ deploy_kernel_headers_510 () { find $destdir -name "*.o" -type f -exec rm -rf {} \; cd $pdir cd ../.. - cp -r board/phytium/common/linux-5.10/scripts $destdir + # cp -r board/phytium/common/linux-5.10/scripts $destdir rm -rf $srctree rm -rf $objtree @@ -266,7 +266,7 @@ deploy_kernel_headers_419 () { find $destdir -name "*.o" -type f -exec rm -rf {} \; cd $pdir cd ../.. - cp -r board/phytium/common/linux-4.19/scripts $destdir + # cp -r board/phytium/common/linux-4.19/scripts $destdir rm -rf "$objtree/debian" rm -rf $srctree diff --git a/board/phytium/common/ubuntu-package-installer b/board/phytium/common/ubuntu-package-installer index da087b23..7b21e8e8 100755 --- a/board/phytium/common/ubuntu-package-installer +++ b/board/phytium/common/ubuntu-package-installer @@ -34,7 +34,12 @@ do_distrorfs_second_stage() { # set apt sources list to install additional packages asl=/etc/apt/sources.list rm -f $asl - echo deb http://mirrors.163.com/ubuntu-ports/ focal main restricted universe multiverse >> $asl + cat <<-EOF > $asl + deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse + deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse + deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse + deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse + EOF chmod +777 /tmp DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C \ apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update || exit 1 @@ -54,7 +59,7 @@ do_distrorfs_second_stage() { echo installed additional packages. if [ $6 = desktop ]; then - for pkg in xfce4 slick-greeter; do + for pkg in xfce4 slick-greeter firefox; do DEBIAN_FRONTEND=noninteractive apt -y install $pkg || true done if [ $5 = D2000 ]; then @@ -71,15 +76,15 @@ do_distrorfs_second_stage() { usermod -a -G video,render,audio user ln -sf /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service - sed -i "s/gdm3/lightdm/" /etc/X11/default-display-manager + sed -i "s/gdm3/lightdm/" /etc/X11/default-display-manager echo '[SeatDefaults]' >> /etc/lightdm/lightdm.conf echo 'greeter-session=slick-greeter' >> /etc/lightdm/lightdm.conf echo 'user-session=xfce' >> /etc/lightdm/lightdm.conf fi if [ $5 = E2000 ]; then - echo 'defaults.pcm.!card phytiume2000i2s' >> /etc/asound.conf - echo 'defaults.ctl.!card phytiume2000i2s' >> /etc/asound.conf + echo 'defaults.pcm.!card phytiumpe220xi2' >> /etc/asound.conf + echo 'defaults.ctl.!card phytiumpe220xi2' >> /etc/asound.conf fi # clean cached packages apt-get clean diff --git a/board/phytium/common/ubuntu_overlay/etc/asound.conf b/board/phytium/common/ubuntu_overlay/etc/asound.conf index 977ceac2..9e581bea 100644 --- a/board/phytium/common/ubuntu_overlay/etc/asound.conf +++ b/board/phytium/common/ubuntu_overlay/etc/asound.conf @@ -1,2 +1,2 @@ -defaults.pcm.!card phytiume2000i2s -defaults.ctl.!card phytiume2000i2s +defaults.pcm.!card phytiumpe220xi2 +defaults.ctl.!card phytiumpe220xi2 diff --git a/board/phytium/genimage-e2000.cfg b/board/phytium/genimage-e2000.cfg index e426069a..7544758c 100644 --- a/board/phytium/genimage-e2000.cfg +++ b/board/phytium/genimage-e2000.cfg @@ -6,8 +6,17 @@ image efi-part.vfat { file Image { image = "Image" } - file e2000q-demo-board.dtb { - image = "e2000q-demo-board.dtb" + files = { + "e2000d-demo-board.dtb", + "e2000d-miniitx-board.dtb", + "e2000d-power-board.dtb", + "e2000q-come-board.dtb", + "e2000q-demo-board.dtb", + "e2000q-edu-board.dtb", + "e2000q-hanwei-board.dtb", + "e2000q-miniitx-board.dtb", + "e2000q-vpx-board.dtb", + "e2000s-demo-board.dtb" } } diff --git a/change-phytium b/change-phytium new file mode 100644 index 00000000..93fd0b6e --- /dev/null +++ b/change-phytium @@ -0,0 +1,26 @@ +2023.03.09 changed by Phytium team + We made some changes to buildroot to make it easier for Phytium users to build the system. + We added several defconfig files to the configs directory so that users can build busybox, ubuntu, and debian systems for the Phytium D2000 and E2000 development boards. + In order to support ubuntu and debian, we modified some skeleton-custom related files and created the board/phytium directory. + We made some changes in the linux directory to support linux-headers, which is used to compile kernel external modules. + We modified or added these packages in the package directory: busybox, ffmpeg, igh-ethercat, phytium-optee, rootfs-chown, vpu-lib, xorg-rogue-umlibs. + The external toolchain Arm AArch64 was downgraded from 2021.07 to 2020.11 in order to align the glibc version with the one in ubuntu20.04. + + Here are the directories or files involved in these changes: + Makefile + README.md + board/phytium + configs/phytium_xxx + fs/ext2 + linux + package/Config.in + package/busybox + package/ffmpeg + package/igh-ethercat + package/phytium-optee + package/rootfs-chown + package/skeleton-custom + package/vpu-lib + package/xorg-rogue-umlibs + system/Config.in + toolchain/toolchain-external diff --git a/configs/phytium_e2000_debian_defconfig b/configs/phytium_e2000_debian_defconfig index d1af518d..ac9f8777 100644 --- a/configs/phytium_e2000_debian_defconfig +++ b/configs/phytium_e2000_debian_defconfig @@ -36,7 +36,7 @@ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" # kernel 5.10 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_2023-v1.0-RC1" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="e2000" diff --git a/configs/phytium_e2000_debian_desktop_defconfig b/configs/phytium_e2000_debian_desktop_defconfig index 6e2b5189..0e08366a 100644 --- a/configs/phytium_e2000_debian_desktop_defconfig +++ b/configs/phytium_e2000_debian_desktop_defconfig @@ -36,7 +36,7 @@ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" # kernel 5.10 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_2023-v1.0-RC1" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="e2000" diff --git a/configs/phytium_e2000_defconfig b/configs/phytium_e2000_defconfig index db9274c9..73716beb 100644 --- a/configs/phytium_e2000_defconfig +++ b/configs/phytium_e2000_defconfig @@ -1,45 +1,69 @@ +# Architecture BR2_aarch64=y + +# Toolchain BR2_TOOLCHAIN_EXTERNAL=y + +# Hostname and issue BR2_TARGET_GENERIC_HOSTNAME="E2000" BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium Buildroot" + +# system configuration BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_SYSTEM_BIN_SH_BASH=y BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA1" BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y BR2_ROOTFS_OVERLAY="board/phytium/common/busybox_init_overlay" + +# Filesystem +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="200M" + +# Bootloader +BR2_TARGET_GRUB2=y + +# required tools to create the microSD image +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y + +# Kernel BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" # kernel 5.10 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_2023-v1.0-RC1" BR2_LINUX_KERNEL_DEFCONFIG="e2000" BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board" BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +# Target packages BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y +BR2_PACKAGE_GZIP=y +BR2_PACKAGE_GDB=y BR2_PACKAGE_NETPERF=y BR2_PACKAGE_RT_TESTS=y +BR2_PACKAGE_STRACE=y +BR2_PACKAGE_GREP=y +BR2_PACKAGE_CIFS_UTILS=y BR2_PACKAGE_E2FSPROGS=y BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y BR2_PACKAGE_MTD=y BR2_PACKAGE_I2C_TOOLS=y +BR2_PACKAGE_PCIUTILS=y BR2_PACKAGE_SYSSTAT=y BR2_PACKAGE_FLICKCURL=y BR2_PACKAGE_FLICKCURL_UTILS=y BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_LIBCURL_VERBOSE=y -BR2_PACKAGE_NSS_MDNS=y -BR2_PACKAGE_OPEN62541=y BR2_PACKAGE_COLLECTD=y BR2_PACKAGE_COLLECTD_CURL=y BR2_PACKAGE_COLLECTD_CURL_JSON=y BR2_PACKAGE_COLLECTD_CURL_XML=y -BR2_PACKAGE_HAVEGED=y -BR2_PACKAGE_AVAHI=y -BR2_PACKAGE_AVAHI_DAEMON=y -BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y BR2_PACKAGE_DHCPCD=y BR2_PACKAGE_ETHTOOL=y BR2_PACKAGE_IPERF=y @@ -49,15 +73,9 @@ BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_TCPDUMP=y BR2_PACKAGE_WGET=y BR2_PACKAGE_WIRELESS_REGDB=y +BR2_PACKAGE_PROCPS_NG=y BR2_PACKAGE_NANO=y BR2_PACKAGE_VIM=y -BR2_TARGET_ROOTFS_EXT2=y -BR2_TARGET_ROOTFS_EXT2_4=y -BR2_TARGET_ROOTFS_EXT2_SIZE="200M" -BR2_TARGET_GRUB2=y -BR2_PACKAGE_HOST_DOSFSTOOLS=y -BR2_PACKAGE_HOST_GENIMAGE=y -BR2_PACKAGE_HOST_MTOOLS=y +# Vpu-lib BR2_PACKAGE_VPU_LIB=y BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000" -BR2_PACKAGE_IGH_ETHERCAT=y diff --git a/configs/phytium_e2000_linux_4.19.config b/configs/phytium_e2000_linux_4.19.config index bb0a8734..32ba6103 100644 --- a/configs/phytium_e2000_linux_4.19.config +++ b/configs/phytium_e2000_linux_4.19.config @@ -1,2 +1,2 @@ # kernel 4.19 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="a47ede16e33d2662535084f49e73945d572d4f38" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_4.19_2023-v1.0-RC1" diff --git a/configs/phytium_e2000_linux_4.19_rt.config b/configs/phytium_e2000_linux_4.19_rt.config index 217e290e..9f353d17 100644 --- a/configs/phytium_e2000_linux_4.19_rt.config +++ b/configs/phytium_e2000_linux_4.19_rt.config @@ -1,2 +1,2 @@ # kernel 4.19-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="b8dd7858666953b815bc8995db4fb5a66eeee26f" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_4.19-rt_2023-v1.0-RC1" diff --git a/configs/phytium_e2000_linux_5.10_rt.config b/configs/phytium_e2000_linux_5.10_rt.config index 0cbba0a8..1bb4e162 100644 --- a/configs/phytium_e2000_linux_5.10_rt.config +++ b/configs/phytium_e2000_linux_5.10_rt.config @@ -1,2 +1,2 @@ # kernel 5.10-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="471368800513cac109cf6d520510af9d1374f5e0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10-rt_2023-v1.0-RC1" diff --git a/configs/phytium_e2000_optee.config b/configs/phytium_e2000_optee.config index 53892088..1811080a 100644 --- a/configs/phytium_e2000_optee.config +++ b/configs/phytium_e2000_optee.config @@ -3,6 +3,6 @@ BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/e2000_op BR2_PACKAGE_PHYTIUM_OPTEE=y -BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_URL="git@gitee.com:phytium_embedded/phytium-optee.git" -BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="735e1bcd57218db22d56592243913afe3125e485" +BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-optee.git" +BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="beb883a34c9c7b1aaa96bbacd611be218809705c" BR2_PACKAGE_PHYTIUM_OPTEE_BOARD="e2000ddemo" diff --git a/configs/phytium_e2000_ubuntu_defconfig b/configs/phytium_e2000_ubuntu_defconfig index 7029bf93..59f2fd13 100644 --- a/configs/phytium_e2000_ubuntu_defconfig +++ b/configs/phytium_e2000_ubuntu_defconfig @@ -38,7 +38,7 @@ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" # kernel 5.10 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_2023-v1.0-RC1" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="e2000" diff --git a/configs/phytium_e2000_ubuntu_desktop_defconfig b/configs/phytium_e2000_ubuntu_desktop_defconfig index b179cd58..476e7106 100644 --- a/configs/phytium_e2000_ubuntu_desktop_defconfig +++ b/configs/phytium_e2000_ubuntu_desktop_defconfig @@ -36,7 +36,7 @@ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" # kernel 5.10 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_2023-v1.0-RC1" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="e2000" diff --git a/configs/phytium_e2000_xenomai_defconfig b/configs/phytium_e2000_xenomai_defconfig index 9f45d815..3c691972 100644 --- a/configs/phytium_e2000_xenomai_defconfig +++ b/configs/phytium_e2000_xenomai_defconfig @@ -34,8 +34,8 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y # Kernel BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y -BR2_LINUX_KERNEL_CUSTOM_REPO_URL="ssh://git@gitee.com:22/phytium_embedded/linux-kernel-xenomai.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="24f65f47f91d78893b2162b12536b04c5404e9aa" +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/linux-kernel-xenomai.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10.153-dovetail3_2023-v1.0-RC1" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="e2000" diff --git a/configs/phytium_initrd_defconfig b/configs/phytium_initrd_defconfig index d8a3a37f..751f0f13 100644 --- a/configs/phytium_initrd_defconfig +++ b/configs/phytium_initrd_defconfig @@ -131,4 +131,11 @@ BR2_TOOLCHAIN_HAS_THREADS=y #BR2_PACKAGE_LIBOPEN62541=y #BR2_PACKAGE_LIBOPEN62541_BUILD_EXAMPLES=y +# xorg-rogue-umlibs firmware BR2_PACKAGE_XORG_ROGUE_UMLIBS=y +BR2_PACKAGE_XORG_ROGUE_UMLIBS_FIRMWARE=y + +# vpu-lib firmware +BR2_PACKAGE_VPU_LIB=y +BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000" +BR2_PACKAGE_VPU_LIB_FIRMWARE=y diff --git a/package/phytium-optee/phytium-optee.mk b/package/phytium-optee/phytium-optee.mk index 0dff0ef8..6466bb48 100755 --- a/package/phytium-optee/phytium-optee.mk +++ b/package/phytium-optee/phytium-optee.mk @@ -17,13 +17,13 @@ PHYTIUM_OPTEE_OS_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64 PHYTIUM_OPTEE_CLIENT_SDK = $(STAGING_DIR)/usr # build optee os need this package in host -PHYTIUM_OPTEE_DEPENDENCIES = host-openssl host-python3 host-python-pycryptodomex host-python-pyelftools +PHYTIUM_OPTEE_DEPENDENCIES = host-openssl host-python3 host-python-pycryptodomex host-python-pyelftools host-python-cryptography PHYTIUM_OPTEE_INSTALL_IMAGES = YES PHYTIUM_OPTEE_INSTALL_STAGING = YES define PHYTIUM_OPTEE_BUILD_CMDS - cd $(@D); ./build_all clean; CROSS_COMPILE64=$(TARGET_CROSS) ./build_all $(PHTYIUM_OPTEE_TARGET_BOARD) d + cd $(@D); ./build_all clean; CROSS_COMPILE64=$(TARGET_CROSS) PYTHON3="$(HOST_DIR)/bin/python3" ./build_all $(PHTYIUM_OPTEE_TARGET_BOARD) d endef # install lib & ta & client into rootfs diff --git a/package/python-cryptography/python-cryptography.mk b/package/python-cryptography/python-cryptography.mk index a524f729..50adfdb1 100644 --- a/package/python-cryptography/python-cryptography.mk +++ b/package/python-cryptography/python-cryptography.mk @@ -17,14 +17,26 @@ PYTHON_CRYPTOGRAPHY_DEPENDENCIES = \ host-python-cffi \ host-rustc \ openssl +HOST_PYTHON_CRYPTOGRAPHY_DEPENDENCIES = \ + host-python-setuptools-rust \ + host-python-cffi \ + host-rustc \ + host-openssl PYTHON_CRYPTOGRAPHY_ENV = \ $(PKG_CARGO_ENV) \ PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)" +HOST_PYTHON_CRYPTOGRAPHY_ENV = \ + $(HOST_PKG_CARGO_ENV) \ + PYO3_CROSS_LIB_DIR="$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)" # We need to vendor the Cargo crates at download time PYTHON_CRYPTOGRAPHY_DOWNLOAD_POST_PROCESS = cargo PYTHON_CRYPTOGRAPHY_DOWNLOAD_DEPENDENCIES = host-rustc PYTHON_CRYPTOGRAPHY_DL_ENV = \ $(PKG_CARGO_ENV) \ BR_CARGO_MANIFEST_PATH=src/rust/Cargo.toml +HOST_PYTHON_CRYPTOGRAPHY_DL_ENV = \ + $(HOST_PKG_CARGO_ENV) \ + BR_CARGO_MANIFEST_PATH=src/rust/Cargo.toml $(eval $(python-package)) +$(eval $(host-python-package)) diff --git a/package/vpu-lib/Config.in b/package/vpu-lib/Config.in index d96f38eb..bcf5eb9b 100644 --- a/package/vpu-lib/Config.in +++ b/package/vpu-lib/Config.in @@ -6,7 +6,16 @@ config BR2_PACKAGE_VPU_LIB https://gitee.com/phytium_embedded/vpu-lib.git +if BR2_PACKAGE_VPU_LIB + config BR2_PACKAGE_VPU_LIB_CPU_MODEL string "cpu model" help This is a comment that defines cpu model is, d2000 or e2000 + +config BR2_PACKAGE_VPU_LIB_FIRMWARE + bool "vpu-lib firmware" + help + Install only vpu-lib firmware and do not install other files. + +endif diff --git a/package/vpu-lib/vpu-lib.mk b/package/vpu-lib/vpu-lib.mk index 5bdd08d8..d829168a 100644 --- a/package/vpu-lib/vpu-lib.mk +++ b/package/vpu-lib/vpu-lib.mk @@ -4,14 +4,20 @@ # ################################################################################ -VPU_LIB_VERSION = a3109a35b230a57d860bce66d4369a74c56f12a8 +VPU_LIB_VERSION = 1c5de03cadb170d7389ae43bc297592f047f865e VPU_LIB_SITE = https://gitee.com/phytium_embedded/vpu-lib.git VPU_LIB_INSTALL_TARGET = YES VPU_LIB_SITE_METHOD = git VPU_LIB_DEPENDENCIES = linux +ifeq ($(BR2_PACKAGE_VPU_LIB_FIRMWARE),y) +define VPU_LIB_INSTALL_TARGET_CMDS + cp -a $(@D)/$(BR2_PACKAGE_VPU_LIB_CPU_MODEL)/lib/firmware $(TARGET_DIR)/lib +endef +else define VPU_LIB_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR) CPU_MODEL=$(BR2_PACKAGE_VPU_LIB_CPU_MODEL) endef +endif $(eval $(generic-package)) diff --git a/package/xorg-rogue-umlibs/Config.in b/package/xorg-rogue-umlibs/Config.in index cc9b50ad..b7108652 100644 --- a/package/xorg-rogue-umlibs/Config.in +++ b/package/xorg-rogue-umlibs/Config.in @@ -5,3 +5,12 @@ config BR2_PACKAGE_XORG_ROGUE_UMLIBS should be wrapped. https://gitee.com/phytium_embedded/phytium-rogue-umlibs.git + +if BR2_PACKAGE_XORG_ROGUE_UMLIBS + +config BR2_PACKAGE_XORG_ROGUE_UMLIBS_FIRMWARE + bool "xorg-rogue-umlibs firmware" + help + Install only xorg-rogue-umlibs firmware and do not install other files. + +endif diff --git a/package/xorg-rogue-umlibs/xorg-rogue-umlibs.mk b/package/xorg-rogue-umlibs/xorg-rogue-umlibs.mk index 0bbf8634..7b6e39a9 100644 --- a/package/xorg-rogue-umlibs/xorg-rogue-umlibs.mk +++ b/package/xorg-rogue-umlibs/xorg-rogue-umlibs.mk @@ -4,20 +4,23 @@ # ################################################################################ -XORG_ROGUE_UMLIBS_VERSION = 213244f08503ce002cd816abbdc3e353f34e9a1b +XORG_ROGUE_UMLIBS_VERSION = 1932ace1db48c4301fcc1dd21e7b08c8e09be1c4 XORG_ROGUE_UMLIBS_CUSTOM_REPO_URL = https://gitee.com/phytium_embedded/phytium-rogue-umlibs.git XORG_ROGUE_UMLIBS_SITE = $(call qstrip,$(XORG_ROGUE_UMLIBS_CUSTOM_REPO_URL)) -XORG_ROGUE_UMLIBS_INSTALL_IMAGES = YES XORG_ROGUE_UMLIBS_SITE_METHOD = git -XORG_ROGUE_UMLIBS_BUILD_CMDS = YES -XORG_ROGUE_UMLIBS_INSTALL_TARGET_CMDS = YES define XORG_ROGUE_UMLIBS_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) all endef +ifeq ($(BR2_PACKAGE_XORG_ROGUE_UMLIBS_FIRMWARE),y) +define XORG_ROGUE_UMLIBS_INSTALL_TARGET_CMDS + cp -a $(@D)/targetfs/phytium-linux/xorg/lib/firmware $(TARGET_DIR)/lib +endef +else define XORG_ROGUE_UMLIBS_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR) WINDOW_SYSTEM=xorg endef +endif $(eval $(generic-package))