ZYNQ:提取PetaLinux中Linux和UBoot配置、源码

摘要:
说明默认情况下,PetaLinux在编译完成后会删除源代码,以节省硬盘空间。system-top.dts、system-conf.dtsi等这些设备树文件是petalinux-build在之后生成的Linux、uboot的源码没有变化,关键在于配置以及设备树的变化这里以:2018.03的ZYNQ-7000平台为例。提取以后,还有一篇文章简单地介绍了如何打包BOOT.bin以及image.ubhttps://www.cnblogs.com/schips/p/using-petalinux-package-boot_bin_and_image_ub.html文件系统文件系统位于image/linux,可以使用下面命令解压。Linux内核配置PetaLinux工程在编译后,在build/tmp/work-shared/目录下,根据对应芯片的$DIR下的kernel-build-artifacts,保存了Linux的配置文件.config。这样使用makexilinx_peta_defconfig,可以创建PetaLinux使用的Linux配置。

说明

默认情况下,PetaLinux在编译完成后会删除源代码,以节省硬盘空间。

project-spec/meta-user/conf/petalinuxbsp.conf里,添加如下内容,可以保留Linux和UBoot源代码。

RM_WORK_EXCLUDE += "linux-xlnx"
RM_WORK_EXCLUDE += "u-boot-xlnx"

可以使用下面的方法创建petalinux工程:

##
#    Copyright By Schips, All Rights Reserved
#    https://gitee.com/schips/
#
#    File Name:  copy_petalinux_project_with_hw.sh
#    Created  :  2020-07-25 11:28:24
#
##
#!/bin/sh
help () {
    echo "Error : need $projectname $hw_bsp"
    echo "  eg :"
    echo "      $0 ax_project ~/hw-vivado-bsp-for-petalinux/some_packakge"
    exit 1
}

if [ -z "$1" ]; then
	help
fi
if [ -z "$2" ]; then
	help
fi

## 删除源目录
rm $1 -rf

## 创建项目
petalinux-create --type project --template zynq --name $1

## 导入硬件信息
cd $1
petalinux-config --get-hw-description $2

## 使PetaLinux不删除源码
echo 'RM_WORK_EXCLUDE += "linux-xlnx"'>> project-spec/meta-user/conf/petalinuxbsp.conf

echo 'RM_WORK_EXCLUDE += "u-boot-xlnx"'>> project-spec/meta-user/conf/petalinuxbsp.conf

echo ''>> project-spec/meta-user/conf/petalinuxbsp.conf

此后,只要PetaLinux通过编译就可以获取源码。

system-top.dts、system-conf.dtsi 等这些设备树文件是petalinux-build在之后生成的

Linux、uboot的源码没有变化,关键在于配置以及设备树的变化

这里以:2018.03的ZYNQ-7000平台为例。

提取以后,还有一篇文章简单地介绍了如何打包BOOT.bin以及image.ub
https://www.cnblogs.com/schips/p/using-petalinux-package-boot_bin_and_image_ub.html

文件系统

文件系统位于image/linux,可以使用下面命令解压。

mkdir /tmp/rootfs_petalinx -p
sudo tar -zxf image/linux/rootfs.tar.gz -C  /tmp/rootfs_petalinx

获取Linux有关内容

Linux源码

PetaLinux工程在编译后,在build/tmp/work-shared/目录下,根据对应芯片的$DIR下的kernel-source,含有所有Linux源代码。

使用以下命令进行到达所在目录:

#find . -type d -name "$1" 2> /dev/null | grep $1
cd build/tmp/work-shared/
cd `find . -type d -name "kernel-source" 2> /dev/null`

可以复制这个目录里的Linux源代码,用来使用open source流程编译。

以ZYNQ-7000为例,目录为:build/tmp/work-shared/plnx-zynq7/kernel-source

build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/这个目录下的源码有点不太一样,不要使用这个目录下面的。

Linux内核配置

PetaLinux工程在编译后,在build/tmp/work-shared/目录下,根据对应芯片的$DIR下的kernel-build-artifacts,保存了Linux的配置文件.config

通过以下命令查找它的所在目录:

