| | |
| | | guowenxue@ubuntu22:~$ sudo apt install -y git ssh make gcc libssl-dev liblz4-tool \ |
| | | expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support unzip \ |
| | | qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib \ |
| | | device-tree-compiler python*-pip libncurses-dev libmpc-dev |
| | | device-tree-compiler libncurses-dev libmpc-dev python3 python2 python3-pip |
| | | ``` |
| | | |
| | | |
| | | |
| | | ***sdkv1.4.0_linux5.10*** 编译所需要的 Python版本依赖 **python3**。 |
| | | 这里我们同时安装了 python2 和 python3 两个版本,但Rockchip的 ***sdkv1.4.0_linux5.10*** 编译依赖 **python3**,这里我们通过 ubuntu 的 `update-alternatives` 命令设置默认版本为 **python3**。 |
| | | |
| | | ``` |
| | | guowenxue@ubuntu22:~$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 |
| | | guowenxue@ubuntu22:~$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 2 |
| | | guowenxue@ubuntu22:~$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 |
| | | guowenxue@ubuntu22:~$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 |
| | | guowenxue@ubuntu22:~$ sudo update-alternatives --config python |
| | | There are 2 choices for the alternative python (providing /usr/bin/python). |
| | | |
| | | Selection Path Priority Status |
| | | ------------------------------------------------------------ |
| | | * 0 /usr/bin/python3 2 auto mode |
| | | 1 /usr/bin/python3 1 manual mode |
| | | 2 /usr/bin/python2 2 manual mode |
| | | 1 /usr/bin/python2 1 manual mode |
| | | 2 /usr/bin/python3 2 manual mode |
| | | |
| | | Press <enter> to keep the current choice[*], or type selection number: 1 |
| | | Press <enter> to keep the current choice[*], or type selection number: 2 |
| | | |
| | | guowenxue@ubuntu22:~/rk3568$ python --version |
| | | guowenxue@ubuntu22:~$ python --version |
| | | Python 3.10.12 |
| | | ``` |
| | | |
| | |
| | | |
| | | |
| | | |
| | | RK3568 的 ***sdkv1.4.0_linux5.10*** 压缩包就存放在物理主机服务器下, 我们直接在工作路径下解压缩即可。 |
| | | 如果是在实验室的编译服务器物理主机上,我们可以直接从文件服务器路径那里解压缩过来。这个文件有18GB,解压缩需要一些时间。 |
| | | |
| | | ``` |
| | | ```bash |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ tar -xjf /srv/ftp/rockchip/bsp/rk3568_linuxsdk/sdkv1.4.0_linux5.10/rk356x_linux5.10_release_v1.4.0_20231220.tar.bz2 |
| | | ``` |
| | | |
| | | |
| | | |
| | | 解压缩出来的源码都在隐藏的 ***.repo*** 文件夹下,接下来我们使用 **repo** 命令将源码 checkout 出来。 |
| | | 否则可以使用下面命令从凌云实验室文件服务器上下载并解压缩。 |
| | | |
| | | ```bash |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ wget http://192.168.0.2:2211/rockchip/bsp/rk3568_linuxsdk/sdkv1.4.0_linux5.10/rk356x_linux5.10_release_v1.4.0_20231220.tar.bz2 |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ tar -xjf rk356x_linux5.10_release_v1.4.0_20231220.tar.bz2 |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ rm -f *.tar.bz2 |
| | | ``` |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ ls -a |
| | | . .. .repo |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ du -sh .repo/ |
| | | 18G .repo/ |
| | | |
| | | |
| | | 解压缩出来的源码都在隐藏的 ***.repo*** 文件夹下。 |
| | | |
| | | ```bash |
| | | guowenxue@ubuntu22:/build/rk3568/sdkv1.3.0_linux4.19$ ls -a |
| | | . .. .repo |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ ls .repo/ |
| | | manifests manifests.git manifest.xml project.list project-objects projects repo |
| | | ``` |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ ls .repo/repo/repo |
| | | .repo/repo/repo |
| | | test@ubuntu22:/work/test/sdkv1.4.0_linux5.10$ .repo/repo/repo sync -l |
| | | |
| | | |
| | | 接下来我们需要使用 **repo** 命令将源码 checkout 出来。 |
| | | |
| | | ```bash |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ .repo/repo/repo sync -l |
| | | Traceback (most recent call last): |
| | | File "/work/test/sdkv1.4.0_linux5.10/.repo/repo/main.py", line 56, in <module> |
| | | File "/build/rk3568/sdkv1.4.0_linux5.10/.repo/repo/main.py", line 56, in <module> |
| | | from subcmds.version import Version |
| | | File "/work/test/sdkv1.4.0_linux5.10/.repo/repo/subcmds/__init__.py", line 35, in <module> |
| | | File "/build/rk3568/sdkv1.4.0_linux5.10/.repo/repo/subcmds/__init__.py", line 35, in <module> |
| | | mod = __import__(__name__, |
| | | File "/work/test/sdkv1.4.0_linux5.10/.repo/repo/subcmds/help.py", line 20, in <module> |
| | | File "/build/rk3568/sdkv1.4.0_linux5.10/.repo/repo/subcmds/help.py", line 20, in <module> |
| | | from formatter import AbstractFormatter, DumbWriter |
| | | ModuleNotFoundError: No module named 'formatter' |
| | | ``` |
| | | |
| | | |
| | | |
| | | 出现上面这个问题是因为 **Python3** 已经移除了 `formatter` 的支持,这时候我们可以先将 Python 版本切换为 **Python2** ,等 `repo` sync成功之后,再切回到 Python3 上去。 |
| | | 上面这个错误信息提示在 ***subcmds/help.py*** 中导入了 `formatter` 模块, 在Python2的formatter模块中,`AbstractFormatter` 和 `DumbWriter` 可能用于生成格式化的文本,比如将文本自动换行,处理缩进等。 |
| | | |
| | | - `AbstractFormatter`: 定义文本格式化逻辑的基类。 |
| | | - `DumbWriter`: 将格式化后的文本写入缓冲区。 |
| | | |
| | | |
| | | |
| | | 在 Python3 中该模块已被移除,而Python3 的 `textwrap` 模块提供了更简单的文本自动换行和缩进功能。如果代码需要基本的文本格式化(如帮助信息的换行),可以用 `textwrap` 直接替代。这样,我们可以修改 |
| | | |
| | | ```bash |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ sudo update-alternatives --config python |
| | | There are 2 choices for the alternative python (providing /usr/bin/python). |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ vim .repo/repo/subcmds/help.py |
| | | ... ... |
| | | -from formatter import AbstractFormatter, DumbWriter |
| | | +import textwrap |
| | | +class TextWrapper: |
| | | + def __init__(self, width=80): |
| | | + self.width = width |
| | | + |
| | | + def add_flowing_data(self, text): |
| | | + return textwrap.fill(text, width=self.width) |
| | | ... ... |
| | | |
| | | - self.wrap = AbstractFormatter(DumbWriter()) |
| | | + self.wrap = TextWrapper() |
| | | ``` |
| | | |
| | | Selection Path Priority Status |
| | | ------------------------------------------------------------ |
| | | * 0 /usr/bin/python3 2 auto mode |
| | | 1 /usr/bin/python3 1 manual mode |
| | | 2 /usr/bin/python2 2 manual mode |
| | | |
| | | Press <enter> to keep the current choice[*], or type selection number: 2 |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ python --version |
| | | Python 2.7.18 |
| | | 这个文件也可以从实验室服务器上下载过来,然后直接覆盖。 |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ .repo/repo/repo sync -l |
| | | Updating files: 100% (13563/13563), done. |
| | | Updating files: 100% (737/737), done.nux/buildrootUpdating files: 26% (197/737) |
| | | Updating files: 100% (778/778), done.nux/debianUpdating files: 20% (160/778) |
| | | Updating files: 100% (228/228), done.nux/bsp/docsUpdating files: 27% (62/228) |
| | | Updating files: 100% (2195/2195), done.ux/external/alsa-configUpdating files: 8% (197/2195) |
| | | Updating files: 100% (227/227), done.inux/external/camera_engine_rkaiqUpdating files: 1% (4/227) |
| | | Updating files: 100% (152/152), done.inux/external/chromiumUpdating files: 48% (74/152) |
| | | Updating files: 100% (166/166), done.inux/gstreamer-rockchipUpdating files: 35% (59/166) |
| | | Updating files: 100% (237/237), done.inux/external/rk_pcba_testUpdating files: 40% (97/237) |
| | | Updating files: 100% (1203/1203), done.rknn-toolkit2Updating files: 11% (135/1203) |
| | | Updating files: 100% (5531/5531), done.ux/external/rkupdateUpdating files: 98% (5430/5531) |
| | | Updating files: 100% (81714/81714), done./xserverUpdating files: 8% (6747/81714) |
| | | Updating files: 100% (5939/5939), done.kernelUpdating files: 18% (1082/5939) |
| | | Updating files: 100% (5722/5722), done.prebuilts/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnuUpdating files: 16% (950/5722) |
| | | Updating files: 100% (248/248), done.k/rkbinUpdating files: 49% (122/248) |
| | | Updating files: 100% (13755/13755), done./toolsUpdating files: 23% (3237/13755) |
| | | Updating files: 100% (166/166), done.inux/pokyUpdating files: 8% (14/166) |
| | | Updating files: 100% (6157/6157), done.ux/pokyUpdating files: 30% (1893/6157) |
| | | Checking out projects: 100% (50/50), done. |
| | | ```bash |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ wget http://192.168.0.2:2211/rockchip/bsp/rk3568_linuxsdk/sdkv1.4.0_linux5.10/help.py |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ mv help.py .repo/repo/subcmds/help.py |
| | | ``` |
| | | |
| | | |
| | | |
| | | 接下来我们就可以使用 **repo** 命令将源码 checkout 出来。 |
| | | |
| | | ``` |
| | | guowenxue@ubuntu22:/build/rk3568/sdkv1.3.0_linux4.19$ .repo/repo/repo sync -l |
| | | Updating files: 100% (17139/17139), done./app/rkaiq_tool_serverUpdating files: 51% (8839/17139) |
| | | Updating files: 100% (779/779), done.inux/buildrootUpdating files: 41% (322/779) |
| | | Updating files: 100% (1171/1171), done.ux/debianUpdating files: 72% (844/1171) |
| | | Updating files: 100% (248/248), done.inux/device/rockchipUpdating files: 10% (25/248) |
| | | Updating files: 100% (247/247), done.inux/bsp/docsUpdating files: 45% (112/247) |
| | | Updating files: 100% (1493/1493), done.ux/bsp/external/broadcom_bsaUpdating files: 41% (622/1493) |
| | | Updating files: 100% (127/127), done.inux/external/libglCompositorUpdating files: 44% (56/127) |
| | | Updating files: 100% (118/118), done.inux/external/rkfacialUpdating files: 29% (35/118) |
| | | Updating files: 100% (921/921), done.k/rknn-toolkit2Updating files: 5% (52/921) |
| | | Updating files: 100% (368/368), done.inux/external/rkupdateUpdating files: 22% (84/368) |
| | | Updating files: 100% (186/186), done.inux/external/rkwifibtUpdating files: 59% (110/186) |
| | | Updating files: 100% (2109/2109), done.ux/security/binUpdating files: 15% (332/2109) |
| | | Updating files: 100% (33/33), done. android/rk/platform/system/rk_tee_userUpdating files: 93% (31/33) |
| | | Updating files: 100% (72280/72280), done./external/uvc_appUpdating files: 3% (2631/72280) |
| | | Updating files: 100% (17900/17900), done.rnelUpdating files: 34% (6102/17900) |
| | | Updating files: 100% (7165/7165), done.prebuilts/gcc-buildroot-9.3.0-2020.03-x86_64_aarch64-rockchip-linux-gnuUpdating files: 13% (949/7165) |
| | | Updating files: 100% (236/236), done.k/rkbinUpdating files: 46% (109/236) |
| | | Updating files: 100% (13576/13576), done./toolsUpdating files: 88% (12076/13576) |
| | | Checking out projects: 100% (65/65), done. |
| | | repo sync has finished successfully. |
| | | |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ ls |
| | | app buildroot build.sh debian device docs envsetup.sh external kernel Makefile prebuilts rkbin rkflash.sh tools u-boot yocto |
| | | guowenxue@ubuntu22:/build/rk3568/sdkv1.3.0_linux4.19$ ls |
| | | app buildroot build.sh debian device docs envsetup.sh external kernel Makefile mkfirmware.sh prebuilts rkbin rkflash.sh tools u-boot yocto |
| | | ``` |
| | | |
| | | |
| | |
| | | ``` |
| | | guowenxue@ubuntu22:~/rk3568/sdkv1.4.0_linux5.10$ ls docs/ |
| | | cn en licenses Patches readme_en.pdf readme_zh.pdf |
| | | ``` |
| | | |
| | | |
| | | |
| | | 完成之后,再将 Python 版本切换为 Python3。 |
| | | |
| | | ```bash |
| | | guowenxue@ubuntu22:~$ sudo update-alternatives --config python |
| | | There are 2 choices for the alternative python (providing /usr/bin/python). |
| | | |
| | | Selection Path Priority Status |
| | | ------------------------------------------------------------ |
| | | * 0 /usr/bin/python3 2 auto mode |
| | | 1 /usr/bin/python3 1 manual mode |
| | | 2 /usr/bin/python2 2 manual mode |
| | | |
| | | Press <enter> to keep the current choice[*], or type selection number: 1 |
| | | |
| | | guowenxue@ubuntu22:~/rk3568$ python --version |
| | | Python 3.10.12 |
| | | ``` |
| | | |
| | | |