Forlinx Desktop22.04_User’s Compilation Manual_V1.0

Document classification: □ Top secret □ Secret □ Internal information ■ Open

Overview

This manual is designed to enable users of the Forlinx Embedded development board to quickly understand thecompilation processof the products and familiarize themselves with the compilation methods of Forlinx products. The application needs to be cross-compiled on an ubuntuhost before it can run on the development board. By following the methods provided in the compilation manual and performing practical operations, you will be able to successfully compile your own software code.

The manual will provide instructions for setting up the environment but there may be some unforeseen issues during the environment setup process. For beginners, it is recommended to use the pre-configured development environment provided by Forlinx. This will allow you to quickly get started and reduce development time.

Linux systems are typically installed in three ways: Dual system on a real machine, single system on a real machine, and virtual machine. Different installation methods have their advantages and disadvantages. This manual only provides methods to build ubuntu in a virtual machine.

Hardware Requirements: It is recommended to have at least16GB memory or above. It allows for allocating a sufficient memory to the virtual machine (recommended to allocate10GB or above), while still leaving enough resources for other operations onWindows. Insufficient memory allocation may result in slower performance on Windows.

The manual is mainly divided into four chapters:

  • Chapter 1. Virtual Machine software installation - introduction to downloading and installing Vmware software;

  • Chapter 2. provides the loading of the ubuntu system;

  • Chapter 3. Building, setting up, and installing necessary tools for the Ubuntu system and common issues in development environments;

  • Chapter 4. Compiling the kernel and Linux-related source code.

A description of some of the symbols and formats associated with this manual:

Format

Meaning

Note

Note or information that requires special attention, be sure to read carefully

📚

Relevant notes on the test chapters

️️️🛤️ ️

Indicates the related path.

Blue font on gray background

Refers to commands entered at the command line(Manual input required).

Black font

Serial port output message after entering a command

Bold black

Key information in the serial port output message

//

Interpretation of input instructions or output information

Username@Hostname

forlinx @ ubuntu: Development environment ubuntu account information, which can be used to determine the environment in which the function operates.

After packaging the file system, you can use the “ls” command to view the generated files.

forlinx@ubuntu:~/3588$ ls                                  //List the files in this directory
OK3588-linux-source  OK3588-linux-source.tar.bz2
  • forlinx@ubuntu: the username is forlinx and the hostname is ubuntu, indicating that the operation is performed in the development environment ubuntu.

  • //: Explanation of the instruction, no input required.

  • ls:Blue font, indicating the relevant commands that need to be manually entered.

  • OK3588-linux-source:Black font is the output information after entering the command; bold font is the key information; here is the packaged file system.

Application Scope

This manual is mainly applicable to the Forlinx Desktop22.04 operating system on the Forlinx OK3588-C platform. Other platforms can also refer to it, but there will be differences between different platforms. Please make modifications according to the actual conditions.

Revision History

Date

User Manual Version

SoM Version

Carrier Board Version

Revision History

04/11/2023

V1.0

V1.1

V1.1 and Above

OK3588-C Forlinx Desktop22.04 User’s Compilation Manual Initial Version

1. VMware Virtual Machine Software Installation

This chapter mainly introduces the installation ofVMware virtual machines, using VMware Workstation 15 Pro v15.1.0as an example to demonstrate the installation and configuration process of the operating system.

1.1 VMware Software Downloads and Purchase

Go to the VMware website https://www.vmware.com/cn.html to download Workstation Pro and get the product key. VMware is a paid software that requires purchasing, or you can choose to use a trial version.

Image

After the download is complete, double-click the startup file to start the installer.

1.2 VMware Software Installation

Double-click the startup program to enter the installation wizard, and click on “Next”.

Image

Check I accept the terms in the license agreement and click Next.

Image

Modify the installation location to the partition of your computer where the software is installed, and click “Next”.

Image

Uncheck and click on “Next”.

Image

Check Add Shortcut and click “Next”.

Image

Click “Installation”

Image

Wait for the installation to complete.

Image

Click “Finish” to try it out. If users need to use it for a long time, they need to buy it from the official and fill in the license.

Image

2. Loading the Existing Ubuntu Development Environment

Note:

  • It is recommended for beginners to directly use the pre-built virtual machine environment provided by Forlinx, which already includes installed cross-compiler and Qt environment. After understanding this chapter, you can directly jump to the compilation chapter for further study;

  • The development environment provided for general users is: forlinx (username), forlinx (password);

  • Please ask your sales representative for the download link.

There are two ways to use a virtual machine environment in VMware: one is to directly load an existing environment, and the other is to create a new environment. First talk about how to load an existing environment.

First, download the development environment provided by Forlinx. In the development environment documentation, there should be an MD5 checksum file. After downloading the development environment, you should verify the integrity of the compressed package using the MD5 checksum. (You can use an on-line MD5 checksum tool or download a specific MD5 checksum tool for this purpose). To check if the checksum in the verification file matches the checksum of the file itself. If they match, the file download is successful. If they don’t match, it suggests that the file may be corrupt, and you should consider downloading it again.