#find . -type d -name "$1" 2> /dev/null | grep $1
cd build/tmp/work-shared/
find . -type d -name "kernel-build-artifacts" 2> /dev/null

以ZYNQ-7000为例,目录为:build/tmp/work-shared/plnx-zynq7/kernel-build-artifacts

为了方便使用,可以把文件.config复制到Linux源代码的子目录arch/arm/configs/下,重命名为xilinx_peta_defconfig。这样使用make xilinx_peta_defconfig,可以创建PetaLinux使用的Linux配置。

DIR=plnx-zynq7 # ZYNQ-7000
cp  
build/tmp/work-shared/$DIR/kernel-build-artifacts/.config 
build/tmp/work-shared/$DIR/kernel-source/arch/arm/configs/xilinx_peta_defconfig

获取设备树 .dts 文件

说明:

  • zynq-7000.dtsi :文件中的内容是 zynq-7000 系列处理器相同的硬件外设配置信息(PS 端的)
  • pl.dtsi :内容是我们在vivado 当中添加的 pl 端外设对应的配置信息
  • pcw.dtsi :表示我们在 vivado 当中已经使能的 PS 外设。

获取设备树源码一共有下列的方式:

工具输入输出备注
SDKhdfdts需要对SDK工程进行配置,但是使用方便
PetaLinux-buildhdfdtb、dts构建后才生成结果,过程不透明
PetaLinux-hsihdfdts需要使用交互式命令构建,生成的dts与build出来的有点不一样
dtcdts或dtbdtb或dts传统方法;由dtb反编译再构建的dtb不一定可靠
kernel-makedtsdtb放在内核树中进行编译得到的设备树,需要修改Makefile

原理:除了dtc常规编译设备树以外,其他的方式都是由tcl脚本生成的。

dtc处理设备树

使用petalinux根据bsp建立工程以后,会在build/tmp/deploy/images目录中根据对应芯片的$DIR下的产生system.dtb,用dtc反汇编可获取dts文件。

#!/bin/bash

DTC=${A_DCT_FULL_PATH}  # 一般是在 Linux内核源码中的 scripts/dtc/dtc

find . -type f -name "system.dtb" 2> /dev/null

# 以 ZYNQ 7000 为例
##./build/tmp/deploy/images/plnx-zynq7/plnx-zynq7-system.dtb
##./images/linux/system.dtb

# 反编译 dtb获取 dts
$DTC -I dtb -O dts -o system-top.dts system-top.dtb

# 将dts 编译为 dtb
$DTC -I dts -O dtb -o system-top.dtb system-top.dts

完整编译工程以后,在image/linux中也会有一个system.dtb

hsi生成设备树

下载PetaLinux依赖的 设备树仓库路径:

wget https://github.com/Xilinx/device-tree-xlnx/archive/xilinx-v2018.3.tar.gz
tar -xf xilinx-v2018.3.tar.gz -C /opt/env

生成:

##
#    Copyright By Schips, All Rights Reserved
#    https://gitee.com/schips/
#
#    File Name:  hdf2dts.sh
#    Created  :  2020-08-06 20:14:03
#
##
#!/bin/sh
HDF=$1
DEVICE_TREE_DIR=/opt/env/device-tree-xlnx-xilinx-v2018.3
OUTDIR=$2
help () {
    echo "ERROR : Need arguments"
    echo " eg:"
    echo "     $0  xx.hdf  outputDirForDTS"
    exit
}

if [ -z "$1" ]; then
    help
fi

if [ -z "$2" ]; then
    help
fi
#export PATH=$PATH:${DEVICE_TREE_DIR}/
command -v hsi >/dev/null 2>&1 || { echo >&2 "Aborted : Require "hsi" but not found."; exit 1;  }
echo "Creating DTS from [$$HDF]"
hsi <<EOF
open_hw_design $HDF
set_repo_path $DEVICE_TREE_DIR
create_sw_design deviec-tree -os device_tree -proc ps7_cortexa9_0
generate_target -dir $OUTDIR
EOF

