Linux5.10.160_User’s Compilation Manual_V1.0
Document classification: □ Top secret □ Secret □ Internal information ■ Open
Copyright
The copyright of this manual belongs to Baoding Folinx Embedded Technology Co., Ltd. Without the written permission of our company, no organizations or individuals have the right to copy, distribute, or reproduce any part of this manual in any form, and violators will be held legally responsible.
Forlinx adheres to copyrights of all graphics and texts used in all publications in original or license-free forms.
The drivers and utilities used for the components are subject to the copyrights of the respective manufacturers. The license conditions of the respective manufacturer are to be adhered to. Related license expenses for the operating system and applications should be calculated/declared separately by the related party or its representatives. 1. VMware Virtual Machine Software Installation
1. VMware Virtual Machine Installation
This chapter mainly introduces the installation of the VMware virtual machine, using VMware Workstation 15 Pro v15.1.0 as an example to demonstrate the operating system installation and configuration process.
1.1 Downloading and Purchasing VMware Software
Visit the VMware official website at https://www.vmware.com/cn.html to download Workstation Pro and obtain the product key. VMware is paid software that requires individual purchase, or you can choose to use a trial version Version.

After the download is complete, double-click the setup file to launch the installer.
1.2 VMware Software Installation
Double-click the setup file to enter the installation wizard.

Click “Next.”

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

Modify the installation location to the partition on your computer where software is typically installed, then click “Next.”

Check, then click “Next.”

Check “Add shortcuts” and click “Next.”

Click “Install.”

Wait for the installation to complete.

After clicking “Finish,” you can start the trial. For long-term use, please purchase from the official website and enter the license key.
2. Loading an Existing Ubuntu Development Environment
Note:
It is recommended that beginners directly use the virtual machine environment pre-configured by Forlinx, which already has the cross-compiler and Qt environment installed. After reviewing this chapter, you can skip directly to the compilation chapters;
Development Environment Account: forlinx; password: forlinx.
There are two ways to use the virtual machine environment in VMware: one is to directly load an existing environment, and the other is to create a new environment. First explain how to load an existing environment.
First, download the development environment provided by Forlinx. The development environment package includes an MD5 checksum file. After downloading the package, you should verify the integrity of the compressed file by performing an MD5 checksum check. You can either use an online MD5 verification tool or download a dedicated MD5 verification tool, depending on your preference. Compare the checksum that you generate with the one listed in the checksum file. If they match, the downloaded file is intact. If they do not match, the file may be corrupted, and you will need to download it again.
Extract the Compressed File:

After the extraction is complete, select the .vmx file as the virtual machine file to open.
Open the virtual machine and choose the extracted 3588 development environment.vmx file.

Once it has finished loading, click to start the virtual machine, and you will be able to run it and enter the system interface.”

The development environment account is: forlinx, and the password is : forlinx. After entering the password, select Sign in to log in


3. Setting Up a New Ubuntu Development Environment
Note: It is not recommended for beginners to build the system by themselves. It is recommended to use the existing virtual machine environment. This section can be skipped if there is no need to build the environment.
3.1 Ubuntu System Setup
3.1.1 Creating an Ubuntu Virtual Machine
Open the VMware software and click “Create a New Virtual Machine”. Enter the following interface:

Select ‘’Custom’’ and click ‘’Next.’’

Choose the compatibility for the corresponding VMware version. The version can be found under Help ->About VMware Workstation. Click ‘’Next.’’

Select install the operation later and click Select ‘’I will install the operating system later’’ and click ‘’Next.’’

Keep the default settings and click ‘’Next.’’

Modify the virtual machine’s name and installation location, then click ‘’Next.’’

Set the number of processors according to your needs.

Similarly, set the memory size according to your needs. It is recommended to use 16GB.

Set the network type, the default is NAT mode, and click “Next.” Subsequent steps remain at their default values until the disk capacity step is specified.

Choose the default LSI for the IO controller type.

Similarly, select SCSI as the default here.

Choose to create a new virtual disk:

Set the disk size to 200GB and select the disk’s format, then click ‘Next’ to complete.

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

Click ‘’Finish’’ by default to complete.

At this point, the virtual machine creation is complete.
The installation process on a physical machine is similar to the one on a virtual machine, but here we will focus on installing Ubuntu in the virtual machine.
3.1.2 System Installation
The installed Ubuntu version is 20.04. First, go to the official Ubuntu website to download the Ubuntu 20.04 64-bit ISO image. The download link is: http://sources.ubuntu.com/20.04/
. Download the version ubuntu-20.04.6-desktop-amd64.iso.

