更改

跳转至: 导航搜索

Orange Pi Zero 2W

添加671字节, 2023年9月22日 (五) 13:56
编译u-boot
<ol style="list-style-type: decimal;">
<li><p>运行build.sh脚本,记得加sudo权限</p>
{| class="wikitable" style="width:800px;" |-| <p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p>|}</li>
<li><p>选择'''U-boot package''',然后回车</p>
<div class="figure">
<ol style="list-style-type: lower-alpha;">
<li><p>u-boot源码的版本</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Compiling u-boot [ '''v2021.07''' ]</p>|}</li>
<li><p>交叉编译工具链的版本</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]</p>|}</li>
<li><p>编译生成的u-boot deb包的路径</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]</p>|}</li>
<li><p>编译生成的u-boot deb包的包名</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] File name [ '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb''' ]</p>|}</li>
<li><p>编译使用的时间</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Runtime [ '''1 min''' ]</p>|}</li>
<li><p>重复编译u-boot的命令,使用下面的命令无需通过图形界面选择,可以直接开始编译u-boot</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=u-boot''' ]</p>|}</li></ol>
</li>
<li><p>查看编译生成的u-boot deb包</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~/orangepi-build$ '''ls output/debs/u-boot/'''</p>
<p>'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''</p>|}</li>
<li><p>orangepi-bulid编译系统编译u-boot源码时首先会将u-boot的源码和github服务器的u-boot源码进行同步,所以如果想修改u-boot的源码,首先需要关闭源码的下载更新功能('''需要完整编译过一次u-boot后才能关闭这个功能,否则会提示找不到u-boot的源码'''),否则所作的修改都会被还原,方法如下:</p>
<p>设置'''userpatches/config-default.conf'''中的IGNORE_UPDATES变量为”yes”</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>......</p>
<p>IGNORE_UPDATES=&quot;'''<span style="color:#FF0000">yes</span>'''&quot;</p><p>......</p>|}</li>
<li><p>调试u-boot代码时,可以使用下面的方法来更新linux镜像中的u-boot进行测试</p>
<ol style="list-style-type: lower-alpha;">
<li><p>首先将编译好的u-boot的deb包上传到开发板的linux系统中</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~/orangepi-build$ '''cd output/debs/u-boot'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''</p>
<p>'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb [mailto:root@192.168.1.xxx:/root root@192.168.1.xxx:/root]'''</p>|}</li>
<li><p>再安装刚才上传的新的u-boot的deb包</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo dpkg -i''' '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''</p>|}</li>
<li><p>然后运行 nand-sata-install脚本</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p>|}</li>
<li><p>然后选择'''5 Install/Update the bootloader on SD/eMMC'''</p>
<p>[[File:media/image283.png]]</p></li>
8,460
个编辑

导航菜单