sed 's/#include//include//g' $OUTDIR/system-top.dts -i
echo "/include/ "system-user.dtsi"" >> $OUTDIR/system-top.dts
find ${OUTDIR} -type f -name "*.dts*" -exec sed -E -i -e "s/@0x([0-9a-fA-F.]+)s?{/@L1 {/g" -e "s/@0+([0-9a-fA-F.]+)s?{/@L1 {/g" {} +
echo "Created DTS from [$HDF]"
echo "You may need [system-conf.dtsi], [system-user.dtsi] from Petalinux Project"

exit 0
# 进入交互命令
hsi
## 打开硬件描述文件
open_hw_design
## 设置仓库路径
set_repo_path
## 创建软件设计(CortexA9用的设备树)
create_sw_design deviec-tree -os device_tree -proc ps7_cortexa9_0
## 生成目标到目录
generate_target -dir

从PetaLinux工程中提取设备树

路径:

cp project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi  	${DTS_OUT}/common
cp components/plnx_workspace/device-tree/device-tree/system-conf.dtsi		${DTS_OUT}/common
cp components/plnx_workspace/device-tree/device-tree/system-top.dts			${DTS_OUT}/common
cp components/plnx_workspace/device-tree/device-tree/pl.dtsi 				${DTS_OUT}/common
cp components/plnx_workspace/device-tree/device-tree/pcw.dtsi				${DTS_OUT}/common

# 注意,kernel和uboot用的设备树中,还有一些地方不太一样:
cp  -v ${petaProject}/`find . -type f -name "zynq-7000.dtsi" 2> /dev/null | grep "kernel-source"`   ${DTS_OUT}/kernel
cp  -v ${petaProject}/`find . -type f -name "zynq-7000.dtsi" 2> /dev/null | grep "u-boot"`          ${DTS_OUT}/uboot

注意,kernel和uboot中的zynq-7000.dtsi不太一样,一般用kernel的就可以了。

SDK构建设备树

略。SDK需要安装一个类似dts的插件,此后也是根据hdf来创建一个设备树工程。

但是我认为这种方法还是比较臃肿。

获取 .its文件

image.ub哪里来?image.ub是U-Boot fitImage

搜索资料,得知这个文件把image, rootfs,dtb打包到一个文件里面

生成image.ub,需要一个后缀名为its的配置文件,来指定使用的设备树文件、根文件系统文件、内核文件。

参考蜗窝科技 u-boot FIT image介绍

image source file(.its)和device tree source file(.dts)类似,负责描述要生成的image
file的信息。mkimage和dtc工具,可以将.its文件以及对应的image data
file,打包成一个image file。

再将这个文件下载到么memory中,使用bootm命令就可以执行。

PetaLinux工程在编译后,在build/tmp/work/目录下中有fit-image-petalinux-user-image.its,可以用于生成image.ub。

目录比较深,我们不对它的路径规则进行分析,直接使用脚本进行查找:

cd build/tmp/work/
find . -name "fit-image-petalinux-user-image.its" 2> /dev/null

在PetaLinux 2018.2/2018.3里,images/linux/下有文件rootfs.its,用diff工具比较,两者的内容是一样的。

在PetaLinux 2019.1里,images/linux/已经没有这个文件。

为了方便,可以修改为使用images/linux下的文件。PetaLinux工程的目录"images/linux/"里,含有创建image.ub的devicetree、rootfs文件等。

取得UBoot有关内容

UBoot源码

如果使用了外部UBoot源代码编译,则没有这个源代码。可以复制前面提到的UBoot源代码,用来使用open source流程编译。

PetaLinux工程在编译后,在build/tmp/work/目录下,根据对应芯片的$DIR下的u-boot-xlnx中的git目录含有所有UBoot源代码。

通过以下命令查找它的所在目录:

#find . -type d -name "$1" 2> /dev/null | grep $1
cd build/tmp/work/
find . -type d -name "git" 2> /dev/null | grep "u-boot-xlnx"| grep "git"

以ZYNQ-7000为例,目录为:build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/u-boot-xlnx/

对于PetaLinux 2019.1的ZCU106 BSP工程,UBoot源代码在目录 ./build/tmp/work/zcu106_zynqmp-xilinx-linux/u-boot-xlnx/v2019.01-xilinx-v2019.1+gitAUTOINC+d895ac5e94-r0/git/。