Image

Select all compressed files, right-click and extract to the current folder or your own directory:

Image

After the extraction is complete, you will obtain the development environment OK3588-VM15.1.0-ubuntu20.04.

The file “3588 development environment.vmx” in the OK3588-VM15.1.0-ubuntu20.04 folder is the file that you need to open to access the virtual machine.

Open the installed virtual machine.

Image

Navigate to the directory where the recently extracted OK3588-VM15.1.0-ubuntu20.04 virtual machine file is located, and double-click on the startup file to open it.

Image

Turn on this virtual machine after loading is complete to run it and enter the system’s interface.

Image

The default automatic login account is forlinx, and the password is forlinx.

3. New Ubuntu Development Environment Setup

Note: Beginners are not recommended to set up a system on their own. It is recommended to use an existing virtual machine environment. If you do not need to set up the environment, you can skip this section.

This chapter mainly explains the building process of Ubuntu system.

3.1 Ubuntu System Setting up

3.1.1 Ubuntu Virtual Machine Setup

Step 1: Open the VMware software and click [File]/ [New Virtual Machine]. Enter the following interface.

Image

Step 2: Select Custom and click “Next”.

Image

Select the compatibility with the corresponding version of VMware, which can be found in Help->About VMware Workstation, and click “Next”.

Image

Select Install the operating system later and click “Next”.

Image

Keep the default settings and click “Next”.

Image

Modify the name and installation location of your virtual machine, and click “Next”.

Image

Configure the number of CPU based on your computer’s actual specifications.

Image

Set the memory size according to the actual situation. It is recommended to use 16g

Image

Set the network type, default to NAT mode then click “Next”. Keep the default values for the remaining steps until you reach the step to specify the disk capacity.

Image

The default selection for the IO controller type here is LSI

Image

The default selection here is also SCSI.

Image

Choose to create a new virtual disk here.

Image

Set the disk size to 500G, select the disk provisioning format, and then click “Next”.

Image

Specify the disk file, the default one here is fine.

Image

Click “Finish” by default.

Image

The virtual machine creation is now complete.

In the next section, it will introduce the installation of Ubuntu system in the virtual machine, which is similar to the installation method in the real machine. Here we describe the method of installing Ubuntu system in a virtual machine.

3.1.2 System Installation

In the previous section, we have created a virtual machine, but we haven’t installed the operating system yet, so the virtual machine cannot be started. Next, we will install the Ubuntu operating system in the newly created virtual machine.

Step 1: Go to the Ubuntu official website to obtain the Ubuntu20.04 64.

The download address is: https://old-releases.ubuntu.com/releases/20.04.3/](https://old-releases.ubuntu.com/releases/20.04.3/

Because the source code is compiled and verified on the 20.04, select and install it. These operations may vary slightly between Ubuntu system versions.

Download “ubuntu-20.04.3-desktop-amd64.iso”

Image

After downloading the mirror image, you can proceed with the system installation operation.

Right-click on the created virtual machine name and select “Settings” from the pop-up menu.

Image

The “Virtual Machine Settings” menu will pop up.

Click on CD/DVD (SATA), select “Use ISO image file,” browse and choose the previously downloaded Ubuntu image, then click “OK” to confirm.

Image

After setting up the image, ensure that the network is available. Then, start the virtual machine and proceed with the installation of the Ubuntu image.

Image

After starting the virtual machine, wait for the installation interface to appear as shown below.

Image

After selecting the language on the left side as shown in the image, click “Install Ubuntu”, and the language selection interface will pop up. The default language of Ubuntu is English, but of course, you can also choose Others.

Image

The default selected language can also be reset at a later stage, after the selection is complete continue.

Image

Next, select “Continue” as the default option to proceed with the installation. The installation process might be slow. Then, click “Continue” again.

Image

By default, when you click on “Install Now”, a dialog box will appear as shown in the image. Simply click “Continue” to proceed.

Image

Next, select the timezone. You can either click on the Shanghai timezone or enter “Shanghai” (or choose the appropriate timezone based on your location). Then, click “Continue” to proceed.

Finally, set your username and password. You can choose either automatic login or login with a username and password. Click “Continue” to start the automatic installation.

Image

If the internet connection is poor, you can Skip without affecting the installation process.

Image

Click “Restart” Now to reboot.

Image

Image

The system interface after the reboot is complete.

Image

The ubuntu system installation is complete.

3.1.3 Ubuntu Basic Configuration

After installing the Ubuntu20.04 operating system, there are a few configurations to make.

VMware Tools Installation:

Next, install VMware Tools. Without installing this tool, you won’t be able to copy and paste and drag file between the Windows host and the virtual machine. First click on “Virtual Machine” on the VMware navigation bar, then click “Install VMware Tools” in the drop-down box.

