8,367
edits
Changes
→Compile u-boot
# Run the build.sh script, remember to add sudo permissions
{| class="wikitable" style="width:800px;"
|-
|
test@test:~/orangepi-build$ '''sudo ./build.sh'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Select '''U-boot package''' and press Enter</li></ol>
<div class="figure">
[[File:zero2w-img274.png]]
</div></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then select the model of the development board</li></ol>
[[File:zero2w-img275.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li><p>Then select the branch type of u-boot</p>
<p>[[File:zero2w-img276.png]]</p></li></ol>
</li>
<li><p>If you select the next branch, you will also be prompted to select the memory size, and you do not need to select the current branch.</p></liol style="list-style-type: lower-alpha;"></olli> <blockquotep>a. If the development board you purchased has a memory size of 1.5GB, please select the first option.</p></li> b. <li><p>If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option.</blockquotep><p>[[File:zero2w-img277.png]]</p></li></ol></li></ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>Then it will start to compile u-boot. Some of the information prompted when compiling the next branch is as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>Version of u-boot source code</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Compiling u-boot [ '''v2021.07''' ]
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Version of the cross-compilation tool chain</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Path to the compiled u-boot deb package</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>The package name of the compiled u-boot deb package</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] File name [ '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb''' ]
|}</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Compilation time</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Runtime [ '''1 min''' ]
|}</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Repeat the command to compile u-boot. Use the following command without selecting through the graphical interface. You can start compiling u-boot directly.</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=u-boot''' ]
|}</ol></li></ol>
<ol start="7" style="list-style-type: decimal;">
<li>View the compiled u-boot deb package</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''ls output/debs/u-boot/'''
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''
|}
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>When the orangepi-bulid compilation system compiles the u-boot source code, it will first synchronize the u-boot source code with the u-boot source code of the github server. Therefore, if you want to modify the u-boot source code, you first need to turn off the download and update function of the source code. ('''You need to completely compile u-boot before you can turn off this function, otherwise it will prompt that the source code of u-boot cannot be found'''), otherwise the modifications will be restored. The method is as follows:</li>
test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''
......
IGNORE_UPDATES="'''<span style="color:#FF0000">yes</span>'''"
......
|}</ol>
<ol start="9" style="list-style-type: decimal;">
<li><p>When debugging u-boot code, you can use the following method to update u-boot in the linux image for testing</p>
<ol style="list-style-type: lower-alpha;">
<li>First upload the compiled deb package of u-boot to the Linux system of the development board.</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''cd output/debs/u-boot'''
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb [mailto:[email protected]:/root [email protected]:/root]'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Install the new u-boot deb package just uploaded</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo dpkg -i''' '''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then run the nand-sata-install script</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo nand-sata-install'''
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then select '''5 Install/Update the bootloader on SD/eMMC'''</li></ol>
[[File:zero2w-img278.png]]
</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>After pressing the Enter key, a Warning will pop up first.</li></ol>
[[File:zero2w-img279.png]]
</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Press the Enter key again to start updating u-boot. After the update is completed, the following information will be displayed.</li></ol>
[[File:zero2w-img280.png]]
</ol>
<ol start="7" style="list-style-type: lower-alpha;">
<li>Then you can restart the development board to test whether the u-boot modification has taken effect.</li></ol>
</li></ol>
<span id="compile-the-linux-kernel"></span>
== Compile the linux kernel ==