Open main menu

Wiki-Orange Pi β

Changes

Orange Pi Zero 3

778 bytes added, 10:21, 12 July 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 '''Kernel package''', 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; '''KERNEL_CONFIGURE=no''' to temporarily block the pop-up kernel &gt; 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 '''KERNEL_CONFIGURE=no''' in the &gt; orangepi-build/userpatches/config-default.conf configuration file, &gt; 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 make menuconfig interface. Please maximize the &gt; terminal of the Ubuntu PC and run the build.sh script again</p>
<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 [ '''6.1.31''' ]</p>|}</li>
<li><p>The version of the cross-compilation toolchain used</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]</p>|}</li>
<li><p>The configuration file used by the kernel by default and the &gt; path where it is stored are as follows</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Using kernel config file [ '''orangepi-build/external/config/kernel/linux-6.1-sun50iw9-next.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 [ '''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-next-sun50iw9_x.x.x_arm64.deb''' ]</p>|}</li>
<li><p>The time used for compilation</p>
{| class="wikitable" style="width:800px;" |-| <p>[ o.k. ] Runtime [ '''10 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=orangepizero3 BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]</p>|}</li></ol>
</li>
<li><p>View the deb package related to the kernel generated by compilation</p>
<li><p>'''linux-headers-next-sun50iw9_x.x.x_arm64.deb''' Include kernel &gt; headers</p></li>
<li><p>'''linux-image-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel &gt; 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-next-sun50iw9_x.x.x_arm64.deb</p>
<p>output/debs/linux-headers-next-sun50iw9_x.x.x_arm64.deb</p>
<p>output/debs/linux-image-next-sun50iw9_x.x.x_arm64.deb</p>|}</li></ol>
</li>
<li><p>When the orangepi-bulid compilation system compiles the linux kernel source code, it first synchronizes the linux kernel source code with the linux kernel source code of the github server, so if you want to modify the linux kernel source code, you first need to turn off the update function of the source code '''(the linux kernel needs to be fully compiled once This function can only be turned off after the source code, otherwise it will prompt that the source code of the linux kernel cannot be found)''', otherwise the changes made will be restored, the method is as follows:</p>
<p>Set the IGNORE_UPDATES variable in '''userpatches/config-default.conf''' 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-next-sun50iw9_x.x.x_arm64.deb root@192.168.1.xxx:/root'''</p>|}</li>
<li><p>Install the deb package of the new linux kernel just uploaded</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo dpkg -i linux-image-next-sun50iw9_x.x.x_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>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p>|}</li></ol>
</li></ol>
<span id="compile-rootfs"></span>
 
== Compile rootfs ==