EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Ancient Yocto enforced by board manufacturer - "repo init" doesn't work

Started by Wojciech Zabolotny January 12, 2021
Hi,
I need to build Linux for Congatec QMX8 SMARC SBC.
The procedure is described here:
https://wiki.congatec.com/display/IMX8DOC/conga-QMX8+Yocto+2.5
It requires Ubuntu 2016.04, so I have created a virtual machine for it.
Unfortunately, the "repo init" doesn't work.

I get the following error:

gpg: keyring `/home/dev/.repoconfig/gnupg/secring.gpg' created
gpg: keyring `/home/dev/.repoconfig/gnupg/pubring.gpg' created
gpg: /home/dev/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 920F5C65: public key "Repo Maintainer <repo@android.kernel.org>" imported
gpg: key 692B382C: public key "Conley Owens <cco3@android.com>" imported
gpg: Total number processed: 2
gpg:               imported: 2  (RSA: 1)
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
From https://gerrit.googlesource.com/git-repo
   1469c28..0588f3d  main       -> origin/main
 * [new tag]         v2.11      -> v2.11
 * [new tag]         v2.11.1    -> v2.11.1
Traceback (most recent call last):
  File "/home/dev/yocto/input/.repo/repo/main.py", line 56, in <module>
    from subcmds.version import Version
  File "/home/dev/yocto/input/.repo/repo/subcmds/__init__.py", line 38, in <module>
    ['%s' % name])
  File "/home/dev/yocto/input/.repo/repo/subcmds/upload.py", line 27, in <module>
    from hooks import RepoHook
  File "/home/dev/yocto/input/.repo/repo/hooks.py", line 472
    file=sys.stderr)
        ^
SyntaxError: invalid syntax

