Yocto poky build не работает на функции do_rootfs - PullRequest
1 голос
/ 04 мая 2020

Я выполнил шаги на https://www.linux4sam.org/bin/view/Linux4SAM/PokyBuild, чтобы создать образ core-image-minimal и microchip-headless-image для тестового набора SAMA5D27 с помощью Yocto. Я застрял в команде do_rootfs как для bitbake core-image-minimal, так и для microchip-headless-image.

Я выполнил все шаги в приведенном выше руководстве и добавил еще несколько шагов, чтобы эти шаги работали:

Я использую Docker со следующим Dockerfile:

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, я запускаю сценарий сборки со следующими командами для выполнения шаги в руководстве:

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»:

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

and I've attached the log file for the failure with this message:

https://filebin.net/e02r8w5m3bn607qd

Any ideas what could be going wrong?

Edit: on further investigation, I realized that in /my_dir/poky/scripts/postinst-intercepts/update_gio_module_cache , ${binprefix} was coming out as empty, so that ${binprefix}qemuwrapper was nothing, and when you run qemuwrapper, which is the command run in update_gio_module_cache, you get the error message 'qemu-arm not found'. So I installed qemu-arm for ubuntu.

Further, I realized that the script gio-querymodules for sama5d27-som-ek1 is found at /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, not at $D${libexec}gio-querymodules, which expands in my system to, /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.

Once I fix these paths up and run bitbake -c rootfs core-image-minimal, I get the following error:

/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

1 Ответ

0 голосов
/ 12 мая 2020

Решение этой проблемы в моем случае было двояким:

  1. Я изменил способ настройки прав пользователя и способ изменения пользователя на:

    chmod -R g + rw / home / sama5d27

    chmod -R o + rw / home / sama5d27

    useradd -p user1 -s / bin / bash user1

  2. Затем я получил «ошибку размера блока ОС», которая была решена с помощью: https://github.com/openembedded/openembedded-core/blob/master/scripts/lib/wic/filemap.py

...