diff options
author | 2024-11-19 19:11:11 +0800 | |
---|---|---|
committer | 2024-11-19 19:11:11 +0800 | |
commit | 5b2044df70be812a9c977da98418cfffa555b951 (patch) | |
tree | 3222c7af85e98fcabce3a50001b8ccecf1590b61 | |
parent | 1e0c20812454ae1c7e1cf83f953797ee042e831f (diff) | |
download | myweb-5b2044df70be812a9c977da98418cfffa555b951.tar.gz myweb-5b2044df70be812a9c977da98418cfffa555b951.zip |
Addd more to ohos compile
-rw-r--r-- | code/projects/ohos_compile.html | 226 | ||||
-rw-r--r-- | code/projects/ohos_compile.md | 194 | ||||
-rw-r--r-- | common/script4works.html | 2 | ||||
-rw-r--r-- | common/script4works.js | 2 |
4 files changed, 369 insertions, 55 deletions
diff --git a/code/projects/ohos_compile.html b/code/projects/ohos_compile.html index bf72035..fd52643 100644 --- a/code/projects/ohos_compile.html +++ b/code/projects/ohos_compile.html | |||
@@ -5,20 +5,17 @@ | |||
5 | <meta charset="utf-8" /> | 5 | <meta charset="utf-8" /> |
6 | <meta name="generator" content="pandoc" /> | 6 | <meta name="generator" content="pandoc" /> |
7 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> |
8 | <title>OpenHarmony 3.2 编译</title> | 8 | <title>OHOS全量编译记录</title> |
9 | <link rel="stylesheet" href="https://www.qin-juan-ge-zhu.top/common/CSS/pandoc.css"> | 9 | <link rel="stylesheet" href="https://test.qin-juan-ge-zhu.top/common/CSS/pandoc.css"> |
10 | <script type="text/javascript" src="https://www.qin-juan-ge-zhu.top/common/js/myhighlight.js"></script> | 10 | <script type="text/javascript" src="https://test.qin-juan-ge-zhu.top/common/js/myhighlight.js"></script> |
11 | <script type="text/javascript" src="https://www.qin-juan-ge-zhu.top/common/script4code.js"></script> | 11 | <script type="text/javascript" src="https://test.qin-juan-ge-zhu.top/common/script4code.js"></script> |
12 | </head> | 12 | </head> |
13 | 13 | ||
14 | <body> | 14 | <body> |
15 | <div class="pandoc"> | 15 | <div class="pandoc"> |
16 | <div class="main"> | 16 | <div class="main"> |
17 | <header id="title-block-header"> | 17 | <p class="title">OHOS 全量编译记录</p> |
18 | <p class="title">OpenHarmony 3.2 编译</p> | ||
19 | </header> | ||
20 | <!-- 鸿蒙开发环境搭建 --> | 18 | <!-- 鸿蒙开发环境搭建 --> |
21 | <p>[toc]</p> | ||
22 | <blockquote> | 19 | <blockquote> |
23 | <p>本次编译环境搭建参考了以下博客:</p> | 20 | <p>本次编译环境搭建参考了以下博客:</p> |
24 | <ul> | 21 | <ul> |
@@ -39,7 +36,8 @@ | |||
39 | <h2 id="硬件环境">硬件环境</h2> | 36 | <h2 id="硬件环境">硬件环境</h2> |
40 | <p>编译过程使用的是 | 37 | <p>编译过程使用的是 |
41 | <code>Ubuntu</code>,经测试,<code>Ubuntu 22.04 LTS</code>/<code>Ubuntu 20.04 LTS</code>/<code>Ubuntu 18.04 LTS</code> | 38 | <code>Ubuntu</code>,经测试,<code>Ubuntu 22.04 LTS</code>/<code>Ubuntu 20.04 LTS</code>/<code>Ubuntu 18.04 LTS</code> |
42 | 均可用。</p> | 39 | 均可用。 |
40 | </p> | ||
43 | <p>网上的大多数博客里没有对编译的硬件限制作出说明,现根据我们的情况,给出一个大概的范围:</p> | 41 | <p>网上的大多数博客里没有对编译的硬件限制作出说明,现根据我们的情况,给出一个大概的范围:</p> |
44 | <ul> | 42 | <ul> |
45 | <li><strong>内存必须在 10G 以上</strong>,我使用的是 13G,编译成功(8G 时编译失败了,下文会说明)</li> | 43 | <li><strong>内存必须在 10G 以上</strong>,我使用的是 13G,编译成功(8G 时编译失败了,下文会说明)</li> |
@@ -109,39 +107,45 @@ ssh-keygen -t rsa -C "your-email-address"</code></pre> | |||
109 | <p>此时,我们就可以通过 ssh 的方式与 gitee 进行交互、也可以免密提交代码了。</p> | 107 | <p>此时,我们就可以通过 ssh 的方式与 gitee 进行交互、也可以免密提交代码了。</p> |
110 | <h1 id="系统源码编译">系统源码编译</h1> | 108 | <h1 id="系统源码编译">系统源码编译</h1> |
111 | <h2 id="配置-repo-工具">配置 repo 工具</h2> | 109 | <h2 id="配置-repo-工具">配置 repo 工具</h2> |
112 | <p><strong>注意:前两条命令需要以 root 身份执行!!!</strong></p> | 110 | <pre><code>curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > ~/repo |
113 | <pre><code># 以下两条命令需要以root身份执行 | 111 | chmod a+x ~/repo |
114 | sudo -s | 112 | sudo mv ~/repo /usr/local/bin/repo |
115 | curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo | 113 | sudo chown root:root /usr/local/bin/repo |
116 | chmod a+x /usr/local/bin/repo | ||
117 | exit | ||
118 | 114 | ||
119 | # 这条普通身份也可以 | ||
120 | pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests</code></pre> | 115 | pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests</code></pre> |
121 | <p>之所以前两条命令需要以 root 身份而不能是 sudo,是因为<code>/usr/local/bin</code>是一个只有 root 用户才有写权限的目录,而 sudo 命令虽然是以 root | 116 | <p>需要注意的是,不能直接使用 sudo 搭配管道,这是因为<code>/usr/local/bin</code>是一个只有 root 用户才有写权限的目录,而 sudo 命令虽然是以 root |
122 | 身份执行,但<strong>重定向时候 sudo 用的也是当前用户身份</strong>,权限不足,自然报错。(<strong>如果是管道,那么 sudo | 117 | 身份执行,但<strong>重定向时候 sudo 用的也是当前用户身份</strong>,权限不足,自然报错。(<strong>如果是管道,那么 sudo |
123 | 也是只对当前命令有效,而不是对后续的整个管道有效。</strong>)</p> | 118 | 也是只对当前命令有效,而不是对后续的整个管道有效。</strong>)</p> |
124 | <h2 id="获取源码">获取源码</h2> | 119 | <h2 id="获取源码">获取源码</h2> |
120 | <p>这里需要注意的是,一般情况下最好使用带有 v 和 Release 的版本。不带 Release 不是发布版,会随时更新代码,容易编译出错;带 Release 的也有两种 tag,是带 v 和不带 v | ||
121 | 的区别,如<code>OpenHarmony-v4.0-Release</code>和<code>OpenHarmony-4.0-Release</code>。二者的区别主要在于,不带 v | ||
122 | 的是官方维护的稳定版,也会更新代码,厂商的补丁一般只针对带 v 的使用。</p> | ||
125 | <p>通过 repo + https/ssh 下载:</p> | 123 | <p>通过 repo + https/ssh 下载:</p> |
126 | <pre><code># 通过http下载,这里需要注意你需要的ohos的版本 | 124 | <pre><code># 如果需要的是特定分支,-b后边改成对应分支名 |
127 | repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify | 125 | # repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify |
128 | # 如果需要的是特定分支,-b后边改成对应分支名 | ||
129 | # 如果是tag,-b后的参数比较复杂,要在网页上提前确定好需要的tag名字, | 126 | # 如果是tag,-b后的参数比较复杂,要在网页上提前确定好需要的tag名字, |
130 | # 如下载的是tag为OpenHarmony-v3.2-Release的版本,命令如下: | 127 | # 如下载的是tag为OpenHarmony-v3.2-Release的版本,命令如下: |
131 | # repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v3.2-Release --no-repo-verify | 128 | # repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v3.2-Release --no-repo-verify |
132 | # 除使用https外,也可以通过ssh下载 | 129 | # 除使用https外,也可以通过ssh下载 |
133 | # repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify | 130 | # repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify |
134 | 131 | repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v4.0-Release --no-repo-verify | |
135 | repo sync -c | 132 | repo sync -c |
136 | repo forall -c 'git lfs pull'</code></pre> | 133 | repo forall -c 'git lfs pull'</code></pre> |
137 | <h2 id="prebuilts-与编译">prebuilts 与编译</h2> | 134 | <h2 id="补丁与编译">补丁与编译</h2> |
135 | <p>首先,打上厂商的补丁。下载对应版本补丁后,将补丁文件放到源码根目录下,执行:</p> | ||
136 | <pre><code>unzip purple_pi_oh_patch.zip | ||
137 | cd purple_pi_oh_patch | ||
138 | ./ido_patch.sh</code></pre> | ||
139 | <p>看到<code>patch complete</code>字样,说明补丁成功。接下来进行 prebuilts 和编译:</p> | ||
138 | <pre><code># 先在源码根目录下执行脚本,安装编译器及二进制工具 | 140 | <pre><code># 先在源码根目录下执行脚本,安装编译器及二进制工具 |
139 | bash build/prebuilts_download.sh | 141 | bash build/prebuilts_download.sh |
140 | # 再执行如下命令进行版本编译 | 142 | |
143 | # 编译 | ||
141 | # 注意:默认编译的时候,目标cpu是32位,即使为64位cpu也无法使用64位功能 | 144 | # 注意:默认编译的时候,目标cpu是32位,即使为64位cpu也无法使用64位功能 |
142 | sudo ./build.sh --product-name rk3568 --ccache | ||
143 | # 如果是64位cpu,需要加上--target-cpu=arm64 | 145 | # 如果是64位cpu,需要加上--target-cpu=arm64 |
144 | sudo ./build.sh --product-name rk3568 --ccache --target-cpu=arm64</code></pre> | 146 | # 编译rk3568时 |
147 | # sudo ./build.sh --product-name rk3568 --ccache --target-cpu=arm64 | ||
148 | sudo ./build.sh --product-name purple_pi_oh --ccache --no-prebuilt-sdk --target-cpu=arm64</code></pre> | ||
145 | <h2 id="编译完成">编译完成</h2> | 149 | <h2 id="编译完成">编译完成</h2> |
146 | <p>编译所生成的文件都归档在 out 目录下,结果镜像输出在源码根目录下的<code>out/rk3568/packages/phone/images</code>目录下。</p> | 150 | <p>编译所生成的文件都归档在 out 目录下,结果镜像输出在源码根目录下的<code>out/rk3568/packages/phone/images</code>目录下。</p> |
147 | <p>自此源码编译成功,即可进行镜像烧录。</p> | 151 | <p>自此源码编译成功,即可进行镜像烧录。</p> |
@@ -181,14 +185,75 @@ sudo ./build.sh --product-name rk3568 --ccache --target-cpu=arm64</code></pre> | |||
181 | sudo mount -o remount -rw / | 185 | sudo mount -o remount -rw / |
182 | sudo mount -o remount -rw /var/snap/firefox/common/host-hunspell</code></pre> | 186 | sudo mount -o remount -rw /var/snap/firefox/common/host-hunspell</code></pre> |
183 | <p>而后在 gparted 中点击<code>gparted->刷新设备</code>,即可进行分区扩展。</p> | 187 | <p>而后在 gparted 中点击<code>gparted->刷新设备</code>,即可进行分区扩展。</p> |
188 | <h2 id="ninja-编译报错-code-4000">Ninja 编译报错 <code>Code 4000</code></h2> | ||
189 | <p>编译 rk3568 过程中可能会出现以下报错:</p> | ||
190 | <pre><code>[OHOS ERROR] Code: 4000 | ||
191 | [OHOS ERROR] Reason: ninja phase failed</code></pre> | ||
192 | <p>详细的报错信息已经丢失,将就着看吧。反正别的办法都不好使的时候试试这个。</p> | ||
193 | <p>此时执行以下内容即可:</p> | ||
194 | <pre><code>rm -rf out | ||
195 | sed -i 's/CONFIG_DEBUG_INFO_BTF=y/# CONFIG_DEBUG_INFO_BTF=y/g' kernel/linux/config/linux-5.10/rk3568/arch/arm64_defconfig</code></pre> | ||
196 | <p>而后重新编译。</p> | ||
197 | <h2 id="另一个code-4000">另一个<code>Code 4000</code></h2> | ||
198 | <p>编译时报错如下:</p> | ||
199 | <pre><code>ninja: build stopped: subcommand failed. | ||
200 | [91m[OHOS ERROR][0m Traceback (most recent call last): | ||
201 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/services/ninja.py", line 49, in _execute_ninja_cmd | ||
202 | [91m[OHOS ERROR][0m SystemUtil.exec_command( | ||
203 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/util/system_util.py", line 63, in exec_command | ||
204 | [91m[OHOS ERROR][0m raise OHOSException( | ||
205 | [91m[OHOS ERROR][0m exceptions.ohos_exception.OHOSException: Please check build log in /home/player/Desktop/ohos/src/out/purple_pi_oh/build.log | ||
206 | [91m[OHOS ERROR][0m | ||
207 | [91m[OHOS ERROR][0m During handling of the above exception, another exception occurred: | ||
208 | [91m[OHOS ERROR][0m | ||
209 | [91m[OHOS ERROR][0m Traceback (most recent call last): | ||
210 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/containers/status.py", line 47, in wrapper | ||
211 | [91m[OHOS ERROR][0m return func(*args, **kwargs) | ||
212 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/ohos_build_module.py", line 67, in run | ||
213 | [91m[OHOS ERROR][0m raise exception | ||
214 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/ohos_build_module.py", line 65, in run | ||
215 | [91m[OHOS ERROR][0m super().run() | ||
216 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/interface/build_module_interface.py", line 72, in run | ||
217 | [91m[OHOS ERROR][0m raise exception | ||
218 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/interface/build_module_interface.py", line 70, in run | ||
219 | [91m[OHOS ERROR][0m self._target_compilation() | ||
220 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation | ||
221 | [91m[OHOS ERROR][0m self.target_compiler.run() | ||
222 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/services/ninja.py", line 38, in run | ||
223 | [91m[OHOS ERROR][0m self._execute_ninja_cmd() | ||
224 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/services/ninja.py", line 52, in _execute_ninja_cmd | ||
225 | [91m[OHOS ERROR][0m raise OHOSException('ninja phase failed', '4000') | ||
226 | [91m[OHOS ERROR][0m exceptions.ohos_exception.OHOSException: ninja phase failed | ||
227 | [91m[OHOS ERROR][0m | ||
228 | [91m[OHOS ERROR][0m Code: 4000 | ||
229 | [91m[OHOS ERROR][0m | ||
230 | [91m[OHOS ERROR][0m Reason: ninja phase failed | ||
231 | [91m[OHOS ERROR][0m | ||
232 | [91m[OHOS ERROR][0m Solution: Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs. | ||
233 | [91m[OHOS ERROR][0m Or you can try the following steps to solve this problem: | ||
234 | [91m[OHOS ERROR][0m 1. cd to OHOS root path | ||
235 | [91m[OHOS ERROR][0m 2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'. | ||
236 | [91m[OHOS ERROR][0m 3. repo sync | ||
237 | [91m[OHOS ERROR][0m 4. repo forall -c 'git lfs pull' | ||
238 | [91m[OHOS ERROR][0m 5. bash build/prebuilts_download.sh | ||
239 | [91m[OHOS ERROR][0m 6. rebuild your product or component | ||
240 | [91m[OHOS ERROR][0m | ||
241 | [91m[OHOS ERROR][0m If you still cannot solve this problem, you could post this problem on: | ||
242 | [91m[OHOS ERROR][0m https://gitee.com/openharmony/build/issues | ||
243 | [91m[OHOS ERROR][0m</code></pre> | ||
244 | <p>在报错信息之上,还有很多很多行,大致意思是正在对某些文件或仓库拉补丁,输出了补丁的 commit 信息。报错中最后提示的解决办法其实是无效的,我全量删除源码、甚至重装虚拟机,都还会遇到这个问题。</p> | ||
245 | <p>仔细分析报错信息,发现报错的根本原因是在 python 中<strong>处理一个 Exception 时,又抛出了另一个 | ||
246 | Exception,导致程序异常终止</strong>。上网搜索可知,这种问题的一般原因是 python | ||
247 | 同时拉取或爬取大量网页内容,但都失败了,导致同时出现两个异常,程序崩溃。具体到我们这里,问题就是拉补丁失败了,我检查了一下我的网络环境,发现我挂着梯子,梯子质量不是那么好。尝试将梯子关掉后,再次编译,问题解决。 | ||
248 | </p> | ||
184 | <h2 id="一个奇怪的报错gn-failed">一个奇怪的报错——<code>GN Failed</code></h2> | 249 | <h2 id="一个奇怪的报错gn-failed">一个奇怪的报错——<code>GN Failed</code></h2> |
185 | <p>这是一个很奇怪的报错,我们尚未找到真正的原因所在,只知道如何暂时地绕过去。</p> | 250 | <p>这是一个很奇怪的报错,我们尚未找到真正的原因所在,只知道如何暂时地绕过去。</p> |
186 | <h3 id="问题描述与复现">问题描述与复现</h3> | 251 | <h3 id="问题描述与复现">问题描述与复现</h3> |
187 | <p>问题复现方法为在编译过程中,执行以下命令:</p> | 252 | <p>问题复现方法为在编译过程中,执行以下命令:</p> |
188 | <pre><code>./build.sh --product-name rk3568 --ccache</code></pre> | 253 | <pre><code>./build.sh --product-name rk3568 --ccache</code></pre> |
189 | <p>该命令是指导书中写的编译命令,但执行时候会出错;<strong>与上文所述的经确认无误的编译命令不同在于没加<code>sudo</code></strong>。</p> | 254 | <p>该命令是指导书中写的编译命令,但执行时候会出错;<strong>与上文所述的经确认无误的编译命令不同在于没加<code>sudo</code></strong>。</p> |
190 | <p>如果按照指导书的命令来,不出意外编译将会报错: <img src="https://www.qin-juan-ge-zhu.top/images/code/ohos_gn_fail_1.png" /> | 255 | <p>如果按照指导书的命令来,不出意外编译将会报错: <img src="https://www.qin-juan-ge-zhu.top/images/code/ohos_gn_fail_1.png" /> <img |
191 | <img src="https://www.qin-juan-ge-zhu.top/images/code/ohos_gn_fail_2.png" /></p> | 256 | src="https://www.qin-juan-ge-zhu.top/images/code/ohos_gn_fail_2.png" /></p> |
192 | <p><strong>以下是该问题的具体描述:</strong></p> | 257 | <p><strong>以下是该问题的具体描述:</strong></p> |
193 | <p><code>build.log</code>如下:</p> | 258 | <p><code>build.log</code>如下:</p> |
194 | <pre><code>Set cache size limit to 100.0 GB | 259 | <pre><code>Set cache size limit to 100.0 GB |
@@ -311,6 +376,109 @@ sudo apt-get install libxcursor-dev libxrandr-dev libxinerama-dev | |||
311 | <p>将编译出来的 NDK 的 zip 解压到你想要的目录下,然后将该目录添加到环境变量中,即可使用。</p> | 376 | <p>将编译出来的 NDK 的 zip 解压到你想要的目录下,然后将该目录添加到环境变量中,即可使用。</p> |
312 | <p>注意,NDK 包提供的交叉编译工具是 cmake 和 ninja,编译器是 clang 和 clang++,并没有我们熟悉的 gcc/g++和 make。除此之外,NDK | 377 | <p>注意,NDK 包提供的交叉编译工具是 cmake 和 ninja,编译器是 clang 和 clang++,并没有我们熟悉的 gcc/g++和 make。除此之外,NDK |
313 | 还未我们提供编译所需的全套服务,如编译工具链配置文件<code>ohos.toolchain.cmake</code>、头文件、库文件等。快说,谢谢 ohos~</p> | 378 | 还未我们提供编译所需的全套服务,如编译工具链配置文件<code>ohos.toolchain.cmake</code>、头文件、库文件等。快说,谢谢 ohos~</p> |
379 | <p>为了更方便地使用 NDK,鄙人不才,写了两个脚本,分别用于 cmake 编译和单文件编译:</p> | ||
380 | <pre><code>#!/bin/bash | ||
381 | |||
382 | ####################################################################### | ||
383 | # File Name : compile.sh | ||
384 | # Encoding : utf-8 | ||
385 | # Author : We-unite | ||
386 | # Email : weunite1848@gmail.com | ||
387 | # Created Time : 2024-11-18 15:19:15 | ||
388 | ####################################################################### | ||
389 | |||
390 | set -e | ||
391 | |||
392 | if [ $UID -eq 0 ]; then | ||
393 | echo "Please do not run this script as root" | ||
394 | exit 1 | ||
395 | fi | ||
396 | |||
397 | if [ $# -ne 2 ]; then | ||
398 | echo "Usage: $0 <static|shared> <v7|v8>" | ||
399 | exit 1 | ||
400 | fi | ||
401 | |||
402 | if [ $2 == "v8" ]; then | ||
403 | arch=arm64-v8a | ||
404 | elif [ $2 == "v7" ]; then | ||
405 | arch=armeabi-v7a | ||
406 | else | ||
407 | echo "Invalid architecture: $2" | ||
408 | exit 1 | ||
409 | fi | ||
410 | |||
411 | link=$1 # static or shared | ||
412 | native_path=~/app/native | ||
413 | |||
414 | export PATH=$native_path/build-tools/cmake/bin:$PATH | ||
415 | |||
416 | # 使用cmake编译,编译生成的文件运行在rk3568上 | ||
417 | cmake -B build -D OHOS_STL=c++_$link -D OHOS_ARCH=$arch \ | ||
418 | -D OHOS_PLATFORM=OHOS \ | ||
419 | -D CMAKE_TOOLCHAIN_FILE=$(find $native_path -name ohos.toolchain.cmake) | ||
420 | cmake --build build</code></pre> | ||
421 | <pre><code>#!/bin/bash | ||
422 | |||
423 | ####################################################################### | ||
424 | # File Name : compile-tiny.sh | ||
425 | # Encoding : utf-8 | ||
426 | # Author : We-unite | ||
427 | # Email : weunite1848@gmail.com | ||
428 | # Created Time : 2024-11-16 13:06:58 | ||
429 | ####################################################################### | ||
430 | |||
431 | set -e | ||
432 | # 如果是root,报错 | ||
433 | if [ $(id -u) -eq 0 ]; then | ||
434 | echo "Do not run as root" | ||
435 | exit 1 | ||
436 | fi | ||
437 | |||
438 | if [ $# -ne 2 ]; then | ||
439 | echo "Usage: $0 <src file> [armv8-a|armv7-a]" | ||
440 | exit 1 | ||
441 | fi | ||
442 | |||
443 | native=~/app/native | ||
444 | file=$1 | ||
445 | targetFile=${file%.*} | ||
446 | arch=$2 | ||
447 | |||
448 | case $arch in | ||
449 | armv8-a) | ||
450 | compiler=$native/llvm/bin/aarch64-unknown-linux-ohos | ||
451 | targetPlatform=aarch64-linux-ohos | ||
452 | ;; | ||
453 | armv7-a) | ||
454 | compiler=$native/llvm/bin/armv7-unknown-linux-ohos | ||
455 | targetPlatform=arm-linux-ohos | ||
456 | ;; | ||
457 | *) | ||
458 | echo "Unsupported arch" | ||
459 | exit 1 | ||
460 | ;; | ||
461 | esac | ||
462 | |||
463 | case ${file##*.} in | ||
464 | c) | ||
465 | compiler=$compiler-clang | ||
466 | ;; | ||
467 | cpp) | ||
468 | compiler=$compiler-clang++ | ||
469 | ;; | ||
470 | *) | ||
471 | echo "Unsupported file type" | ||
472 | exit 1 | ||
473 | ;; | ||
474 | esac | ||
475 | |||
476 | export CPATH= | ||
477 | |||
478 | $compiler -o $targetFile $file -Wall \ | ||
479 | --target=$targetPlatform \ | ||
480 | --sysroot=$native/sysroot \ | ||
481 | -march=$arch -mfloat-abi=softfp</code></pre> | ||
314 | <h1 id="完结撒花">完结撒花</h1> | 482 | <h1 id="完结撒花">完结撒花</h1> |
315 | <p>本次鸿蒙开发环境的搭建过程可谓一波三折,总结几个最大的坑点,或许可以作为编译的经验罢:</p> | 483 | <p>本次鸿蒙开发环境的搭建过程可谓一波三折,总结几个最大的坑点,或许可以作为编译的经验罢:</p> |
316 | <ul> | 484 | <ul> |
@@ -323,8 +491,8 @@ sudo apt-get install libxcursor-dev libxrandr-dev libxinerama-dev | |||
323 | </li> | 491 | </li> |
324 | </ul> | 492 | </ul> |
325 | <p>不说了,抓紧攒点钱开学升级电脑配置要紧……磁盘快炸了……</p> | 493 | <p>不说了,抓紧攒点钱开学升级电脑配置要紧……磁盘快炸了……</p> |
326 | <p class="time">2024.2.12,甲辰年正月初三<br>2024.4.24改</p> | 494 | <p class="time">2024.2.12,甲辰年正月初三<br>2024.4.24改<br>2024.11.19改</p> |
327 | <script src="https://www.qin-juan-ge-zhu.top/common/js/comment.js"></script> | 495 | <script src="https://test.qin-juan-ge-zhu.top/common/js/comment.js"></script> |
328 | </div> | 496 | </div> |
329 | </div> | 497 | </div> |
330 | </body> | 498 | </body> |
diff --git a/code/projects/ohos_compile.md b/code/projects/ohos_compile.md index 150ee25..4672027 100644 --- a/code/projects/ohos_compile.md +++ b/code/projects/ohos_compile.md | |||
@@ -1,7 +1,5 @@ | |||
1 | <!-- 鸿蒙开发环境搭建 --> | 1 | <!-- 鸿蒙开发环境搭建 --> |
2 | 2 | ||
3 | [toc] | ||
4 | |||
5 | > 本次编译环境搭建参考了以下博客: | 3 | > 本次编译环境搭建参考了以下博客: |
6 | > | 4 | > |
7 | > - [HiHope_DAYU200/开发环境搭建编译指南](https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E7%BC%96%E8%AF%91%E6%8C%87%E5%8D%97.md) | 5 | > - [HiHope_DAYU200/开发环境搭建编译指南](https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E7%BC%96%E8%AF%91%E6%8C%87%E5%8D%97.md) |
@@ -103,49 +101,58 @@ ssh-keygen -t rsa -C "your-email-address" | |||
103 | 101 | ||
104 | ## 配置 repo 工具 | 102 | ## 配置 repo 工具 |
105 | 103 | ||
106 | **注意:前两条命令需要以 root 身份执行!!!** | ||
107 | |||
108 | ```bash | 104 | ```bash |
109 | # 以下两条命令需要以root身份执行 | 105 | curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > ~/repo |
110 | sudo -s | 106 | chmod a+x ~/repo |
111 | curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo | 107 | sudo mv ~/repo /usr/local/bin/repo |
112 | chmod a+x /usr/local/bin/repo | 108 | sudo chown root:root /usr/local/bin/repo |
113 | exit | ||
114 | 109 | ||
115 | # 这条普通身份也可以 | ||
116 | pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests | 110 | pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests |
117 | ``` | 111 | ``` |
118 | 112 | ||
119 | 之所以前两条命令需要以 root 身份而不能是 sudo,是因为`/usr/local/bin`是一个只有 root 用户才有写权限的目录,而 sudo 命令虽然是以 root 身份执行,但**重定向时候 sudo 用的也是当前用户身份**,权限不足,自然报错。(**如果是管道,那么 sudo 也是只对当前命令有效,而不是对后续的整个管道有效。**) | 113 | 需要注意的是,不能直接使用 sudo 搭配管道,这是因为`/usr/local/bin`是一个只有 root 用户才有写权限的目录,而 sudo 命令虽然是以 root 身份执行,但**重定向时候 sudo 用的也是当前用户身份**,权限不足,自然报错。(**如果是管道,那么 sudo 也是只对当前命令有效,而不是对后续的整个管道有效。**) |
120 | 114 | ||
121 | ## 获取源码 | 115 | ## 获取源码 |
122 | 116 | ||
117 | 这里需要注意的是,一般情况下最好使用带有 v 和 Release 的版本。不带 Release 不是发布版,会随时更新代码,容易编译出错;带 Release 的也有两种 tag,是带 v 和不带 v 的区别,如`OpenHarmony-v4.0-Release`和`OpenHarmony-4.0-Release`。二者的区别主要在于,不带 v 的是官方维护的稳定版,也会更新代码,厂商的补丁一般只针对带 v 的使用。 | ||
118 | |||
123 | 通过 repo + https/ssh 下载: | 119 | 通过 repo + https/ssh 下载: |
124 | 120 | ||
125 | ```bash | 121 | ```bash |
126 | # 通过http下载,这里需要注意你需要的ohos的版本 | ||
127 | repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify | ||
128 | # 如果需要的是特定分支,-b后边改成对应分支名 | 122 | # 如果需要的是特定分支,-b后边改成对应分支名 |
123 | # repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify | ||
129 | # 如果是tag,-b后的参数比较复杂,要在网页上提前确定好需要的tag名字, | 124 | # 如果是tag,-b后的参数比较复杂,要在网页上提前确定好需要的tag名字, |
130 | # 如下载的是tag为OpenHarmony-v3.2-Release的版本,命令如下: | 125 | # 如下载的是tag为OpenHarmony-v3.2-Release的版本,命令如下: |
131 | # repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v3.2-Release --no-repo-verify | 126 | # repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v3.2-Release --no-repo-verify |
132 | # 除使用https外,也可以通过ssh下载 | 127 | # 除使用https外,也可以通过ssh下载 |
133 | # repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify | 128 | # repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify |
134 | 129 | repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v4.0-Release --no-repo-verify | |
135 | repo sync -c | 130 | repo sync -c |
136 | repo forall -c 'git lfs pull' | 131 | repo forall -c 'git lfs pull' |
137 | ``` | 132 | ``` |
138 | 133 | ||
139 | ## prebuilts 与编译 | 134 | ## 补丁与编译 |
135 | |||
136 | 首先,打上厂商的补丁。下载对应版本补丁后,将补丁文件放到源码根目录下,执行: | ||
137 | |||
138 | ```bash | ||
139 | unzip purple_pi_oh_patch.zip | ||
140 | cd purple_pi_oh_patch | ||
141 | ./ido_patch.sh | ||
142 | ``` | ||
143 | |||
144 | 看到`patch complete`字样,说明补丁成功。接下来进行 prebuilts 和编译: | ||
140 | 145 | ||
141 | ```bash | 146 | ```bash |
142 | # 先在源码根目录下执行脚本,安装编译器及二进制工具 | 147 | # 先在源码根目录下执行脚本,安装编译器及二进制工具 |
143 | bash build/prebuilts_download.sh | 148 | bash build/prebuilts_download.sh |
144 | # 再执行如下命令进行版本编译 | 149 | |
150 | # 编译 | ||
145 | # 注意:默认编译的时候,目标cpu是32位,即使为64位cpu也无法使用64位功能 | 151 | # 注意:默认编译的时候,目标cpu是32位,即使为64位cpu也无法使用64位功能 |
146 | sudo ./build.sh --product-name rk3568 --ccache | ||
147 | # 如果是64位cpu,需要加上--target-cpu=arm64 | 152 | # 如果是64位cpu,需要加上--target-cpu=arm64 |
148 | sudo ./build.sh --product-name rk3568 --ccache --target-cpu=arm64 | 153 | # 编译rk3568时 |
154 | # sudo ./build.sh --product-name rk3568 --ccache --target-cpu=arm64 | ||
155 | sudo ./build.sh --product-name purple_pi_oh --ccache --no-prebuilt-sdk --target-cpu=arm64 | ||
149 | ``` | 156 | ``` |
150 | 157 | ||
151 | ## 编译完成 | 158 | ## 编译完成 |
@@ -195,6 +202,82 @@ sudo mount -o remount -rw /var/snap/firefox/common/host-hunspell | |||
195 | 202 | ||
196 | 而后在 gparted 中点击`gparted->刷新设备`,即可进行分区扩展。 | 203 | 而后在 gparted 中点击`gparted->刷新设备`,即可进行分区扩展。 |
197 | 204 | ||
205 | ## Ninja 编译报错 `Code 4000` | ||
206 | |||
207 | 编译 rk3568 过程中可能会出现以下报错: | ||
208 | |||
209 | ```plaintext | ||
210 | [OHOS ERROR] Code: 4000 | ||
211 | [OHOS ERROR] Reason: ninja phase failed | ||
212 | ``` | ||
213 | |||
214 | 详细的报错信息已经丢失,将就着看吧。反正别的办法都不好使的时候试试这个。 | ||
215 | |||
216 | 此时执行以下内容即可: | ||
217 | |||
218 | ```bash | ||
219 | rm -rf out | ||
220 | sed -i 's/CONFIG_DEBUG_INFO_BTF=y/# CONFIG_DEBUG_INFO_BTF=y/g' kernel/linux/config/linux-5.10/rk3568/arch/arm64_defconfig | ||
221 | ``` | ||
222 | |||
223 | 而后重新编译。 | ||
224 | |||
225 | ## 另一个`Code 4000` | ||
226 | |||
227 | 编译时报错如下: | ||
228 | |||
229 | ```plaintext | ||
230 | ninja: build stopped: subcommand failed. | ||
231 | [91m[OHOS ERROR][0m Traceback (most recent call last): | ||
232 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/services/ninja.py", line 49, in _execute_ninja_cmd | ||
233 | [91m[OHOS ERROR][0m SystemUtil.exec_command( | ||
234 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/util/system_util.py", line 63, in exec_command | ||
235 | [91m[OHOS ERROR][0m raise OHOSException( | ||
236 | [91m[OHOS ERROR][0m exceptions.ohos_exception.OHOSException: Please check build log in /home/player/Desktop/ohos/src/out/purple_pi_oh/build.log | ||
237 | [91m[OHOS ERROR][0m | ||
238 | [91m[OHOS ERROR][0m During handling of the above exception, another exception occurred: | ||
239 | [91m[OHOS ERROR][0m | ||
240 | [91m[OHOS ERROR][0m Traceback (most recent call last): | ||
241 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/containers/status.py", line 47, in wrapper | ||
242 | [91m[OHOS ERROR][0m return func(*args, **kwargs) | ||
243 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/ohos_build_module.py", line 67, in run | ||
244 | [91m[OHOS ERROR][0m raise exception | ||
245 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/ohos_build_module.py", line 65, in run | ||
246 | [91m[OHOS ERROR][0m super().run() | ||
247 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/interface/build_module_interface.py", line 72, in run | ||
248 | [91m[OHOS ERROR][0m raise exception | ||
249 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/interface/build_module_interface.py", line 70, in run | ||
250 | [91m[OHOS ERROR][0m self._target_compilation() | ||
251 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation | ||
252 | [91m[OHOS ERROR][0m self.target_compiler.run() | ||
253 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/services/ninja.py", line 38, in run | ||
254 | [91m[OHOS ERROR][0m self._execute_ninja_cmd() | ||
255 | [91m[OHOS ERROR][0m File "/home/player/Desktop/ohos/src/build/hb/services/ninja.py", line 52, in _execute_ninja_cmd | ||
256 | [91m[OHOS ERROR][0m raise OHOSException('ninja phase failed', '4000') | ||
257 | [91m[OHOS ERROR][0m exceptions.ohos_exception.OHOSException: ninja phase failed | ||
258 | [91m[OHOS ERROR][0m | ||
259 | [91m[OHOS ERROR][0m Code: 4000 | ||
260 | [91m[OHOS ERROR][0m | ||
261 | [91m[OHOS ERROR][0m Reason: ninja phase failed | ||
262 | [91m[OHOS ERROR][0m | ||
263 | [91m[OHOS ERROR][0m Solution: Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs. | ||
264 | [91m[OHOS ERROR][0m Or you can try the following steps to solve this problem: | ||
265 | [91m[OHOS ERROR][0m 1. cd to OHOS root path | ||
266 | [91m[OHOS ERROR][0m 2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'. | ||
267 | [91m[OHOS ERROR][0m 3. repo sync | ||
268 | [91m[OHOS ERROR][0m 4. repo forall -c 'git lfs pull' | ||
269 | [91m[OHOS ERROR][0m 5. bash build/prebuilts_download.sh | ||
270 | [91m[OHOS ERROR][0m 6. rebuild your product or component | ||
271 | [91m[OHOS ERROR][0m | ||
272 | [91m[OHOS ERROR][0m If you still cannot solve this problem, you could post this problem on: | ||
273 | [91m[OHOS ERROR][0m https://gitee.com/openharmony/build/issues | ||
274 | [91m[OHOS ERROR][0m | ||
275 | ``` | ||
276 | |||
277 | 在报错信息之上,还有很多很多行,大致意思是正在对某些文件或仓库拉补丁,输出了补丁的 commit 信息。报错中最后提示的解决办法其实是无效的,我全量删除源码、甚至重装虚拟机,都还会遇到这个问题。 | ||
278 | |||
279 | 仔细分析报错信息,发现报错的根本原因是在 python 中**处理一个 Exception 时,又抛出了另一个 Exception,导致程序异常终止**。上网搜索可知,这种问题的一般原因是 python 同时拉取或爬取大量网页内容,但都失败了,导致同时出现两个异常,程序崩溃。具体到我们这里,问题就是拉补丁失败了,我检查了一下我的网络环境,发现我挂着梯子,梯子质量不是那么好。尝试将梯子关掉后,再次编译,问题解决。 | ||
280 | |||
198 | ## 一个奇怪的报错——`GN Failed` | 281 | ## 一个奇怪的报错——`GN Failed` |
199 | 282 | ||
200 | 这是一个很奇怪的报错,我们尚未找到真正的原因所在,只知道如何暂时地绕过去。 | 283 | 这是一个很奇怪的报错,我们尚未找到真正的原因所在,只知道如何暂时地绕过去。 |
@@ -361,18 +444,18 @@ sudo apt-get install libxcursor-dev libxrandr-dev libxinerama-dev | |||
361 | 444 | ||
362 | 注意,NDK 包提供的交叉编译工具是 cmake 和 ninja,编译器是 clang 和 clang++,并没有我们熟悉的 gcc/g++和 make。除此之外,NDK 还未我们提供编译所需的全套服务,如编译工具链配置文件`ohos.toolchain.cmake`、头文件、库文件等。快说,谢谢 ohos~ | 445 | 注意,NDK 包提供的交叉编译工具是 cmake 和 ninja,编译器是 clang 和 clang++,并没有我们熟悉的 gcc/g++和 make。除此之外,NDK 还未我们提供编译所需的全套服务,如编译工具链配置文件`ohos.toolchain.cmake`、头文件、库文件等。快说,谢谢 ohos~ |
363 | 446 | ||
364 | 为了更方便地使用NDK,鄙人不才,写了两个脚本,分别用于cmake编译和单文件编译: | 447 | 为了更方便地使用 NDK,鄙人不才,写了两个脚本,分别用于 cmake 编译和单文件编译: |
365 | 448 | ||
366 | ```bash | 449 | ```bash |
367 | #!/bin/bash | 450 | #!/bin/bash |
368 | 451 | ||
369 | ########################################################################## | 452 | ####################################################################### |
370 | # File Name : compile.sh | 453 | # File Name : compile.sh |
371 | # Encoding : utf-8 | 454 | # Encoding : utf-8 |
372 | # Author : We-unite | 455 | # Author : We-unite |
373 | # Email : weunite1848@gmail.com | 456 | # Email : weunite1848@gmail.com |
374 | # Created Time : 2024-02-29 15:19:15 | 457 | # Created Time : 2024-11-18 15:19:15 |
375 | ########################################################################## | 458 | ####################################################################### |
376 | 459 | ||
377 | set -e | 460 | set -e |
378 | 461 | ||
@@ -401,11 +484,74 @@ native_path=~/app/native | |||
401 | export PATH=$native_path/build-tools/cmake/bin:$PATH | 484 | export PATH=$native_path/build-tools/cmake/bin:$PATH |
402 | 485 | ||
403 | # 使用cmake编译,编译生成的文件运行在rk3568上 | 486 | # 使用cmake编译,编译生成的文件运行在rk3568上 |
404 | cmake -B build -D OHOS_STL=c++_$link -D OHOS_ARCH=$arch -D OHOS_PLATFORM=OHOS -D CMAKE_TOOLCHAIN_FILE=$(find $native_path -name ohos.toolchain.cmake) | 487 | cmake -B build -D OHOS_STL=c++_$link -D OHOS_ARCH=$arch \ |
488 | -D OHOS_PLATFORM=OHOS \ | ||
489 | -D CMAKE_TOOLCHAIN_FILE=$(find $native_path -name ohos.toolchain.cmake) | ||
405 | cmake --build build | 490 | cmake --build build |
406 | ``` | 491 | ``` |
407 | 492 | ||
408 | ```bash | 493 | ```bash |
494 | #!/bin/bash | ||
495 | |||
496 | ####################################################################### | ||
497 | # File Name : compile-tiny.sh | ||
498 | # Encoding : utf-8 | ||
499 | # Author : We-unite | ||
500 | # Email : weunite1848@gmail.com | ||
501 | # Created Time : 2024-11-16 13:06:58 | ||
502 | ####################################################################### | ||
503 | |||
504 | set -e | ||
505 | # 如果是root,报错 | ||
506 | if [ $(id -u) -eq 0 ]; then | ||
507 | echo "Do not run as root" | ||
508 | exit 1 | ||
509 | fi | ||
510 | |||
511 | if [ $# -ne 2 ]; then | ||
512 | echo "Usage: $0 <src file> [armv8-a|armv7-a]" | ||
513 | exit 1 | ||
514 | fi | ||
515 | |||
516 | native=~/app/native | ||
517 | file=$1 | ||
518 | targetFile=${file%.*} | ||
519 | arch=$2 | ||
520 | |||
521 | case $arch in | ||
522 | armv8-a) | ||
523 | compiler=$native/llvm/bin/aarch64-unknown-linux-ohos | ||
524 | targetPlatform=aarch64-linux-ohos | ||
525 | ;; | ||
526 | armv7-a) | ||
527 | compiler=$native/llvm/bin/armv7-unknown-linux-ohos | ||
528 | targetPlatform=arm-linux-ohos | ||
529 | ;; | ||
530 | *) | ||
531 | echo "Unsupported arch" | ||
532 | exit 1 | ||
533 | ;; | ||
534 | esac | ||
535 | |||
536 | case ${file##*.} in | ||
537 | c) | ||
538 | compiler=$compiler-clang | ||
539 | ;; | ||
540 | cpp) | ||
541 | compiler=$compiler-clang++ | ||
542 | ;; | ||
543 | *) | ||
544 | echo "Unsupported file type" | ||
545 | exit 1 | ||
546 | ;; | ||
547 | esac | ||
548 | |||
549 | export CPATH= | ||
550 | |||
551 | $compiler -o $targetFile $file -Wall \ | ||
552 | --target=$targetPlatform \ | ||
553 | --sysroot=$native/sysroot \ | ||
554 | -march=$arch -mfloat-abi=softfp | ||
409 | ``` | 555 | ``` |
410 | 556 | ||
411 | # 完结撒花 | 557 | # 完结撒花 |
@@ -417,4 +563,4 @@ cmake --build build | |||
417 | - 内存 10G+ | 563 | - 内存 10G+ |
418 | - 磁盘 160G+ | 564 | - 磁盘 160G+ |
419 | 565 | ||
420 | 不说了,抓紧攒点钱开学升级电脑配置要紧……磁盘快炸了…… \ No newline at end of file | 566 | 不说了,抓紧攒点钱开学升级电脑配置要紧……磁盘快炸了…… |
diff --git a/common/script4works.html b/common/script4works.html index b865bf1..d6759a2 100644 --- a/common/script4works.html +++ b/common/script4works.html | |||
@@ -158,7 +158,7 @@ | |||
158 | 158 | ||
159 | <a onclick="clickit('grandson23')">-项目文档</a> | 159 | <a onclick="clickit('grandson23')">-项目文档</a> |
160 | <div class="grandson" id="grandson23" style="display: none;"> | 160 | <div class="grandson" id="grandson23" style="display: none;"> |
161 | <a href="https://www.qin-juan-ge-zhu.top/code/projects/ohos_compile.html">OpenHarmony编译</a> | 161 | <a href="https://www.qin-juan-ge-zhu.top/code/projects/ohos_compile.html">OpenHarmony 编译</a> |
162 | <a href="https://www.qin-juan-ge-zhu.top/code/projects/lcm_compile.html">LCM交叉编译</a> | 162 | <a href="https://www.qin-juan-ge-zhu.top/code/projects/lcm_compile.html">LCM交叉编译</a> |
163 | <a href="https://www.qin-juan-ge-zhu.top/code/projects/godo.html">godo知识总结</a> | 163 | <a href="https://www.qin-juan-ge-zhu.top/code/projects/godo.html">godo知识总结</a> |
164 | </div> | 164 | </div> |
diff --git a/common/script4works.js b/common/script4works.js index 0ae78a2..8d5f6d5 100644 --- a/common/script4works.js +++ b/common/script4works.js | |||
@@ -159,7 +159,7 @@ document.writeln(" </div>"); | |||
159 | document.writeln(""); | 159 | document.writeln(""); |
160 | document.writeln(" <a onclick=\"clickit(\'grandson23\')\">-项目文档</a>"); | 160 | document.writeln(" <a onclick=\"clickit(\'grandson23\')\">-项目文档</a>"); |
161 | document.writeln(" <div class=\"grandson\" id=\"grandson23\" style=\"display: none;\">"); | 161 | document.writeln(" <div class=\"grandson\" id=\"grandson23\" style=\"display: none;\">"); |
162 | document.writeln(" <a href=\"https://www.qin-juan-ge-zhu.top/code/projects/ohos_compile.html\">OpenHarmony编译</a>"); | 162 | document.writeln(" <a href=\"https://www.qin-juan-ge-zhu.top/code/projects/ohos_compile.html\">OpenHarmony 编译</a>"); |
163 | document.writeln(" <a href=\"https://www.qin-juan-ge-zhu.top/code/projects/lcm_compile.html\">LCM交叉编译</a>"); | 163 | document.writeln(" <a href=\"https://www.qin-juan-ge-zhu.top/code/projects/lcm_compile.html\">LCM交叉编译</a>"); |
164 | document.writeln(" <a href=\"https://www.qin-juan-ge-zhu.top/code/projects/godo.html\">godo知识总结</a>"); | 164 | document.writeln(" <a href=\"https://www.qin-juan-ge-zhu.top/code/projects/godo.html\">godo知识总结</a>"); |
165 | document.writeln(" </div>"); | 165 | document.writeln(" </div>"); |