UBoot配置

PetaLinux工程在编译后,在build/tmp/work/目录下,根据对应芯片的$DIR下的u-boot-xlnxbuild目录下保存了UBoot的配置文件.config

例如:

build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/u-boot-xlnx/v2018.01-xilinx-v2018.3+gitAUTOINC+d8fc4b3b70-r0/build/.config

使用以下命令定位所在目录:

#find . -type d -name "$1" 2> /dev/null | grep $1
cd build/tmp/work/
find . -type d -name "build" 2> /dev/null | grep "u-boot-xlnx"| grep "build"

为了方便使用,可以把文件.config复制到UBoot源代码的configs目录下,重命名为xilinx_peta_defconfig

这样一来,使用make xilinx_peta_defconfig,就可以创建PetaLinux使用的UBoot配置。

注意事项:

从PetaLinux工程里得到的UBoot源代码中自动生成的文件include/configs/platform-auto.h里的宏定义里的连接符后有空格,可能导致编译时编译器会产生大量警告。

使用以下命令去除:

sed 's/ $//' include/configs/platform-auto.h -i

uboot自动生成的配置

uboot头文件:project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h,实际上会变成platform-auto.h

修改bif文件

需要创建BOOT.BIN,需要bootgen.bif(boot image format)。

PetaLinux工程生成boot.bin时,会在build目录下生成文件bootgen.bif

BIF 文件的所有语法都在 Zynq UltraScale+ MPSoC 软件开发指南 (UG1137) 中,见附录 A。

默认的bif文件的内容如下,没有包括aes安全信息等:

the_ROM_image:
{
    [bootloader] /tmp/tmp.0MmcVIZQVR/zynq_fsbl.elf
    /tmp/tmp.0MmcVIZQVR/system.bit
    /tmp/tmp.0MmcVIZQVR/u-boot.elf
}

bootgen.bif里用的是临时目录,最好改成PetaLinux工程的目录images/linux/,我们这里可以使用一个脚本,生成一个更规范的bif文件,在 顶级目录下 执行以下脚本:

#!/bin/sh

TOP=`pwd`
DESTDIR="${TOP}/images/linux"
BIF=new.bif

echo "the_ROM_image:" > $BIF
echo "{" >> $BIF
echo "    [bootloader] ${DESTDIR}/zynq_fsbl.elf" >> $BIF
echo "    ${DESTDIR}/system.bit" >> $BIF
echo "    ${DESTDIR}/u-boot.elf" >> $BIF
echo "}" >> $BIF

一键拷贝

原文:https://www.cnblogs.com/schips/p/get-source-code-and-config-from-petalinux-project-built.html

一键拷贝内核、uboot等源码(实际上不需要,因为构建时用的源码没有被修改)

关键在于设备树、以及配置

##
#    Copyright By Schips, All Rights Reserved
#    https://gitee.com/schips/
#
#    File Name:  cp_src_from_petalinux.sh
#    Created  :  2020-07-25 08:08:47
#
##
#!/bin/sh

help () {
    echo "ERROR : Need arguments"
    echo " eg:"
    echo "     $0  petaProject  outputDir"
    exit
}

if [ -z "$1" ]; then
    help
fi

if [ -z "$2" ]; then
    help
fi

petaProject=`cd $1 && pwd`
mkdir $2 -p
outputDir=`cd $2 && pwd`

cd $petaProject || exit 1

CONFIG=xilinx_zynq7000_peta_defconfig


KERNEL_DIR=${petaProject}/`find . -type d -name "kernel-source" 2> /dev/null`
UBOOT_DIR=${petaProject}/`find . -type d -name "git" 2> /dev/null | grep "u-boot-xlnx"| grep "git"`

KERNEL_OUT=${outputDir}/linux
UBOOT_OUT=${outputDir}/uboot

DTB=${petaProject}/images/linux/system.dtb
DTS_OUT=${outputDir}/dts
mkdir  $DTS_OUT
#DTC=$KERNEL_DIR/scripts/dtc/dtc


