Cannot install Linux Source for FX-30 R11.0

I’m trying to install the linux source for FX30-CATM (Release R11.0.0.007 + Legato 18.09.4) on Ubuntu 20.04 using the command: leaf getsrc swi-linux the install fails because the source references two packages that are no longer available: python-git and repo, so the install fails with:

Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                  
Hit:6 https://downloads.sierrawireless.com/tools/debian release/ InRelease                        
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libsdl1.2-dev' instead of 'libsdl-dev'
Note, selecting 'git' instead of 'git-core'
Package python-git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python-git-doc

E: Package 'python-git' has no installation candidate
E: Unable to locate package repo
ERROR:
  Profile provisioning interrupted
CAUSED BY:
  Error while installing required packages (Error during sync step for swi-verify-aptdeps_1.6.191122 (command returned 100))

How can I install the linux source for this release.

Update:
I decided to go back to the same version of linux that I had successfully built the R9 sources on: Ubuntu 16.04. I now get further but get a different error when I use the leaf getsrc command:

Run sync steps for fx30-catm-linux-src_R11.0.0.007

Ready to sync in /home/<mylinuxuser>/myWorkspace/swi-linux-src directory:
repo init -u ssh://<myusername>@gerrit.legato.io:29418/manifest -m mdm9x06/tags/SWI9X06Y_02.22.12.00/linux.xml -g default,-cache ; repo sync

Proceed? (Y/n)
Y
Checking credentials...
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Counting objects: 2, done
remote: Finding sources: 100% (64/64)
remote: Total 64 (delta 25), reused 64 (delta 25)
Unpacking objects: 100% (64/64), done.
From https://gerrit.googlesource.com/git-repo
   2a2da80..21dce3d  main       -> origin/main
 * [new tag]         v2.12.1    -> v2.12.1
 * [new tag]         v2.12.2    -> v2.12.2
  File "/home/<mylinuxuser>/myWorkspace/swi-linux-src/.repo/repo/main.py", line 79
    file=sys.stderr)
        ^
SyntaxError: invalid syntax
ERROR:
  Something went wrong with `repo` command

I’m also posting this on Legato Forums as I’m not sure which is the best audience for this issue.

repo on Ubuntu 18+ (so also 20)now requires python3.

Try running

python3 /usr/bin/repo sync

(or edit /usr/bin/repo as root and replace in first line python with python3)

@andris.pavenis Thanks for that. I editing /usr/bin/repo to use python3 now when I run I get this:

leaf getsrc swi-linux
Run sync steps for fx30-catm-linux-src_R11.0.0.007

Ready to sync in /home/dcchurchill/myWorkspace/swi-linux-src directory:
repo init -u ssh://david.churchill@thingtech.com@gerrit.legato.io:29418/manifest -m mdm9x06/tags/SWI9X06Y_02.22.12.00/linux.xml -g default,-cache ; repo sync

Proceed? (Y/n)
Y
Checking credentials...
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
ERROR:
  Something went wrong with `repo` command

As I noted above I am now using Ubuntu 16.04, do I need to move up to 18+ or back to 20.04?

I hav not tried Ubuntu 16 or 20 with swi-linux, only 18.

Perhaps there is no need to require python3 for Ubuntu 16. I understood that You initially tried 20

I needed it tun run repo in Ubuntu 18 and I think one very likely needs it also for version 20.

OK, maybe I’ll try 18 as I can’t even get repo installed on 20.

Tried on 18.04 same errors as 16.04. Not sure how to proceed now.

Hi David,
What version of repo are you using?

Could you try installing python3:
sudo apt-get install python3 python3-requests python3-argcomplete python3-all python3-setuptools

BR,
Chris

Not sure how to determine the version of repo, in the file /usr/bin/repo, line 23 says: VERSION = (1, 22)

I re-installed Python 3 (version is 3.6.12) and re-ran leaf getsrc swi-linux and am still getting:

dcchurchill@ubuntu:~/myWorkspace$ leaf getsrc swi-linux
Fetching remote legato-stable
Fetching remote legato-dev
Run sync steps for fx30-catm-linux-src_R11.0.0.007

Ready to sync in /home/dcchurchill/myWorkspace/swi-linux-src directory:
repo init -u ssh://david.churchill@thingtech.com@gerrit.legato.io:29418/manifest -m mdm9x06/tags/SWI9X06Y_02.22.12.00/linux.xml -g default,-cache ; repo sync

