8,367
edits
Changes
→Download orangepi-build from github
<div class="figure">
[[File:zero2w-img3.png|800px]]
</div>
<div class="figure">
[[File:zero2w-img4.png|800px]]
</div>
<div class="figure">
[[File:zero2w-img5.png|800px]]
</div>
<span id="orange-pi-zero-2w-24pin-expansion-board-interface-details"></span>
== Orange Pi Zero 2w 24pin expansion board interface details ==
<div class="figure">
[[File:zero2w-img6.png|800px]]
</div>
[[File:zero2w-img7.png|800px]]
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
<div class="figure">
[[File:zero2w-img272.png|center|800px]]
</div>
::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
|-
| '''GPIO序号GPIO NO.'''
| '''GPIO'''
| '''功能Function'''| '''引脚Pin'''
|-
| style="text-align: left;"|
{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
|-
| '''引脚Pin'''| '''功能Function'''
| '''GPIO'''
| '''GPIO序号GPIO NO.'''
|-
| '''2'''
<li><p>First download the compressed package of the Android 12 source code and the compressed package of the files modified by Orange Pi Zero2w from Google Cloud Drive</p>
<ol style="list-style-type: lower-alpha;">
<li>Google Cloud Drive</li></ol></li></ol>
[[File:zero2w-img387.png]]
</ol></li></ol>
<ol start="2" style="list-style-type: decimal;">
<li>After downloading the compressed package of Android 12 source code, please check whether the MD5 checksum is correct. If it is incorrect, please download the source code again. Here's how to check the MD5 checksum:</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''md5sum -c H618-Android12-Src.tar.gz.md5sum'''
H618-Android12-Src.tar.gzaa: '''<span style="color:#FF0000">OK</span>'''
H618-Android12-Src.tar.gzab: '''<span style="color:#FF0000">OK</span>'''
......
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then you need to merge multiple compressed files into one, and then extract the Android source code. The command looks like this:</li></ol>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''cat H618-Android12-Src.tar.gzagz<span style="color:#FF0000">a</span>* > H618-Android12-Src.tar.gz'''
test@test:~$ '''tar -xvf H618-Android12-Src.tar.gz'''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then unzip the compressed package of the files modified by Orange Pi Zero2w</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''tar zxf opizero2w_android12_patches.tar.gz'''
'''opizero2w_android12_patches''' opizero2w_android12_patches.tar.gz
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then copy the files modified by Orange Pi Zero2w to the Android source code</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''cp -rf opizero2w_android12_patches/* H618-Android12-Src/'''
|}
</ol>
<span id="compile-the-source-code-of-android-12"></span>
== Compile the source code of Android 12 ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Android12 is compiled on an x86_64 computer with <span style="color:#FF0000">Ubuntu 22.04 </span> installed. Other versions of Ubuntu system package dependencies may have some differences. The image download address of the Ubuntu 22.04 <span style="color:#FF0000">amd64 </span> version is as follows:'''
[https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.2-desktop-amd64.iso '''https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.2-desktop-amd64.iso''']
'''The x86_64 computer hardware configuration for compiling Android12 source code recommends a memory of 16GB or more, and a hard disk space of 200GB or more is recommended. The more CPU cores, the better.'''</big>|}
# First install the software packages needed to compile Android12 source code
::{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''sudo apt-get update'''
'''libssl-dev libncurses5 clang gawk'''
|}
<ol start="2" style="list-style-type: decimal;">
<li><p>Then compile the code in the longan folder, which mainly contains u-boot and linux kernel</p>
<ol style="list-style-type: lower-alpha;">
<li>First run '''./build.sh config''' to set compilation options</li>{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''cd H618-Android12-Src/ollongan'''</p><p>test@test:~/li>H618-Android12-Src/longan$ '''./build.sh config'''</olp>
<p>Welcome to mkscript setup progress</p>
<p>All available platform:</p>
:<p>0. android</p>
:<p>1. linux</p>
<p>Choice [android]: '''<span style="color:#FF0000">0</span>'''</p>
<p>All available ic:</p>
:<p>0. h618</p>
<p>Choice [h618]: '''<span style="color:#FF0000">0</span>'''</p>
<p>All available board:</p>
:<p>0. ft</p>
:<p>1. p1</p>
:<p>2. p2</p>
:<p>3. p7</p>
:<p>4. p7l</p>
:<p>5. perf1</p>
:<p>6. perf2</p>
:<p>7. perf3</p>
:<p>8. qa</p>
<p>Choice [p2]: '''<span style="color:#FF0000">2</span>'''</p>
<p>All available flash:</p>
:<p>0. default</p>
:<p>1. nor</p>
<p>Choice [default]: '''<span style="color:#FF0000">0</span>'''</p>
<p>All available kern_ver:</p>
:<p>0. linux-5.4</p>
<p>Choice [linux-5.4]: '''<span style="color:#FF0000">0</span>'''</p>
<p>All available arch:</p>
:<p>0. arm</p>
:<p>1. arm64</p>
<p>Choice [arm64]: '''<span style="color:#FF0000">1</span>'''</p>
<p>'''......'''</p>
<p>*** Default configuration is based on 'sun50iw9p1smp_h618_android_defconfig'</p>
<p>#</p>
<p># configuration written to .config</p>
<p>#</p>
<p>make[1]: Leaving directory '/home/test/H618-Android12-Src/longan/out/kernel/build'</p>
<p>make: Leaving directory '/home/test/H618-Android12-Src/longan/kernel/linux-5.4'</p>
<p>INFO: clean buildserver</p>
<p>INFO: prepare_buildserver</p>
|}
</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then run the '''./build.sh''' script to start compilation.</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/H618-Android12-Src/longan$ '''./build.sh'''
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>After compilation is completed, you will see the following output</li></ol>{| class="wikitable" style="width:800px;" |-|
sun50iw9p1 compile Kernel successful
INFO: ----------------------------------------
|}</ol></li></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then use the following command to compile the Android source code and generate the final Android image</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''cd H618-Android12-Src'''
test@test:~/H618-Android12-Src$ '''pack'''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li><p>The storage path of the Android image generated by compilation is:</p>
{| class="wikitable" style="width:800px;" |-| <p>'''longan/out/h618_android12_p2_uart0.img'''</p>|}</li></ol>
<span id="appendix"></span>
orangepizero2w_1.0.0_debian_bullseye_desktop_xfce_linux5.4.125.7z
orangepizero2w_1.0.0_ubuntu_jammy_server_linux6.1.31.7z
orangepizero2w_1.0.0_debian_bullseye_desktop_xfce_linux6.1.31.7z
OrangePi_Zero2w_Android12_v1.0.tar.gz
Opios-arch-aarch64-xfce-opizero2w-23.09-linux6.1.31.img.xz