Image

Once done, enter Ubuntu and the VMware Tools CD will appear on your desktop and click into it.

Image

Enter and see a compressed file VMwareTools-10.3.10-12406962.tar.gz (it may be different for different VM versions); copy the file under the home directory (i.e. the directory with the home personal username)

Image

Press [Ctrl+Alt+T] to bring up the Terminal Command Interface and enter the command:

forlinx@ubuntu:~$ sudo tar xvf VMwareTools-10.3.10-12406962.tar.gz

Image

After the extraction is complete, a file named “vmware-tools-distrib” will appear.

Image

Go back to the terminal and type cd vmware-tools-distrib to enter the directory.

Enter: sudo ./vmware-install.pl followed by pressing Enter. Then, enter your password and the installation process will begin. When prompted, you can input “yes” and press Enter to proceed. For any other inquiries, simply press Enter to go with the default installation settings.

Image

Once the VMware tools is complete, we can implement file copy and paste between Windows and Ubuntu.

The virtual machine is displayed full screen:

If the virtual machine is not able to be displayed in full screen, you can resolve this issue by clicking on “View” and selecting “Autofit Guest.” This will adjust the display to fit the screen automatically, enabling you to have a full-screen experience in the virtual machine.

Image

Make most of the system settings in the location shown. A lot of the setup requirements on Ubuntu can be done here.

Image

Virtual machine hibernation settings:

Also, the default hibernation is 5min, if you don’t want to set hibernation, just set it to Never by setting Power->Blank screen.

Image

3.1.4 Network Settings for Virtual Machines

3.1.4.1 NAT Connection Method

By default, after the virtual machine is installed, the network connection method is set to NAT, which shares the host machine’s IP address. This configuration does not need to be changed when performing tasks like installing dependencies or compiling code.

When the VMware virtual NIC is set to NAT mode in a virtual machine, the network in the Ubuntu environment can be set to dynamic IP. In this mode the virtual NAT device and the host NIC are connected to communicate for Internet access. This is the most common way to access the external network.

Image

3.1.4.2 Connections for Bridges

When the VMware virtual NIC device is in bridge mode, the host NIC and the virtual machine NIC communicate through the virtual bridge, and the network IP and the host need to be set in the same network segment in the Ubuntu environment. If accessing an external network, you need to set the DNS to be consistent with the host NIC. If TFTP, SFTP and other servers are used, the network contact mode of the virtual machine needs to be set as the bridge mode.

Image

3.2 Libraries for Installing Linux Compilation System

Note: If you use the development environment provided by us, this section can be skipped directly.

Compiling for Linux requires the installation of a number of toolkits. Make sure that your computer or virtual machine can be connected to the Internet normally before the operation in this section. If the network is disconnected during the installation, please follow the following steps to install.

  1. Install the necessary packages for compiling Linux.

forlinx@ubuntu:~$ sudo apt-get update
forlinx@ubuntu:~$ sudo apt-get install openssh-server vim git fakeroot           //Necessary toolkit installation
forlinx@ubuntu:~$ sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib unzip device-tree-compiler python-pip libncurses5-dev
forlinx@ubuntu:~$ sudo apt-get install -y expect time build-essential kmod python3.9

The following libraries also need to be installed when using the Network Configuration Tool and menuconfig:

forlinx@ubuntu:~$ sudo apt-get update                      //Update the download source information
forlinx@ubuntu:~$ sudo apt-get install libncurses*             //For building text-based user interfaces
forlinx@ubuntu:~$ sudo apt-get install net-tools               //Network configuration tool

3.3 Qt Creator Installation

Copy qt-creator-opensource-linux-x86_64-4.1.0.run to any directory within the current user’s home directory, and then run the following command.

Path: OK3588-C-C(Linux)user’s profile\Linux\source code\qt-creator-opensource-linux-x86_64-4.7.0.run

forlinx@ubuntu:~/3588$ ./qt-creator-opensource-linux-x86_64-4.7.0.run                   

Image

Then the installation window of the graphical interface will pop up, and install according to the instructions:

Image

Image

Image

Image

For online installation, register a Qt account (log in directly if you already have one). Password must include capital letters, uppercase, lowercase letters and numbers. After successful registration/login, click next. Skip this step for offline installation.

Image

Click “Next”.

Image

You can set the installation path according to your own habits. It is set by default here, so click “Next”.

Image

Installation completes, click “Next”.

Image

Image

Click “Install” and wait for the installation to complete.

Image

At this time, the Qt interface will be opened automatically. You can also start it through the command line. Execute the following command to open Qt Creator in the backstage. When the you open it, the actual installation path shall prevail:

forlinx@ubuntu:~$ cd /home/forlinx/qtcreator-4.7.0/bin
forlinx@ubuntu:~$ ./qtcreator &

Image

The Qt Creator tool screen appears. Qt Creator is installed.