Changes

Jump to: navigation, search

Orange Pi 5 Plus

790 bytes added, 14:02, 7 June 2023
Compile the linux kernel
<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script, remember to add sudo permission</p>
{| class="wikitable" style="width:800px;" |-|<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p>|}</li>
<li><p>Select '''<span class="mark">Kernel package</span>''', then press Enter</p>
<div class="figure">
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>If you do not need to modify the configuration options of the &gt; kernel, when running the build.sh script, pass in &gt; '''<span class="mark">KERNEL_CONFIGURE=no</span>''' to temporarily block the pop-up &gt; kernel configuration interface</p>{| class="wikitable" style="width:800px;" |-|<p>test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''</p>|}</li><li><p>You can also set '''<span class="mark">KERNEL_CONFIGURE=no</span>''' in the &gt; '''<span class="mark">orangepi-build/userpatches/config-default.conf</span>''' &gt; configuration file, which can permanently disable this function</p></li><li><p>If the following error is displayed when compiling the kernel, it is &gt; because the terminal interface of the Ubuntu PC is too small to &gt; display the '''<span class="mark">make menuconfig</span>''' interface. Please &gt; maximize the terminal of the Ubuntu PC and run the build.sh script &gt; again</p>
<p>[[File:media/image545.png|574x234px]]</p></li></ol>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of the linux kernel source code</p>
{| class="wikitable" style="width:800px;" |-|<p>[ o.k. ] Compiling current kernel [ '''5.10.110''' ]</p>|}</li>
<li><p>The version of the cross-compilation toolchain used</p>
{| class="wikitable" style="width:800px;" |-|<p>[ o.k. ] Compiler version [ '''aarch64-none-linux-gnu-gcc 11.2.1''' ]</p>|}</li><li><p>The configuration file used by the kernel by default and the &gt; path where it is stored</p>{| class="wikitable" style="width:800px;" |-|<p>[ o.k. ] Using kernel config file [ '''config/kernel/linux-rockchip-rk3588-legacy.config''' ]</p>|}</li><li><p>The path of the deb package related to the kernel generated by &gt; compiling</p>{| class="wikitable" style="width:800px;" |-|<p>[ o.k. ] Target directory [ '''orangepi-build/output/debs/''' ]</p>|}</li>
<li><p>The package name of the compiled kernel image deb package</p>
{| class="wikitable" style="width:800px;" |-|<p>[ o.k. ] File name [ '''linux-image-legacy-rockchip-rk3588_1.0.0_arm64.deb''' ]</p>|}</li>
<li><p>The time used for compilation</p>
{| class="wikitable" style="width:800px;" |-|<p>[ o.k. ] Runtime [ '''5 min''' ]</p>|}</li><li><p>Finally, the compilation command to repeatedly compile the &gt; kernel selected last time will be displayed. Use the following &gt; command to start compiling the kernel source code directly &gt; without selecting through the graphical interface</p>{| class="wikitable" style="width:800px;" |-|<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi5plus BRANCH=legacy BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]</p>|}</li></ol>
</li>
<li><p>View the deb package related to the kernel generated by compilation</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''linux-dtb-legacy-rockchip-rk3588_1.0.0_arm64.deb''' Contains &gt; dtb files used by the kernel</p></li><li><p>'''linux-headers-legacy-rockchip-rk3588_1.0.0_arm64.deb''' Include &gt; kernel headers</p></li><li><p>'''linux-image-legacy-rockchip-rk3588_1.0.0_arm64.deb''' Contains &gt; kernel images and kernel modules</p>{| class="wikitable" style="width:800px;" |-|
<p>test@test:~/orangepi-build$ '''ls output/debs/linux-*'''</p>
<p>output/debs/linux-dtb-legacy-rockchip-rk3588_1.0.0_arm64.deb </p> <p>output/debs/linux-image-legacy-rockchip-rk3588_1.0.0_arm64.deb</p><p>output/debs/linux-headers-legacy-rockchip-rk3588_1.0.0_arm64.deb</p>|}</li></ol>
</li>
<li><p>The files contained in the generated linux-image deb package are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Use the following command to decompress the deb package</p></li>{| class="wikitable" style="width:800px;" |-|<p>test@test:~/orangepi-build$ '''cd output/debs'''</p></li></ol></li></ol>
test@test:~/orangepi_build/output/debs$ '''mkdir test'''
'''boot etc lib''' linux-image-legacy-rockchip-rk3588_1.0.0_arm64.deb '''usr'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>The decompressed file is as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~/orangepi-build/output/debs/test$ '''tree -L 2'''</p>
<p>.</p>
<p>├── linux-image-legacy-rockchip-rk3588_1.0.0_arm64.deb</p>
<p>└── usr</p>
:<p>├── lib</p>:<p>└── share</p>|}</li></ol></li></ol>
<!-- -->
<ol start="9" style="list-style-type: decimal;">
<li><p>The orangepi-bulid compilation system will first synchronize the linux kernel source code with the linux kernel source code of the github server when compiling the linux kernel source code, so if you want to modify the linux kernel source code, you first need to turn off the update function of the source code '''(you need to compile it once This function can only be turned off after the linux kernel source code, otherwise it will prompt that the source code of the linux kernel cannot be found. If the source code compressed package downloaded from Google Drive, there is no such problem, because the source code of linux has been cached)''', otherwise the The changes made will be reverted as follows:</p>
<p>Set the IGNORE_UPDATES variable in '''<span class="mark">userpatches/config-default.conf</span>''' to &quot;yes&quot;</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES=&quot;'''<span style="color:#FF0000">yes</span>'''&quot;</p>|}</li>
<li><p>If the kernel has been modified, the following method can be used to update the kernel and kernel modules of the development board linux system</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Upload the deb package of the compiled linux kernel to the linux &gt; system of the development board</p>{| class="wikitable" style="width:800px;" |-|
<p>test@test:~/orangepi-build$ '''cd output/debs'''</p>
<p>test@test:~/orangepi-build/output/debs$ '''scp \'''</p>
<p>'''linux-image-legacy-rockchip-rk3588_1.0.0_arm64.deb [email protected]:/root'''</p>|}</li><li><p>Then log in to the development board and uninstall the deb &gt; package of the installed linux kernel</p>{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~# '''apt purge -y linux-image-legacy-rockchip-rk3588'''</p>|}</li>
<li><p>Install the deb package of the new linux kernel just uploaded</p>
{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~# '''dpkg -i linux-image-legacy-rockchip-rk3588_1.0.0_arm64.deb'''</p>|}</li><li><p>Then restart the development board, and then check whether the &gt; kernel-related modifications have taken effect</p>{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~# '''reboot'''</p>|}</li></ol>
</li></ol>
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage location of the kernel configuration file is as &gt; follows, please do not go to the kernel source code to find &gt; the kernel configuration file used by the development board</p></li><li><p>{| class="wikitable" style="width:800px;" |-|[https://github.com/orangepi-xunlong/orangepi-build/blob/next/external/config/kernel/linux-rockchip-rk3588-legacy.config '''orangepi-build/external/config/kernel/linux-rockchip-rk3588-legacy.config''']|}<li><p>The &gt; location of the dts file used by the development board is</p></li>{| class="wikitable" style="width:800px;" |-|[https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-5.10-rk3588/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts '''orangepi-build/kernel/orange-pi-5.10-rk3588/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts''']|}</ol>
</li></ol>
<span id="orangepi-buildkernelorange-pi-5.10-rk3588archarm64bootdtsrockchiprk3588-orangepi-5-plus.dtscompile-rootfs"></span> [https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-5.10-rk3588/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts '''orangepi-build/kernel/orange-pi-5.10-rk3588/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts'''<span id="_Toc25559" class="anchor"></span>]
== Compile rootfs ==

Navigation menu