## 拷贝配置 
cp_config () {
    KERNEL_CFG=${petaProject}/`find . -type d -name "kernel-build-artifacts" 2> /dev/null`/.config
    UBOOT_CFG=${petaProject}/`find . -type d -name "build" 2> /dev/null | grep "u-boot-xlnx"| grep "build"`/.config
    cp  ${KERNEL_CFG} ${KERNEL_OUT}/arch/arm/configs/${CONFIG} -v
    cp  ${UBOOT_CFG}  ${UBOOT_OUT}/configs/${CONFIG} -v
    cp ./project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs/platform-auto.h ${UBOOT_OUT}/include/configs/platform-auto.h -v
    ## 处理掉空格
    sed 's/ $//' ${UBOOT_OUT}/include/configs/platform-auto.h -i
}

cp_dt() {
    echo "Warring : 经过对比分析,提取的设备树与PetaLinux构建的设备树很多地方不一致,不建议使用提取的设备树。"
    cp  $DTB ${DTS_OUT} -v
    mkdir -p ${DTS_OUT}/uboot
    mkdir -p ${DTS_OUT}/kernel 
    cp  ${petaProject}/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi ${DTS_OUT}/uboot -v
    cp  ${petaProject}/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi ${DTS_OUT}/kernel -v

    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/system-conf.dtsi    ${DTS_OUT}/uboot -v
    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/system-conf.dtsi    ${DTS_OUT}/kernel -v

    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/system-top.dts      ${DTS_OUT}/uboot -v
    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/system-top.dts      ${DTS_OUT}/kernel -v

    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/pl.dtsi           ${DTS_OUT}/uboot -v
    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/pl.dtsi           ${DTS_OUT}/kernel -v

    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/pcw.dtsi          ${DTS_OUT}/uboot -v
    cp  ${petaProject}/components/plnx_workspace/device-tree/device-tree/pcw.dtsi          ${DTS_OUT}/kernel -v

    cp  -v ${petaProject}/`find . -type f -name "zynq-7000.dtsi" 2> /dev/null | grep "kernel-source"`   ${DTS_OUT}/kernel
    cp  -v ${petaProject}/`find . -type f -name "zynq-7000.dtsi" 2> /dev/null | grep "u-boot"`          ${DTS_OUT}/uboot 
    ## 更正设备树语法格式
    sed -i 's/#include//include//g' ${DTS_OUT}/kernel/system-top.dts 
    sed -i 's/#include//include//g' ${DTS_OUT}/uboot/system-top.dts 
    find ${DTS_OUT} -type f -name "*.dts*" -exec sed -E -i -e "s/@0x([0-9a-fA-F.]+)s?{/@L1 {/g" -e "s/@0+([0-9a-fA-F.]+)s?{/@L1 {/g" {} +
}

cp_rootfs () {
	cp ${petaProject}/image/linux/rootfs.tar.gz   	${outputDir} -v
}

cp_src () {
    ## 拷贝源码 到 指定的 目录
    cp  ${KERNEL_DIR} ${KERNEL_OUT}  -r
    cp  ${UBOOT_DIR}  ${UBOOT_OUT}   -r
    cp  ${petaProject}/images/linux/rootfs.tar.gz  	${outputDir} -v
}

cp_src
cp_dt
cp_config
cp_rootfs

清理、恢复 PetaLinux 工程

使用脚本清理

#
#    Copyright By Schips, All Rights Reserved
#    https://gitee.com/schips/
#
#    File Name:  clean_petalinux_project.sh
#    Created  :  2020-07-29 11:28:24
#
#
#!/bin/sh
BASE=`pwd`
SOURCEDIR=`cd $1 && pwd`
LOG=${SOURCEDIR}/cleanlog

help () {
    echo "ERROR : Need arguments"
    echo " eg:"
    echo "     $0  petaProject"
    exit
}

if [ -z "$1" ]; then
    help
fi

rm ${LOG}

backup_kernel_config () {
    cd ${BASE}
    cd ${SOURCEDIR}
    KERNEL_CFG=${SOURCEDIR}/`find . -type d -name "kernel-build-artifacts" 2> /dev/null`/.config
    mkdir -p ${SOURCEDIR}/our_config
    cp  ${KERNEL_CFG} -v ${SOURCEDIR}/our_config/kernel_config >> $LOG
}

