Open main menu

Wiki-Orange Pi β

Changes

Orange Pi CM4

237 bytes added, 15:07, 19 September 2023
Compile Linux image
# Run the build.sh script, remember to add sudo permission
::{| class="wikitable" style="width:800px;"
|-
|
test@test:~/orangepi-build$ '''sudo ./build.sh'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Select '''Full OS image for flashing''', then enter</li></ol>
<div class="figure">
[[File:cm4-img408.png]]
</div></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then select the model of the development board</li></ol>
<div class="figure">
[[File:cm4-img393.png]]
</div></ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then select the type of rootfs</li></ol>
[[File:cm4-img402.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Indicates the image of the server version, which is relatively small</p></li>
<li><p>'''Image with desktop environment''' Indicates a image with a desktop, which is relatively large</p></li></ol></li></ol>
<div class="figure">
[[File:cm4-img403.png]]
</div></ol></li></ol>
<ol start="6" style="list-style-type: decimal;">
<li>If you are compiling the image of the server version, you can also choose to compile the Standard version or the Minimal version. The pre-installed software of the Minimal version will be much less than that of the Standard version '''(please do not choose the Minimal version if there is no special requirement, because many things are not pre-installed by default. Some functions may not be available)'''</li></ol>
<div class="figure">
[[File:cm4-img404.png]]
</div></ol>
<ol start="7" style="list-style-type: decimal;">
<li>If you are compiling the image of the desktop version, you also need to select the type of desktop environment. Currently, Ubuntu Jammy mainly maintains XFCE and Gnome desktops, Ubuntu Focal only maintains XFCE desktops, and Debian Bullseye mainly maintains XFCE and KDE desktops</li></ol>
<div class="figure">
[[File:cm4-img407.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li><p>Then it will start to compile the Linux image. The general process of compilation is as follows</p>
::<p>a. Initialize the compilation environment of Ubuntu PC and install the software packages required for the compilation process</p>::<p>b. Download the source code of u-boot and Linux kernel (if cached, only update the code)</p>::<p>c. Compile u-boot source code and generate u-boot deb package</p>::<p>d. Compile the Linux source code and generate Linux-related deb packages</p>::<p>e. Make the deb package of Linux firmware</p>::<p>f. Make the deb package of the orangepi-config tool</p>::<p>g. Create a deb package supported by the board</p>::<p>h. If you are compiling the desktop image, you will also create desktop-related deb packages</p>::<p>i. Check whether the rootfs has been cached, if not, recreate the rootfs, if it has been cached, directly decompress and use</p>::<p>j. Install the previously generated deb package into rootfs</p>::<p>k. Make some specific settings for different development boards and different types of images, such as pre-installing additional software packages, modifying system configuration, etc.</p>::<p>l. Then make an image file and format the partition, the default type is ext4</p>::<p>m. Then copy the configured rootfs to the mirrored partition</p>::<p>n. Then update initramfs</p>::<p>o. Finally, write the bin file of u-boot into the image through the dd command</p></li>
<li><p>After compiling the image, the following information will be prompted</p>
<ol style="list-style-type: lower-alpha;">
<li>The storage path of the compiled image</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Done building [ '''output/images/Orangepi3b_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160/Orangepi3b_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.img''' ]
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Compilation time</li></ol>{| class="wikitable" style="width:800px;" |-|
'''[ o.k. ] Runtime [ 19 min ]'''
|}</ol>
<ol style="list-style-type: lower-alpha;">
<li>Repeat the command to compile the image, and use the following command to start compiling the image directly without selecting through the graphical interface</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi3b BRANCH=legacy BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]
|}</ol></li></ol>
<span id="instructions-for-using-the-orange-pi-os-arch-system"></span>