记录下整个过程以及在该过程中遇到的问题和解决方法。
一、获取软件仓库
$ mkdir -p openstlinux-5.4-dunfell-mp1-21-12-22
$ cd openstlinux-5.4-dunfell-mp1-21-12-22
$ repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.4-dunfell-mp1-21-12-22
执行第3条命令时报错如下:
$ repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.4-dunfell-mp1-21-12-22
Command 'repo' not found, but can be installed with:
sudo snap install git-repo
按照提示安装git-repo后重新执行命令,报错如下:
$ repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.4-dunfell-mp1-21-12-22
warning: gpg (GnuPG) is not available.
warning: Installing it is strongly encouraged.
warning: templates not found /build/git-repo-publish/parts/git/install/usr/share/git-core/templates
......
File '/home/admin/samba/stm32mp157/STM32MP15-Ecosystem-v2.1.0/Distribution-Package/openstlinux-5.4-dunfell-mp1-21-12-22/.repo/repo/main.py', line 79
file=sys.stderr)
^
SyntaxError: invalid syntax
按照如下步骤解决上述错误:
$ sudo apt-get install gpg
$ rm -rf ~/.repoconfig
$ mkdir -p ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
$ chmod a+x ~/bin/repo
然后执行如下命令获取仓库:
$ python3 ~/bin/repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.4-dunfell-mp1-21-12-22
如果出现如下警告,按照提示执行命令即可:
... A new version of repo (2.21) is available.
... You should upgrade soon:
cp /home/admin/samba/stm32mp157/STM32MP15-Ecosystem-v2.1.0/Distribution-Package/openstlinux-5.4-dunfell-mp1-21-12-22/.repo/repo/repo /home/admin/bin/repo
如果执行命令出现如下错误提示:
Downloading Repo source from https://gerrit.googlesource.com/git-repo
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out
fatal: double check your --repo-rev setting.
fatal: cloning the git-repo repository failed, will remove '.repo/repo'
执行如下命令使用国内镜像源:
$ export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
然后再重新执行命令。成功执行命令的话提示如下:
$ python3 ~/bin/repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.4-dunfell-mp1-21-12-22
Downloading Repo source from https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
remote: Enumerating objects: 7259, done.
remote: Counting objects: 100% (7259/7259), done.
remote: Compressing objects: 100% (3847/3847), done.
remote: Total 7259 (delta 4683), reused 5526 (delta 3338)
接收对象中: 100% (7259/7259), 3.21 MiB | 3.41 MiB/s, 完成.
处理 delta 中: 100% (4683/4683), 完成.
Downloading manifest from https://github.com/STMicroelectronics/oe-manifest.git
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 61 (delta 15), reused 20 (delta 9), pack-reused 34
展开对象中: 100% (61/61), 9.76 KiB | 713.00 KiB/s, 完成.
Your identity is: zzssdd2 If you want to change this, please re-run 'repo init' with --config-name repo has been initialized in /home/admin/samba/stm32mp157/STM32MP15-Ecosystem-v2.1.0/Distribution-Package/openstlinux-5.4-dunfell-mp1-21-12-22 接着执行同步仓库的命令: $ python3 ~/bin/repo sync Fetching: 100% (9/9), done in 3m27.864s Garbage collecting: 100% (9/9), done in 0.040s repo sync has finished successfully. 执行完上面命令后仓库就同步完成了,如果在同步过程中由于下载出错等原因导致中断,重新执行同步命令即可。同步完成后目录结构如下所示: openstlinux-5.4-dunfell-mp1-21-12-22 ├── .repo │ ├── copy-link-files.json │ ├── manifests │ ├── manifests.git │ ├── manifest.xml │ ├── project.list │ ├── project-objects │ ├── projects │ └── repo └── layers ├── meta-openembedded ├── meta-qt5 ├── meta-st ├── meta-timesys └── openembedded-core 接下来进行构建环境的初始化。 二、初始化构建环境 我选择的镜像是QT image and SDK with weston/wayland,因此执行如下命令来初始化构建环境: $ DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh 由于我的主机缺少相关软件包提示如下: [HOST DISTRIB check] Linux Distrib: Ubuntu Linux Release: 20.04 Required packages for Linux Distrib: build-essential chrpath cpio debianutils diffstat gawk gcc-multilib git iputils-ping libegl1-mesa libsdl1.2-dev libssl-dev pylint python3 python3-git python3-jinja2 python3-pexpect python3-pip socat texinfo unzip wget xterm xz-utils Missing required packages detected: chrpath diffstat gawk gcc-multilib libegl1-mesa libsdl1.2-dev pylint python3-git python3-jinja2 python3-pip socat texinfo xterm To update your Linux Distribution packages, two proposals: 1) run again envsetup.sh script with '--pkg-update' option OR 2) before running envsetup.sh script, launch first in your Linux console: sudo apt-get update sudo apt-get install chrpath diffstat gawk gcc-multilib libegl1-mesa libsdl1.2-dev pylint python3-git python3-jinja2 python3-pip socat texinfo xterm Check aborted: exiting now... 根据提示执行如下命令: $ sudo apt-get update $ sudo apt-get install chrpath diffstat gawk gcc-multilib libegl1-mesa libsdl1.2-dev pylint python3-git python3-jinja2 python3-pip socat texinfo xterm 然后在我的主机上会出现如下错误: 下列软件包有未满足的依赖关系: libsdl1.2-dev : 依赖: libglu1-mesa-dev 但是它将不会被安装 或 libglu-dev 依赖: libx11-dev 但是它将不会被安装 依赖: libxext-dev 但是它将不会被安装 E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。 解决错误过程如下: $ sudo apt install aptitude $ sudo aptitude install libsdl1.2-dev ...... libx11-dev : 依赖: libx11-6 (= 2:1.6.9-2ubuntu1.2) 但是 2:1.6.9-2ubuntu1.3 已安装 下列动作将解决这些依赖关系: 保持 下列软件包于其当前版本: 1) libegl-dev [未安装的] 2) libgl-dev [未安装的] 3) libgl1-mesa-dev [未安装的] 4) libgles-dev [未安装的] 5) libglu1-mesa-dev [未安装的] 6) libglvnd-dev [未安装的] 7) libglx-dev [未安装的] 8) libsdl1.2-dev [未安装的] 9) libx11-dev [未安装的] 10) libxext-dev [未安装的] 是否接受该解决方案?[Y/n/q/?] n 下列动作将解决这些依赖关系: 降级 下列软件包: 1) libx11-6 [2:1.6.9-2ubuntu1.3 (now) -> 2:1.6.9-2ubuntu1.2 (focal-security, 是否接受该解决方案?[Y/n/q/?] Y ...... 解决该错误后重新执行安装所缺少软件包的那条命令即可。安装完成后再次执行初始化构建环境的命令,如下: $ DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh [HOST DISTRIB check] Linux Distrib: Ubuntu Linux Release: 20.04 Required packages for Linux Distrib: build-essential chrpath cpio debianutils diffstat gawk gcc-multilib git iputils-ping libegl1-mesa libsdl1.2-dev libssl-dev pylint python3 python3-git python3-jinja2 python3-pexpect python3-pip socat texinfo unzip wget xterm xz-utils Check OK: all required packages are installed on host. [source layers/openembedded-core/oe-init-build-env][from nothing] [EULA configuration] [Configure *.conf files] [INFO] No 'site.conf.sample' file available at /home/admin/samba/stm32mp157/STM32MP15-Ecosystem-v2.1.0/Distribution-Package/openstlinux-5.4-dunfell-mp1-21-12-22/layers/meta-st/scripts. Create default one... =========================================================================== Configuration files have been created for the following configuration: DISTRO : openstlinux-weston DISTRO_CODENAME : dunfell MACHINE : stm32mp1 BB_NUMBER_THREADS : PARALLEL_MAKE : BUILDDIR : build-openstlinuxweston-stm32mp1 DOWNLOAD_DIR : SSTATE_DIR : SOURCE_MIRROR_URL : SSTATE_MIRRORS : WITH_EULA_ACCEPTED: YES =========================================================================== Available images for OpenSTLinux layers are: - Official OpenSTLinux images: st-image-weston - OpenSTLinux weston image with basic Wayland support (if enable in distro) - Other OpenSTLinux images: - Supported images: st-image-core - OpenSTLinux core image You can now run 'bitbake The OpenEmbedded environment setup script must be run once in each new working terminal in which you use the BitBake or devtool tools The BSP for STM32MP1 depends on packages and firmwares which are covered by a software license agreement (SLA). You will be asked to read and to accept this EULA. 至此,构建环境初始化完成,接下来开始构建镜像和SDK。 三、构建镜像和SDK 温馨提示:在执行下面的构建命令前建议查看下磁盘容量以确保有足够的磁盘空间,否则在构建过程中因磁盘空间不足也会导致失败,如果磁盘空间不够需要先进行扩容再来进行构建工作。 镜像和SDK构建完成后的磁盘占用情况如下: $ du -h -d 1 134M ./layers 330M ./.repo 70G ./build-openstlinuxweston-stm32mp1 执行如下命令开始构建镜像: $ bitbake st-example-image-qtwayland 然后就是耐心等待构建完成。如果在该过程中由于下载出错等原因导致中断,重新执行构建命令即可。 ################################### 2000 years later...... ################################################ 构建成功后如下所示: NOTE: Started PRServer with DBfile: /home/admin/samba/stm32mp157/STM32MP15-Ecosystem-v2.1.0/Distribution-Package/openstlinux-5.4-dunfell-mp1-21-12-22/build-openstlinuxweston-stm32mp1/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 42375, PID: 502452
上一篇:STM32MP157系统移植(TF-A,U-Boot,Linux)
下一篇:STM32MP157移植Qt5.12.10
推荐阅读最新更新时间:2026-03-13 10:28
- LTC2263-12 演示板,12 位,25Msps,1.8V 双路串行 ADC,5MHz
- 用PIC单片机设计电子密码锁
- AM1G-2424DH30Z ±24V 1 瓦 DC-DC 转换器的典型应用
- 无线充电电动牙刷设计
- OP497FSZ平方放大器典型应用电路
- 基于LTC3453的LED闪光灯驱动器设计
- PAM2808 5W 大功率高亮度 LED 驱动器的典型应用
- 使用 Analog Devices 的 LTC1258CS8-5 的参考设计
- 基于ARM处理器的EtherCAT 通信开发平台 -原理图
- 适用于 ADP1741 2A 低 VIN、低压差线性稳压器的具有可调输出电压、0.75V 至 3.3V 的典型应用电路



rt1020 播放sd卡音频文件
智能机械臂
现代雷达系统的信号设计
LM139AJ/883C
BFR340T






京公网安备 11010802033920号