openEuler Embedded容器构建指导
建议直接看官方社区的: openEuler Embedded使用与开发手册
目录
1. 安装docker
需要安装docker,没安装的参考:安装docker
2. 拉取容器镜像
从华为云pull镜像到宿主机
docker pull swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/rtos-openeuler-21.03:v001
执行完,查看拉取下来的镜像id:
docker images -a
3. 启动容器
docker run -idt --network host --privileged b553c7f5278b /bin/bash
查看刚刚启动的容器
docker ps
进入容器
docker exec -it e4d6f5e8d050 /bin/bash
4. yocto一键式构建流程
拉取yocto-meta-openeuler代码仓
git clone https://gitee.com/openeuler/yocto-meta-openeuler.git -b openEuler-22.03-LTS -v /usr1/yocto-meta-openeuler
执行download_code脚本,下载代码仓到哦/usr1/openeuler/src目录,下载需要花很长时间
cd /usr1/yocto-meta-openeuler
sh scripts/download_code.sh /usr1/openeuler/src
开始编译
修改目录所属用户组,因为yocto编译需要普通用户来编
chown -R huawei:users /usr1
su huawei
执行编译,如果没此目录,从4.1步拷贝过去
cd /usr1/openeuler/src/yocto-meta-openeuler/scripts
source compile.sh aarch64-std /usr1/build /usr1/openeuler/gcc/openeuler_gcc_arm64le
开始编译,我的机器4核,编译快2小时吧。
bitbake openeuler-image
# 这个编译很快
# bitbake openeuler-image-tiny
-
编译架构: aarch64-std、aarch64-pro、arm-std、raspberrypi4-64
-
构建目录: /usr1/build
-
源码目录: /usr1/openeuler/src
-
编译器所在路径: /usr1/openeuler/gcc/openeuler_gcc_arm64le
- aarch64-std、aarch64-pro、raspberrypi4-64使用openeuler_gcc_arm64le编译器
- arm-std使用openeuler_gcc_arm32le编译器
5. 获取结果件
结果件默认生成在构建目录下的output
如aarch64-std编译完成后产物如下:
- openeuler嵌入式镜像: Image-5.10.0
- openeuler嵌入式sdk工具链: openeuler-glibc-x86_64-openeuler-image-aarch64-qemu-aarch64-toolchain-21.09.30.sh
- openeuler嵌入式文件系统: openeuler-image-qemu-aarch64-20220318114250.rootfs.cpio.gz
- openeuer嵌入式压缩镜像: zImage
遇到的问题:
| make: Entering directory '/usr1/build/tmp/work-shared/qemu-aarch64/kernel-source'
| make[1]: Entering directory '/usr1/build/tmp/work/qemu_aarch64-openeuler-linux/linux-openeuler/5.10-r0/build'
| GEN Makefile
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-ld.bfd: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by aarch64-openeuler-linux-ld.bfd)
| aarch64-openeuler-linux-ld.bfd: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by aarch64-openeuler-linux-ld.bfd)
| init/Kconfig:39: syntax error
| init/Kconfig:38: invalid statement
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-ld.bfd: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by aarch64-openeuler-linux-ld.bfd)
| aarch64-openeuler-linux-ld.bfd: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by aarch64-openeuler-linux-ld.bfd)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by aarch64-openeuler-linux-gcc)
| aarch64-openeuler-linux-gcc: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by aarch64-openeuler-linux-gcc)
| make[2]: *** [/usr1/build/tmp/work-shared/qemu-aarch64/kernel-source/scripts/kconfig/Makefile:71: olddefconfig] Error 1
| make[1]: *** [/usr1/build/tmp/work-shared/qemu-aarch64/kernel-source/Makefile:603: olddefconfig] Error 2
| make[1]: Leaving directory '/usr1/build/tmp/work/qemu_aarch64-openeuler-linux/linux-openeuler/5.10-r0/build'
| make: *** [Makefile:185: __sub-make] Error 2
ERROR: dsoftbus-1.0-r1 do_fetch: Fetcher failure for URL: 'file://dsoftbus_output'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /usr1/build/tmp/work/aarch64-openeuler-linux/dsoftbus/1.0-r1/temp/log.do_fetch.18107
ERROR: Task (/usr1/openeuler/src/yocto-poky/../yocto-meta-openeuler/meta-openeuler/recipes-core/dsoftbus/dsoftbus_1.0.bb:do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 264 tasks of which 243 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/usr1/openeuler/src/yocto-poky/../yocto-meta-openeuler/meta-openeuler/recipes-core/dsoftbus/dsoftbus_1.0.bb:do_fetch
[root@openEuler-21 ~]# docker pull swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container:v004
Error response from daemon: manifest for swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container:v004 not found