Proceed? (Y/n)
Y
Checking credentials...
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 859, in <module>
    main(sys.argv[1:])
  File "/usr/bin/repo", line 827, in main
    _Init(args, gitc_init=(cmd == 'gitc-init'))
  File "/usr/bin/repo", line 326, in _Init
    _CheckGitVersion()
  File "/usr/bin/repo", line 379, 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
ERROR:
  Something went wrong with `repo` command
HINTS:
  Please check connection and credentials
  Then try again leaf getsrc swi-linux
Skipping FX30 update: source folder not found (/home/dcchurchill/myWorkspace/swi-linux-src)

I managed to get the repo version:

dcchurchill@ubuntu:~/myWorkspace/swi-linux-src$ python3 /usr/bin/repo --version
warning: Python 3 support is currently experimental. YMMV.
Please use Python 2.6 - 2.7 instead.

... A new version of repo (2.11) is available.
... New version is available at: /home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/repo
... The launcher is run from: /usr/bin/repo
!!! The launcher is not writable.  Please talk to your sysadmin or distro
!!! to get an update installed.

repo version v2.11.1
       (from https://gerrit.googlesource.com/git-repo)
       (Thu, 7 Jan 2021 22:44:53 +0000)
repo launcher version 1.22
       (from /usr/bin/repo)
       (currently at 2.11.1)
repo User-Agent git-repo/2.11.1 (Linux) git/2.7.4 Python/3.6.12
git 2.7.4
git User-Agent git/2.7.4 (Linux) git-repo/2.11.1
Python 3.6.12 (default, Aug 18 2020, 02:08:22) 
[GCC 5.4.0 20160609]
OS Linux 4.15.0-112-generic (#113~16.04.1-Ubuntu SMP Fri Jul 10 04:37:08 UTC 2020)
CPU x86_64 (x86_64)

Finally got this to work! In case anyone’s interested here was my solution:

Set python symbolic link to point to python 3:
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python

Back-up copy of /usr/bin/repo:
sudo cp /usr/bin/repo /usr/bin/repo.bak

Download copy of repo from https://storage.googleapis.com/git-repo-downloads/repo to /usr/bin/repo replacing original /usr/bin/repo

Ran leaf getsrc swi-linux and got this error:

Downloading manifest from ssh://david.churchill@thingtech.com@gerrit.legato.io:29418/manifest
Traceback (most recent call last):
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 627, in <module>
    _Main(sys.argv[1:])
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 601, in _Main
    result = run()
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 594, in <lambda>
    run = lambda: repo._Run(name, gopts, argv) or 0
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 260, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/subcmds/init.py", line 519, in Execute
    self._SyncManifest(opt)
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/subcmds/init.py", line 220, in _SyncManifest
    default_branch = m.ResolveRemoteHead()
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/project.py", line 1914, in ResolveRemoteHead
    output = self.bare_git.ls_remote('-q', '--symref', '--exit-code', name, 'HEAD')
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/project.py", line 3034, in runner
    (self._project.name, name, p.stderr))
error.GitError: manifests ls-remote: usage: git ls-remote [--heads] [--tags]  [--upload-pack=<exec>]
                     [-q | --quiet] [--exit-code] [--get-url] [<repository> [<refs>...]]

Opened /home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/project.py and put the following line in at line #3026: print("Name: {} args: {}".format(name, args))

Re-ran leaf getsrc swi-linux and got this error:

Name: var args: ('GIT_COMMITTER_IDENT',)
Traceback (most recent call last):
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 627, in <module>
    _Main(sys.argv[1:])
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 601, in _Main
    result = run()
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 594, in <lambda>
    run = lambda: repo._Run(name, gopts, argv) or 0
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/main.py", line 260, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/subcmds/init.py", line 524, in Execute
    self._ConfigureUser(opt)
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/subcmds/init.py", line 380, in _ConfigureUser
    name = self._Prompt('Your Name', mp.UserName)
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/project.py", line 613, in UserName
    self._LoadUserIdentity()
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/project.py", line 626, in _LoadUserIdentity
    u = self.bare_git.var('GIT_COMMITTER_IDENT')
  File "/home/dcchurchill/myWorkspace/swi-linux-src/.repo/repo/project.py", line 3035, in runner
    (self._project.name, name, p.stderr))
error.GitError: manifests var: 
*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'dcchurchill@ubuntu.(none)')

Ran (with my actual e-mail and name):
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Ran leaf getsrc swi-linux one more time and it worked!

1 Like