首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Yocto构建在函数do_rootfs上失败

Yocto构建在函数do_rootfs上失败
EN

Stack Overflow用户
提问于 2020-05-04 19:39:39
回答 1查看 1.9K关注 0票数 2

我一直在遵循https://www.linux4sam.org/bin/view/Linux4SAM/PokyBuild上的步骤,使用Yocto构建一个核心图像最小和一个微芯片无头图像,用于使用约克托(Yocto)的SAMA5D27 eval工具包。我被do_rootfs命令卡住了,这两个命令都是bitbake核心图像-最小图像和微芯片-无头图像。

我遵循了上述指南中的所有步骤,并增加了几个步骤以使这些步骤发挥作用:

我将Docker与以下Dockerfile一起使用:

代码语言:javascript
运行
复制
FROM ubuntu:18.04

RUN apt-get update 

RUN apt-get install sudo 

RUN sudo apt-get install -y git  

RUN sudo apt-get install -y python

RUN sudo apt-get install -y python3 

RUN sudo apt-get install -y vim

RUN sudo apt-get install -y binutils chrpath cpio cpp diffstat g++ gawk gcc make texinfo elfutils libc6-dev  wget 


# adding a user     
RUN useradd -ms /bin/bash user1
RUN usermod -aG sudo user1

RUN echo user1:user1 | chpasswd
CMD /bin/bash

一旦我进入了Docker容器,我就会运行一个构建脚本,其中包含以下命令来执行指南中的步骤:

代码语言:javascript
运行
复制
mkdir my_dir && cd my_dir

git clone git://git.yoctoproject.org/poky -b warrior 

git clone git://git.openembedded.org/meta-openembedded -b warrior

git clone git://code.qt.io/yocto/meta-qt5.git

git clone git://github.com/linux4sam/meta-atmel.git -b warrior

cd poky

source oe-init-build-env build-microchip

# change the local.conf and bblayers.conf based on suggestions in the guide 
cp -f /local.conf /my_dir/poky/build-microchip/conf/local.conf

cp -f /bblayers.conf /my_dir/poky/build-microchip/conf/bblayers.conf

# switch to the new user 
su user1

export PATH=$PATH:/my_dir/poky/bitbake/bin
sudo apt-get install locales
sudo dpkg-reconfigure locales
sudo locale-gen en_US.UTF-8

sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

# give user1 permissions to modify all subdirectories within my_dir
sudo chmod -R a+rwx /my_dir

下面是我得到的错误消息-没有提到明显的错误,只需“用代码1退出”:

代码语言:javascript
运行
复制
WARNING: /my_dir/meta-atmel/recipes-bsp/at91bootstrap/at91bootstrap_3.8.12.bb: Unable to get checksum for at91bootstrap SRC_URI entry 0001-Add-an-option-to-enable-SAM-BA-download.patch: file could not be found
WARNING: /my_dir/meta-atmel/recipes-bsp/at91bootstrap/at91bootstrap-sam-ba_3.8.12.bb: Unable to get checksum for at91bootstrap-sam-ba SRC_URI entry 0001-Add-an-option-to-enable-SAM-BA-download.patch: file could not be found
WARNING: /my_dir/meta-atmel/recipes-bsp/at91bootstrap/at91bootstrap-sam-ba_3.8.12.bb: Unable to get checksum for at91bootstrap-sam-ba SRC_URI entry 0002-Enable-image-download-via-sam-ba.patch: file could not be found
Parsing recipes: 100% |######################################################################| Time: 0:00:36
Parsing of 2364 .bb files complete (0 cached, 2364 parsed). 3452 targets, 336 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task censored dependencies

Build Configuration:
BB_VERSION           = "1.42.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-18.04"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "sama5d27-som1-ek-sd"
DISTRO               = "poky-atmel"
DISTRO_VERSION       = "2.7.3"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "warrior:274e8c50eee14c0bfc1fc3f51d5b33cbc44c3a31"
meta-atmel           = "warrior:102d92bfc7bd772387ea89c149d33cc5ebf9179c"
meta-oe              
meta-networking      
meta-python          
meta-multimedia      = "warrior:a24acf94d48d635eca668ea34598c6e5c857e3f8"
meta-qt5             = "upstream/warrior:7d0b17aa229edc9e138edfe0e8477fbbe9013ba6"

NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/2.8/x86_64-nativesdk-libc.tar.xz;sha256sum=a09922172c3a439105e0ae6b943daad2d83505b17da0aba97961ff433b8c21ab
Initialising tasks: 100% |###################################################################| Time: 0:00:01
Sstate summary: Wanted 793 Found 0 Missed 793 Current 0 (0% match, 0% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: autoconf-archive-native-2018.03.13-r0 do_fetch: Failed to fetch URL https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-2018.03.13.tar.xz, attempting MIRRORS if available
WARNING: bzip2-native-1.0.6-r5 do_fetch: Failed to fetch URL http://downloads.yoctoproject.org/mirror/sources/bzip2-1.0.6.tar.gz, attempting MIRRORS if available
WARNING: bash-4.4.18-r0 do_fetch: Failed to fetch URL https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-023;apply=yes;striplevel=0;name=patch023, attempting MIRRORS if available
WARNING: libcap-2.26-r0 do_fetch: Failed to fetch URL https://cdn.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.26.tar.xz, attempting MIRRORS if available
WARNING: tcp-wrappers-7.6-r10 do_fetch: Failed to fetch URL ftp://ftp.porcupine.org/pub/security/tcp_wrappers_7.6.tar.gz, attempting MIRRORS if available
ERROR: core-image-minimal-1.0-r0 do_rootfs: The postinstall intercept hook 'update_gio_module_cache' failed, details in /my_dir/poky/build-microchip/tmp/work/sama5d27_som1_ek_sd-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_rootfs
ERROR: core-image-minimal-1.0-r0 do_rootfs: 
ERROR: core-image-minimal-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /my_dir/poky/build-microchip/tmp/work/sama5d27_som1_ek_sd-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_rootfs.83357
ERROR: Task (/my_dir/poky/meta/recipes-core/images/core-image-minimal.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2561 tasks of which 5 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /my_dir/poky/meta/recipes-core/images/core-image-minimal.bb:do_rootfs
Summary: There were 8 WARNING messages shown.
Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
user1@92cf383a5212:/my_dir/poky/build-microchip$ vim /my_dir/poky/build-microchip/tmp/work/sama5d27_som1_ek_sd-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_rootfs.83357

我将失败的日志文件附在下面的消息中:

https://filebin.net/e02r8w5m3bn607qd

有什么可能会出错吗?

编辑:在进一步的调查中,我意识到在/my_dir/poky/scripts/postinst-intercepts/update_gio_module_cache中,${binprefix}是空的,所以${binprefix}qemuwrapper是空的,当您运行qemuwrapper (在update_gio_module_cache中运行的命令)时,您会得到错误消息qemu-arm not found。所以我为ubuntu安装了qemu-arm

此外,我还意识到gio-querymodules for sama5d27-som-ek1的脚本是在/my_dir/poky/build-microchip/tmp/work/sama5d27_som1_ek_sd-poky-linux-gnueabi/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/libexec/gio-querymodules而不是$D${libexec}gio-querymodules找到的,后者在我的系统中扩展为/my_dir/poky/build-microchip/tmp/work/sama5d27_som1_ek_sd-poky-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/usr/libexec/gio-querymodules

一旦我修复了这些路径并运行bitbake -c rootfs核心图像最小,我会得到以下错误:

代码语言:javascript
运行
复制
/my_dir/poky/build-microchip/tmp/work/sama5d27_som1_ek_sd-poky-linux-gnueabi/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/libexec/gio-querymodules: Invalid ELF image for this architecture
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-12 15:09:30

就我的情况而言,这个问题的解决办法有两方面:

  1. 我更改了设置用户权限的方式以及将用户更改为:

chmod -R g+rw /home/sama5d27

chmod -R o+rw /home/sama5d27

用户添加-p user1 -s /bin/bash user1

  • 我得到了一个'os块大小错误‘,该错误使用:
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61600231

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档