do_rootfs fails when trying to build Yocto for poky recipe for sama5d27-som1-ek-sd

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

sramnath
Posts: 4
Joined: Fri May 01, 2020 6:05 pm

do_rootfs fails when trying to build Yocto for poky recipe for sama5d27-som1-ek-sd

Fri May 01, 2020 7:20 pm

Hello,

I've been following the steps on https://www.linux4sam.org/bin/view/Linux4SAM/PokyBuild to build a core-image-minimal and a microchip-headless-image for SAMA5D27 eval kit using Yocto. I am stuck at the do_rootfs command for both bitbake core-image-minimal and microchip-headless-image .

I have followed all steps in the above guide, and added a few more steps to make the steps work :

I'm using Docker with the following Dockerfile:

Code: Select all

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

Once I'm in the Docker container, I run a build script with the following commands to execute the steps in the guide :

Code: Select all

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


Here's the error message that I get - there's no explicit error mentioned, just 'exit with Code 1':

Code: Select all

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
blue_z
Location: USA
Posts: 2079
Joined: Thu Apr 19, 2007 10:15 pm

Re: do_rootfs fails when trying to build Yocto for poky recipe for sama5d27-som1-ek-sd

Tue May 05, 2020 8:47 pm

You actually have not "been following the steps" of the Linux4SAM guide because you created a script and "added a few more steps".
What did you end up with when you performed

Code: Select all

cp -f /local.conf /my_dir/poky/build-microchip/conf/local.conf
instead of editing the file?

Regards
sramnath
Posts: 4
Joined: Fri May 01, 2020 6:05 pm

Re: do_rootfs fails when trying to build Yocto for poky recipe for sama5d27-som1-ek-sd

Tue May 05, 2020 8:50 pm

That file that I copied in just had the recommended edits to the conf/local.conf and conf/bblayers.conf. if you check the scripts, they are just a script form of the steps mentioned. I have also done the above steps without having any script - just was a pain to redo the steps each time.
sramnath
Posts: 4
Joined: Fri May 01, 2020 6:05 pm

Re: do_rootfs fails when trying to build Yocto for poky recipe for sama5d27-som1-ek-sd

Tue May 05, 2020 8:58 pm

the step

Code: Select all

cp -f /local.conf /my_dir/poky/build-microchip/conf/local.conf
was just a simpler way of adding the recommended edits to the conf/local.conf file and conf/bblayers.conf file instead of making the edits each time. I started off by following each step, but it got tiresome so I made a local.conf and a bblayers.conf file that I copied into my docker container so that I could have the recommended edits done already after the

Code: Select all

source oe-init-build-env build-microchip
command.

And the 'script' contains the steps given in the guide, or extra packages that I needed to add while running the steps in the guide.
blue_z
Location: USA
Posts: 2079
Joined: Thu Apr 19, 2007 10:15 pm

Re: do_rootfs fails when trying to build Yocto for poky recipe for sama5d27-som1-ek-sd

Thu May 07, 2020 12:08 am

sramnath wrote: if you check the scripts, they are just a script form of the steps mentioned.
No, it is not just the original commands specified.
You have inserted some bizarre package installations, switching user, and changing permissions after the git cloning and build configuration has been set.
I don't know how to use Docker nor Yocto, but IMO the more sensible approach would be to perform such setup prior to any git cloning, as this guide does.

sramnath wrote: I have also done the above steps without having any script ...
Did you ever manually complete all of the steps and finish the core-image-minimal build?
IOW do you realize that the Linux4SAM directions and the current state of those git repositories will successfully complete the core-image-minimal build with zero errors but four warnings?
So that would implicate your build environment and/or your script as the cause of the error(s)?

sramnath wrote: ... just was a pain to redo the steps each time.
If you have to restart from step #1 each time, then the value of using Docker seems dubious.

Regards
sramnath
Posts: 4
Joined: Fri May 01, 2020 6:05 pm

Re: do_rootfs fails when trying to build Yocto for poky recipe for sama5d27-som1-ek-sd

Thu May 07, 2020 12:21 am

You have inserted some bizarre package installations
Those "bizarre" package installations are required when I run the steps as given. I am prompted to install them in order to move ahead. It does not allow me to run bitbake as root, so I added another user. It does not allow that user to make any modifications to the main directory, so I give it permissions to do so. As I am in a docker container, a lot of packages are not pre-installed.
Did you ever manually complete all of the steps and finish the core-image-minimal build? IOW do you realize that the Linux4SAM directions and the current state of those git repositories will successfully complete the core-image-minimal build with zero errors but four warnings?
No, I was not able to complete all the steps and finish the core-image-minimal build. Hence the question.
If you have to restart from step #1 each time, then the value of using Docker seems dubious.
We need to use Docker for CI/CD purposes.

I appreciate your advice to add the user and permissions before git clone. Thanks. Will try to follow advice given in the Yocto for Docker guide.

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 5 guests