backup_uboot_config () {
    cd ${BASE}
    cd ${SOURCEDIR}
    UBOOT_CFG=${SOURCEDIR}/`find . -type d -name "build" 2> /dev/null | grep "u-boot-xlnx"| grep "build"`/.config
    mkdir -p ${SOURCEDIR}/our_config
    cp  ${UBOOT_CFG} -v ${SOURCEDIR}/our_config/uboot_config >> $LOG
}
backup_uboot_config
backup_kernel_config

cd ${BASE}
rm -rf ${SOURCEDIR}/components ${SOURCEDIR}/build ${SOURCEDIR}/images

echo "See log : [$LOG]"

之后,内核、uboot的配置会被保存到our_config中。

PetaLinux本身的配置不会改变:使用petalinux-config会看到之前的配置。

恢复被删除的工程的配置

Linux的配置,因为完整的构造目录被删除了,因此,需要LOAD回来,要么使用这样的命令

petalinux-config -c kernel 

Uboot也是一样的,如果配置过了uboot,那么需要额外的LOAD操作。

petalinux-config -c u-boot

此后,直接petalinux-build即可。

提取以后,还有一篇文章简单地介绍了如何打包BOOT.bin以及image.ub
https://www.cnblogs.com/schips/p/xilinx-petalinux-package-boot_bin_and_image_ub.html

免责声明:文章转载自《ZYNQ:提取PetaLinux中Linux和UBoot配置、源码》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇VS2010插件之NuGet的安装Android Studio的串口通讯开发下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

自己动手开发智能聊天机器人完全指南(附python完整源码)

一、前言 人工智能时代,开发一款自己的智能问答机器人,一方面提升自己的AI能力,另一方面作为转型AI的实战练习。在此把学习过程记录下来,算是自己的笔记。 二、正文 2.1 下载pyaiml 下载pyaiml 2.2 安装 pip install aiml 安装aiml 2.3 查看 安装完成后,查看包信息,pip show 查看aiml包信息 三、源...

html 网页源码解析:bs4中BeautifulSoup

from bs4 importBeautifulSoup result=requests.request("get","http://www.baidu.com")result.encoding="utf-8"print(result.text)         #获取源码soup=BeautifulSoup(result.text,"html.parse...

OpenCV学习笔记(30)KAZE 算法原理与源码分析(四)KAZE特征的性能分析与比较

KAZE系列笔记:1.OpenCV学习笔记(27)KAZE 算法原理与源码分析(一)非线性扩散滤波 2.OpenCV学习笔记(28)KAZE 算法原理与源码分析(二)非线性尺度空间构建 3.OpenCV学习笔记(29)KAZE 算法原理与源码分析(三)特征检测与描述 4.OpenCV学习笔记(30)KAZE 算法原理与源码分析(四)KAZE特征的性能分...

redis源代码结构解析

看了黄建宏老师的《Redis设计与实现》,对redis的部分实现有了一个简明的认识; 之前面试的时候被问到了这部分的内容,没有关注,好在还有时间,就把Redis的源码看了一遍。 Redis源码的获取Redis是完全开源的,其源代码可以在直接在GitHub上获取:https://github.com/antirez/redis(目前的版本是4.4.0)。此时...

【NopCommerce源码架构学习-一】--初识高性能的开源商城系统cms

很多人都说通过阅读、学习大神们高质量的代码是提高自己技术能力最快的方式之一。我觉得通过阅读NopCommerce的源码,可以从中学习很多企业系统、软件开发的规范和一些新的技术、技巧,可以快速地提高我们的技术能力。所以我最近决定写一个“nopCommerce源码架构详解”的系列,来详细剖析NopCommerce的架构和原理。 Nopcommerce主要用到...

nonebot 源码阅读笔记

前言 nonebot 是一个 QQ 消息机器人框架,它的一些实现机制,值得参考。 nonebot NoneBot 初始化(配置加载) 阅读 nonebot 文档,第一个示例如下: import nonebot if __name__ == '__main__': nonebot.init() nonebot.load_builtin_pl...