Changes

Jump to: navigation, search

Orange Pi Zero 2W

945 bytes added, 17:20, 27 September 2023
Compile the source code of Android 12
== 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></ol>{| class="wikitable" style="width:800px;" |-| </li></olp> test@test:~$ '''cd H618-Android12-Src/longan'''</p> <p>test@test:~/H618-Android12-Src/longan$ '''./build.sh config''' Welcome to mkscript setup progress All available platform: 0. android 1. linux Choice [android]: '''0''' All available ic: 0. h618 Choice [h618]: '''0''' All available board: 0. ft 1. p1 2. p2 3. p7 4. p7l 5. perf1 6. perf2 7. perf3 8. qa Choice [p2]: '''2''' All available flash: 0. default 1. nor Choice [default]: '''0''' All available kern_ver: 0. linux-5.4</p>
Choice [linux-5.4]: '''0'''
 
All available arch:
 
0. arm
 
1. arm64
 
Choice [arm64]: '''1'''
 
'''......'''
 
*** Default configuration is based on 'sun50iw9p1smp_h618_android_defconfig'
 
#
 
# configuration written to .config
 
#
 
make[1]: Leaving directory '/home/test/H618-Android12-Src/longan/out/kernel/build'
 
make: Leaving directory '/home/test/H618-Android12-Src/longan/kernel/linux-5.4'
 
INFO: clean buildserver
 
INFO: prepare_buildserver
<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>

Navigation menu