问题描述:
在参考正点原子文档《I.MX6U 构建Yocto根文件系统V1.3》,执行如下命令:
./repo init -u https://source.codeaurora.org/external/imx/fsl-arm-yocto-bsp -b imx-4.1-krogoth
出现以下的异常,导致程序终止,如下所示:
File "./repo", line 175
except OSError, e:
^
SyntaxError: invalid syntax问题分析:
这种问题一般都是安装了python3后修改了连接导致指向python版本有问题
解决方法:
将python版本修改为python2.7即可;
在ubuntu terminal 执行以下命令:
sudo update-alternatives –config python执行以上命令出现以下的 error:
sudo update-alternatives –-config python
update-alternatives: error: unknown argument '–-config'以上error解决参考链接:python 切换系统默认版本
重新执行以上的命令即可,如下所示:
gcf@ubuntu:~/workfile/zdyz/yocto/fsl-release-bsp$ cat repo.sh
./repo init -u https://source.codeaurora.org/external/imx/fsl-arm-yocto-bsp -b imx-4.1-krogoth
gcf@ubuntu:~/workfile/zdyz/yocto/fsl-release-bsp$ ./repo.sh
Getting repo ...
from git://codeaurora.org/tools/repo.git
remote: Enumerating objects: 220, done.
remote: Counting objects: 100% (220/220), done.
remote: Compressing objects: 100% (220/220), done.
remote: Total 7231 (delta 3), reused 207 (delta 0), pack-reused 7011
Receiving objects: 100% (7231/7231), 2.02 MiB | 11.00 KiB/s, done.
Resolving deltas: 100% (5075/5075), done.
From git://codeaurora.org/tools/repo
* [new branch] aosp-new/main -> origin/aosp-new/main
* [new branch] aosp-new/maint -> origin/aosp-new/maint
* [new branch] aosp-new/master -> origin/aosp-new/master
* [new branch] aosp-new/repo-1 -> origin/aosp-new/repo-1
* [new branch] aosp-new/stable -> origin/aosp-new/stable
* [new branch] caf-stable -> origin/caf-stable
* [new branch] master -> origin/master
* [new branch] qc-stable -> origin/qc-stable
* [new branch] repo-2 -> origin/repo-2
………………
* [new branch] nxp/imx-morty -> origin/nxp/imx-morty
* [new branch] nxp/scm-imx-3.14.52-1.1.0_ga -> origin/nxp/scm-imx-3.14.52-1.1.0_ga
* [new branch] nxp/scm-imx-3.14.52-1.1.1_ga -> origin/nxp/scm-imx-3.14.52-1.1.1_ga
Your Name [xxxxxxxx]:
Your Email [xxxxxxxx@126.com]:
Your identity is: xxxxxxx <xxxxxxx>
is this correct [y/n]? y
Testing colorized output (for 'repo diff', 'repo status'):
black red green yellow blue magenta cyan white
bold dim ul reverse
Enable color display in this user account (y/n)? y
repo initialized in /home/gcf/workfile/zdyz/yocto/fsl-release-bsp
获取完成后,可以看到在当前路径的目录下多了一个.repo 文件夹。
gcf@ubuntu:~/workfile/zdyz/yocto/fsl-release-bsp$ ls -a
. .. repo .repo repo.sh repo.tar.bz2接下来,参考《I.MX6U 构建Yocto根文件系统V1.3》文档,继续执行后续的内容;
版权声明:本文为qq_18423275原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。