Right-click the Ubuntu 64-bit virtual machine that was created and select “Settings” from the context menu.

The “Virtual Machine Settings Menu” will pop up as shown in the image below.

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

After configuring the image, ensure that the network is working, and then start the virtual machine to begin installing the Ubuntu image.

Once the virtual machine starts, wait for the installation interface to appear as shown below.

Select the language on the left side and click “Install Ubuntu.” A language selection screen will pop up.
By default, Ubuntu’s language is English, but you can also select Chinese. The selected language can be changed later during the installation. Once you’ve selected the language, click “Continue”.

Next, choose the default option, click Continue to proceed with the installation. The process will take some time. Then click Continue again.

Click “Install Now” by default, and a prompt will appear. Click “Continue” to proceed.


Choose your timezone. Here, you can click Shanghai or type Shanghai to select the timezone (choose a different timezone based on your location if needed), and click Continue. Finally, set up your username and password. Click Continue, and the installation will begin automatically.

The installation process is shown in the figure below. If the network is not good, you can skip it without affecting the installation.

After the installation is completed, as shown in the following figure, click “Restart Now” Restart “ (or click” Restart Client “):


After restarting and logging in, the system interface is as shown below:

3.1.3 Basic Configuration of Ubuntu
After installing the Ubuntu 20.04 operating system, some configurations need to be done.
VMware Tools Installation:
Next, install VMware Tools. Without this tool, you won’t be able to copy and paste or drag files between the Windows host and the virtual machine. First, click on Virtual Machine in the VMware navigation bar, then select Install VMware Tools from the dropdown menu.

After this, go to the Ubuntu desktop, where you will see the VMware Tools disk icon. Click to open it.

Inside, you will see a compressed file named VMwareTools-10.3.10-12406962.tar.gz (the version number may vary depending on the VMware version).

Copy the file to the home directory (i.e., the personal username directory).


Open a terminal by pressing Ctrl + Alt + T, and use the tar command to extract the VMware Tools installation package. Use sudo to run the command (you will be prompted to enter your password. Linux passwords do not show any feedback when typed, so ensure the password is correct and press Enter to confirm).
forlinx@ubuntu:~$ sudo tar -xvf VMwareTools-10.3.10-12406962.tar.gz
[sudo] password for forlinx:
After the extraction, use the ls command to check, and you should see a vmware-tools-distrib directory. Enter this directory.
forlinx@ubuntu:~$ ls
Desktop examples.desktop nfs snap tftp VMwareTools-10.3.10-12406962.tar.gz vmware-tools-distrib work
forlinx@ubuntu:~$ cd vmware-tools-distrib/ //Use the CD command to enter the directory
forlinx@ubuntu:~/vmware-tools-distrib$ ls //View the files in this directory
bin caf doc etc FILES INSTALL installer lib vgauth vmware-install.pl
In the current directory, type sudo ./vmware-install.pl to start the installation. After pressing Enter, input your password, and the installation process will begin. If you are prompted with [yes]/[no], type yes, and for other prompts, press Enter to go with the default installation options.
forlinx@ubuntu:~/vmware-tools-distrib$ sudo ./vmware-install.pl
[sudo] password for forlinx: //Enter the password of the forlinx account, no response, cannot see the input content
The installation process may take some time, and this part is skipped in the instructions.
open-vm-tools packages are available from the OS vendor and VMware recommends
using open-vm-tools packages. See http://kb.vmware.com/kb/2073803 for more
information.
Do you still want to proceed with this installation? [no] yes //输入yes
... ...
After installation, VMware Tools will enable file copy/paste between Windows and Ubuntu, as well as full-screen adjustments for the virtual machine. If the virtual machine is not displaying in full-screen mode, click View, select Auto-resize guest display, and choose Fit Guest Now to solve the full-screen issue. This means VMware Tools has been successfully installed.

Basic Configuration:
Most system settings can be configured in the location shown in the figure. Many settings requirements on Ubuntu can be completed here.

3.1.4 Network Configuration of Ubuntu
NAT Mode
Before using the network, make sure that your virtual machine can connect to the internet. Open the virtual machine settings, and change the network adapter’s network bridging mode to NAT Mode:

In the virtual machine, when the VMware virtual network adapter is set to NAT mode, the network in the Ubuntu environment should be set to dynamic IP. In this mode, the virtual NAT device and the host network card are connected. This is the most commonly used method to connect the virtual machine to the external network.

The network is set to dynamic IP.