So it looks, like "repo" performs autoupdate during the "repo init" and is not able to work any more, as it is not compatible with Python 2.7 (used by default in Ubuntu 2016.04.

When I try to enforce running "repo init" with python3, I get another error:

warning: Python 3 support is currently experimental. YMMV.
Please use Python 2.6 - 2.7 instead.
Traceback (most recent call last):
  File "/usr/bin/repo", line 860, in <module>
    main(sys.argv[1:])
  File "/usr/bin/repo", line 828, in main
    _Init(args, gitc_init=(cmd == 'gitc-init'))
  File "/usr/bin/repo", line 326, in _Init
    _CheckGitVersion()
  File "/usr/bin/repo", line 380, in _CheckGitVersion
    ver_act = ParseGitVersion(ver_str)
  File "/usr/bin/repo", line 350, in ParseGitVersion
    if not ver_str.startswith('git version '):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

So the updated repo is not compatible neither with Python 2 nor with Python 3 in Ubuntu 2016.04.
Can I somehow block updating the repo, so that it remains at old 1.13 version (compatible with Python 2.7)
May I use Yocto without repo at all, just using the git commands?
-- 
TIA & Regards,
Wojtek
wtorek, 12 stycznia 2021 o&nbsp;21:06:25 UTC+1 Wojciech Zabolotny napisa&#322;(a):
> Hi, > I need to build Linux for Congatec QMX8 SMARC SBC. > The procedure is described here: > https://wiki.congatec.com/display/IMX8DOC/conga-QMX8+Yocto+2.5 > It requires Ubuntu 2016.04, so I have created a virtual machine for it. > Unfortunately, the "repo init" doesn't work. > > I get the following error: > > gpg: keyring `/home/dev/.repoconfig/gnupg/secring.gpg' created > gpg: keyring `/home/dev/.repoconfig/gnupg/pubring.gpg' created > gpg: /home/dev/.repoconfig/gnupg/trustdb.gpg: trustdb created > gpg: key 920F5C65: public key "Repo Maintainer <re...@android.kernel.org>" imported > gpg: key 692B382C: public key "Conley Owens <cc...@android.com>" imported > gpg: Total number processed: 2 > gpg: imported: 2 (RSA: 1) > Get https://gerrit.googlesource.com/git-repo/clone.bundle > Get https://gerrit.googlesource.com/git-repo > From https://gerrit.googlesource.com/git-repo > 1469c28..0588f3d main -> origin/main > * [new tag] v2.11 -> v2.11 > * [new tag] v2.11.1 -> v2.11.1 > Traceback (most recent call last): > File "/home/dev/yocto/input/.repo/repo/main.py", line 56, in <module> > from subcmds.version import Version > File "/home/dev/yocto/input/.repo/repo/subcmds/__init__.py", line 38, in <module> > ['%s' % name]) > File "/home/dev/yocto/input/.repo/repo/subcmds/upload.py", line 27, in <module> > from hooks import RepoHook > File "/home/dev/yocto/input/.repo/repo/hooks.py", line 472 > file=sys.stderr) > ^ > SyntaxError: invalid syntax > > So it looks, like "repo" performs autoupdate during the "repo init" and is not able to work any more, as it is not compatible with Python 2.7 (used by default in Ubuntu 2016.04. > > When I try to enforce running "repo init" with python3, I get another error: > > warning: Python 3 support is currently experimental. YMMV. > Please use Python 2.6 - 2.7 instead. > Traceback (most recent call last): > File "/usr/bin/repo", line 860, in <module> > main(sys.argv[1:]) > File "/usr/bin/repo", line 828, in main > _Init(args, gitc_init=(cmd == 'gitc-init')) > File "/usr/bin/repo", line 326, in _Init > _CheckGitVersion() > File "/usr/bin/repo", line 380, in _CheckGitVersion > ver_act = ParseGitVersion(ver_str) > File "/usr/bin/repo", line 350, in ParseGitVersion > if not ver_str.startswith('git version '): > TypeError: startswith first arg must be bytes or a tuple of bytes, not str > > So the updated repo is not compatible neither with Python 2 nor with Python 3 in Ubuntu 2016.04. > Can I somehow block updating the repo, so that it remains at old 1.13 version (compatible with Python 2.7) > May I use Yocto without repo at all, just using the git commands? > -- > TIA & Regards, > Wojtek
OK. I've checked the sources of /usr/bin/repo and found the "--repo-branch" option. Then i've checked the available branches at https://gerrit.googlesource.com/git-repo . Use of: repo init --repo-branch repo-1 -u https://git.congatec.com/arm-nxp/imx8-family/yocto/manifest-imx8-family.git -b cgtimx8__sumo-4.14.98-2.3.2 does the trick. Wojtek
This is the Dockerfile, that I have used for compilation:
==============================
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y gawk wget \
      git-core diffstat unzip texinfo gcc-multilib build-essential chrpath \
      socat  libsdl1.2-dev xterm  sed cvs subversion coreutils texi2html \
      docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
      libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl \ 
      lzop asciidoc repo python3-pip 
RUN apt-get install cpio locales

RUN rm /bin/sh && ln -s -f /bin/bash /bin/sh

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

ENV USER_NAME dev
ENV PROJECT dev
ARG host_uid=1002
ARG host_gid=1002
RUN groupadd -g $host_gid $USER_NAME && \
    useradd -g $host_gid -m -s /bin/bash -u $host_uid $USER_NAME


USER $USER_NAME

ENV BUILD_INPUT_DIR /home/$USER_NAME/yocto/input
ENV BUILD_OUTPUT_DIR /home/$USER_NAME/yocto/output
RUN mkdir -p $BUILD_INPUT_DIR $BUILD_OUTPUT_DIR

WORKDIR $BUILD_INPUT_DIR
RUN apt show repo
RUN repo init --repo-branch repo-1 -u https://git.congatec.com/arm-nxp/imx8-family/yocto/manifest-imx8-family.git -b cgtimx8__sumo-4.14.98-2.3.2
RUN repo sync
RUN EULA=y MACHINE='imx8qm-cgtqmx8' DISTRO=fsl-imx-wayland source ./fsl-setup-release.sh -b build-qmx8 ; bitbake fsl-image-qt5

The 2024 Embedded Online Conference