Bridge Mode:
If using servers like TFTP or SFTP, you need to set the virtual machine’s network connection to Bridged Mode. When Vmware virtual network card is set to bridged mode, the host network card and the virtual machine network card communicate through a virtual bridge, and you need to ensure that the IP address of Ubuntu is in the same subnet as the host machine.


Set the static IP. At this time, the Ubuntu IP and the host IP should be set in the same network segment.


Note: The IP and DNS settings mentioned in the network configuration section should be configured based on the user’s actual environment. The manual provides examples for illustration.
3.1.5 USB Device Loading
Open the virtual machine settings, go to USB Controller, and in the compatibility section, choose USB 3.0, then click OK. As shown below, most modern computers support USB 3.0 ports. If not configured, the USB 3.0 device will not be connected to the virtual machine when inserted. As shown in the figure:

After the virtual machine starts, insert the USB flash drive. An icon similar to a “USB drive” will appear in the lower-right corner of the virtual machine. Right-click it and select Connect. Then, you should see a new directory in the file system, indicating that the USB drive has been successfully loaded, as shown below:


3.1.6 Basic Library Installation for the Virtual Machine
Before development, some other necessary libraries need to be installed. Use the following commands to install them one by one. Make sure the network is functioning properly and can connect to the internet before installing.
forlinx@ubuntu:~$ sudo apt-get update # Update the package source information
forlinx@ubuntu:~$ sudo apt-get install build-essential # Install essential software packages for compiling programs
forlinx@ubuntu:~$ sudo apt-get install libncurses* # Install libraries for generating text-based user interfaces
forlinx@ubuntu:~$ sudo apt-get install lzop # Install Lzo-based compression and decompression tool
forlinx@ubuntu:~$ sudo apt-get install net-tools # Install network configuration tools
3.1.7 Installation of Necessary Libraries for Compiling OK3568 Linux Source Code
forlinx@ubuntu:~$ sudo apt-get update # Update the apt-get package sources
forlinx@ubuntu:~$ sudo apt-get install openssh-server vim git fakeroot # Install essential tool packages
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 libgmp-dev libmpc-dev libicu-dev bsdmainutils
These libraries are required when setting up the 3568 Linux compilation environment and preparing to compile the Linux source code. If you’re not setting up the OK3568 Linux development environment, you can skip this step.
3.1.8 Increasing Swap Partition Size
Please check the current system swap partition size. If the swap partition is insufficient, it can cause source code compilation to fail. It is recommended to have 16GB for the swap partition. It is also suggested to adjust the development environment memory to 16GB.
1. Check the Swap Partition:
forlinx@ubuntu:~$ cat /proc/swaps
The virtual machine provided by Forlinx has already configured the swap partition. If you are using another virtual machine, you can increase the swap partition size by creating a swap file.
forlinx@ubuntu:~$ sudo swapoff /swapfile
forlinx@ubuntu:~$ sudo fallocate -l 10G /swapfile
forlinx@ubuntu:~$ sudo chmod 600 /swapfile
forlinx@ubuntu:~$ sudo mkswap /swapfile
forlinx@ubuntu:~$ sudo swapon /swapfile
forlinx@ubuntu:~$ sudo vim /etc/fstab
Add the following content at the end of the /etc/fstab file:
forlinx@ubuntu:~$ /swapfile none swap sw 0 0
2. Memory Adjustment:
It is recommended to adjust the development environment memory to 16GB. Low memory may cause compilation failure.
3.2 Qt Creator Installation
Copy the file qt-creator-opensource-linux-x86_64-4.7.0.run to any directory in the current user’s home directory and execute the following command.
Path: OK3568-C (Linux) User Data\Linux\Source\qt-creator-opensource-linux-x86_64-4.7.0.run
forlinx@ubuntu:~$ ./qt-creator-opensource-linux-x86_64-4.7.0.run

This will open a graphical installation window. Follow the prompts to install:


Online users need to register for a Qt account. Existing Qt account holders can log in directly. The Qt password requires a mix of uppercase letters, lowercase letters, and numbers. After registering and logging in successfully, click Next.
Offline users can click Skip.

Click “Next”:

You can set the installation path according to your preferences; here use the default here. Click “Next”.

Choose Complete Installation and click “Next”.


Click Install and wait for the installation to complete.

After installation, click Finish. The Qt interface will automatically open, or you can launch it from the command line. To open Qt Creator in the background, use the following command, replacing it with your actual installation path:
forlinx@ubuntu:~$ cd /home/forlinx/qtcreator-4.7.0/bin
forlinx@ubuntu:~$ ./qtcreator &

The Qt Creator tool interface will appear. Qt Creator installation is now complete.















