Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Construction of Ubuntu-18.04 LTS embedded linux Development Environment

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Construction of Ubuntu-18.04 LTS embedded linux Development Environment

Ubuntu-18.04 LTS was officially released on April 26, 2018, and many netizens can't wait to download and install it. At the same time, they also share their installation experience on the blog, dividing the articles of desktop and server, and writing them a little easier. I have been busy with the design of embedded AI ARM+VPU platform these months, and did not experience ubuntu-18.04 LTS in time, but I also have to keep up with the pace, because the latest version of SDK3.9.1 on DM8127 platform developed by our company last year requires a 64bit virtual machine, and the Intel Movidius Myriad 2 VPU I am playing with, in which the SDK package involves deep learning, and relatively new Python programming, such as Caffe and GOOGLE Tensorflow, all need a high version of ubuntu to support. So I downloaded and installed it these days. In the process of experience, I found some places that need to be paid attention to, so I decided to write it down and share it so that netizens could criticize and correct it. Also, the company focuses on embedded linux image recognition and machine vision development (TI DM8127, Hayes Hi3516D,Hi3519 platform). I will write this development environment from the perspective of embedded linux, which is quite different from other netizens' articles. I hope it will be helpful to some friends who like embedded linux.

1. A brief introduction to ubuntu-18.04 LTS

Ubuntu-18.04 LTS long-term support version code-named Bionic Beaver, using linux kernel v4.15 version

Ubuntu-16.04 LTS's Unity has been cancelled and replaced by ubuntu-18.04 LTS gnome. Other detailed advantages and disadvantages can be found in other netizens' articles and official introductions. Download address: https://www.ubuntu.com/download/alternative-downloads

Let's start our construction steps, using pictures. Some of the steps are similar to the ubuntu-16.04 LTS described in my "Image recognition DM8127 Development Strategy-Development Environment Building". After all, the interval between the two versions is not very long.

2. VMware-workstation-full-14.1.2 installation (for learning reference only)

We have been using the VMware virtual machine, as mentioned in many previous development strategy articles, in order to install ubuntu-18.04 LTS normally, we can only use this latest virtual machine version. At the beginning, I used VMware-workstation-full-12.5.7 and found that the installation was not smooth, especially when installing to the VMware tools shared folder, failed. Then I tried to use VMware-workstation-full-14.1.2 to reinstall ubuntu-18.04 LTS, and everything went well.

Click to install VMware-workstation-full-14.1.2. If your computer has an old version of the VM virtual machine, you can uninstall and then install the latest VM virtual machine. This does not affect the development environment in which you previously installed ubuntu * .vmdk, such as our previous Ubuntu16_dm8127.vmdk, which was installed using VMware-workstation-full-12.5.7. Now that you have installed VMware-workstation-full-14.1.2, you can also use it, and the new version of VM is sure to be compatible with previous versions.

Figure-1

Select a good path to install according to figure-1, for example, generally put it on disk D.

Figure-2

It is best not to check the version downloaded from the Internet.

Figure-3

Do not click "finish" after installation, you should use "license" to deal with it. I can not provide the key here, if you want to find it on the Internet, hehe. After entering the key to complete the VMware-workstation-full-14.1.2 installation, do not install ubuntu18.04 immediately. We need to enter the property configuration interface under the network properties under WIN7. See the figure below, select VMware Network Adapter VMnet1 for "share", so that when you create a ubuntu18.04 virtual machine later, you can use the bridging network port mode to allow the virtual machine to access the shared folder of WIN7, and so on.

Figure-4

Then restart the computer and install ubuntu-18.04 LTS, the effect is estimated to be better

III. Ubuntu-18.04 LTS installation

Figure-5

Figure-6

Figure-7

Figure-8

Figure-9

The company's development department computers are basically more than 8 GB of memory, we generally recommend the use of 3G memory for virtual machines, the minimum requirement is 2G.

Figure-10

Figure-11

Figure-12

Figure-13

Figure-14

Old topic, save a single file of the virtual machine, easy to manage under WIN7, so as to compress and save the virtual machine for backup. Find a partition with a larger space under WIN7 and allocate at least 50g of space to the virtual machine, because there are a lot of things to install in the future.

Figure-15

Figure-16

First click "Custom hardware", press figure-17, figure-18 settings, and then click finish.

Figure-17

Find the ubuntu-18.04-desktop-amd64.iso image file you downloaded.

Figure-18

Figure-18 chooses this virtualized Intel VT-x/EPT to ensure that the ubuntu-18.04 64-bit operating system is installed later, and the initial installation is unsuccessful, as shown in figure-20.

Figure-19

Figure-20

Figure-21

If you choose virtualized Intel VT-x/EPT in figure-18 and cannot solve the installation problem of ubuntu-18.04 64-bit operating system, you need to enter BIOS to set up when you start your computer. See figure-21 for selection, save and exit BIOS, and OK.

Figure-22

Enter the familiar installation interface and continue to look at the picture.

Figure-23

Figure-24

Allow you to upgrade and install some third-party software packages.

Figure-25

Figure-26

Figure-27

Figure-28

The company focuses on making embedded AI ARM+VPU platform, and our ordinary user name is ubuntu18vpu. The name definition of figure-28 is shown in figure vpu@ai-vpu:, below as shown in figure-29.

Figure-29

Figure-30

Start installing ubuntu-18.04 for a long time.

Figure-31

After the ubuntu-18.04 installation is finished, do not restart the virtual machine Restart Now hastily, you should first disconnect the image connection of the virtual machine CD according to figure-31, that is, do not let the virtual machine continue to run the ubuntu-18.04-desktop-amd64.iso file when the virtual machine starts.

Figure-32

Finally, restart the virtual machine.

Fourth, build a good development environment for ubuntu-18.04 LTS

1. Ubuntu-18.04 LTS supports ordinary users to log in.

Figure-33

Figure-34

After installing ubuntu-18.04 according to the above steps, restart the virtual machine and enter the ordinary user login interface in figure-33. I find that the login time is a bit slow. At present, there is no time to optimize the startup script of ubuntu-18.04. Some people on the Internet say that it is an interface management tool. Plymouth-read-write.service and plymouth-quit-wait.service, which are responsible for the system startup graphic display, take more than 50 seconds. Some say it is a problem with the installation of the graphics card driver in the virtual machine), click on the ordinary user account and enter the password to log in.

Figure-35

Next, let's familiarize ourselves with the interface of ubuntu-18.04 LTS. The nine dots in the lower left corner are: Show Applications, click on it, and get familiar with it. In particular, see figure-35 for the settings interface, first set up a wired network to ensure that you can surf the Internet in ubuntu-18.04, otherwise you can't upgrade the software package. Other settings can be optimized later.

Figure-36

In the settings interface of figure-35, if we click the Wired in Network, the interface in figure-36 will appear and enter the familiar network configuration. In order to route to the external network through our company, this DNS must be consistent with the DNS assigned by the router connected to the external network of your company. After the network is set up, we can click on the Firefox browser to open the web page for testing. Once the network is connected, we can do these operations of apt install.

2. Ubuntu-18.04 LTS supports root login

First of all, when an ordinary user logs in, use # sudo su, then enter the password of the ordinary user ubuntu18vpu 1234567, and temporarily switch to the operation under the authority of root.

Install the vim editor first, and the # apt-get install and # apt install commands are the same.

# apt install vim

# apt install v p n c git (v p n c is blocked, please note that there is no space)

Figure-37

Figure-38

Then press figure-38 to enter the / etc/pam.d directory, # vim gdm-autologin

Figure-39

Press figure-39 to modify the screen, and then save the file to exit.

Figure-40

Click figure-40 to modify, # vim gdm-password, save and exit.

Figure-41

Use # passwd root, add root, and set the login password for root twice. We use a simple 1234567 password, as shown in figure-41.

Then edit the / root/.profile file, # vim / root/.profile

Figure-42

Click the red box in figure-42 to modify, first block mesg n | | true, and then add:

Tty-s & & mesg n | | true

Save exit.

Restart the virtual machine and enter the login screen below.

Figure-43

Figure-44

Figure-45

Click "Not listed?" to select root login, see figure-43, figure-44, figure-45.

To do linux embedded development, we like to use root permissions to operate, the following other steps are also done under the authority of root.

3. Ubuntu-18.04 LTS optimized interface

Let's go back to the settings interface of figure-35 and continue to optimize the ubuntu-18.04 LTS environment, such as setting the background Background, setting the power Power, turning off the screensaver and so on.

Figure-46

Figure-47

To set the display device mode, we choose 1280mm 800 mode. At the beginning, you can't see the whole interface. You can press figure-48 to operate it.

Figure-48

Right-click on Displays, and then select "Move"

Figure-49

Install the net-tools tool:

Ubuntu-18.04,ifconfig has been replaced by ip, for example, ifconfig-a should be changed to ip-a, but we need to use ifconfig in some scripts and later to install VMware-tools.

# apt-get install net-tools

Figure-50

Install gnome optimization interface tools, this benefit can be poisonous.

# apt install gnome-tweak-tool

# apt install gnome-shell-extensions

# apt install chrome-gnome-shell

Continue to install useful tools

# apt install make (Oh, my God, this command doesn't come with us by default, and we have to install it ourselves)

# apt install unrar

Install the folder and file comparison tool meld

# apt install meld

4. Install VMware-tools in ubuntu-18.04 LTS

Figure-51

Run the ubuntu-18.04 virtual machine, then click the VMware Workstation menu, as shown in figure-51.

Figure-52

The CD in the virtual machine will be linked to the image of VMware tools.

Figure-53

Figure-54

In the / media/root/VMware Tools directory, extract the package to a temporary directory.

Figure-55

After unpacking, go to the vmware-tools-distrib folder of the temporary directory and execute. / vmware-install.pl.

Figure-56

Be sure to enter "Y" to enter.

Figure-57

This figure-57 is that if there is no pre-installed apt install net-tools, there will be no common ifconfig commands, there will be the problem of figure-57, and then enter "yes" to solve the problem, but follow the steps in this article to install, there will be no reason why you can not find ifconfig, VMware-tools installation will be more smooth.

Figure-58

After installing the VMware-tools, we continue to set up the virtual machine.

Figure-59

Set up and share folders with WIN7.

Figure-60

Produce a new shared folder on a disk in WIN7.

Figure-61

When you go to figure-61, you can basically finish the shared folder between WIN7 and ubuntu-18.04 in the virtual machine. From the command line of ubuntu-18.04, enter:

# cd / mnt/hgfs

# ls

You can see the name of the shared folder ubuntu18s.

5. The solution to the dormant crash of ubuntu-18.04

Some netizens give the following methods:

# apt install pm-units (ubuntu-18.04 comes with its own installation and may not be installed)

# apt install laptop-mode-tools

# gedit / etc/laptop-mode/laptop-mode.conf

Figure-62

Save exit

# laptop_mode start

# cat / proc/sys/vm/laptop_mode

If the display value is non-0, it is OK.

Here I have not tested to update the video card driver in the VM virtual machine. So this problem is still not well solved, if there are netizens who can thoroughly this BUG, you can share it and learn.

(add: updating the ubuntu-18.04 kernel version to 4.15.18 and updating the nvidia-390 nvidia-prime graphics card driver at the same time can solve this problem, thanks to netizens: https://www.cnblogs.com/maxuewei2/p/8974243.html)

5. Install TFTP server

Ubuntu-18.04 installs TFTP server the same as ubuntu-16.04.

Using tftpd-hpa, which is an enhanced TFTP server

# apt install xinetd

# apt install tftpd-hpa

(note: do not install the tftp-hpa client, otherwise the board will not be able to TFTP download BIN files)

# mkdir / tftpboot

# chmod-R 777/tftpboot

# gedit / etc/default/tftpd-hpa

Figure-63

6. Install NFS server

# apt install nfs-kernel-server

# gedit / etc/exports

Figure-64

Click the above figure to add the directory of the NFS file system to be mounted after adding the board

There is one more thing that needs to be changed:

After Ubuntu 17.10, nfs only supports protocol 3 and protocol 4 by default, but the embedded board uboot starts protocol 2 by default. If you want to require the host nfs to support protocol 2, you must:

# gedit / etc/default/nfs-kernel-server

Add at the tail:

RPCNFSDOPTS= "--nfs-version 2, debug 3, 4-debug-- syslog"

Figure-65

Save the file to exit, and finally do:

# / usr/sbin/exportfs-av

# / etc/init.d/nfs-kernel-server restart

Then take the Hayes Hi3516D board we developed, set the bootarg NFS login parameters in UBOOT, and power on the embedded Hi3516D board.

Figure-66

The appearance of figure-65 shows that the NFS setting is successful.

VII. Summary

At this point, more than half of the ubuntu-18.04 LTS embedded development environment has been built, why do you say so? Because the cross-compilation environment of the embedded board has not been built, I do not want to add it here, because the platforms we have developed are DM8127 (ARM+DSP), Hi3516 (ARM+IVE), Hi3519 (ARM+IVE), and the VPU platform that supports deep learning. The cross-compilation tools for each platform are different, so I will stop here. Later, you are interested in building a cross-compilation environment for other Hi3516-Hi3519, while the development environment for DM8127 has been written before, but the latest SDK version 3.9.1 requires a 64-bit operating system, and the other building steps are more or less the same. Our focus here is on how to build an embedded LINUX development environment on ubuntu-18.04 LTS, because ubuntu-18.04 LTS has just been released, a lot of things need to be experienced and revised, I wrote it, hoping to be corrected by experts to make the ubuntu-18.04 LTS development environment more smooth and easy to use. My communication contact information: QQ:2505133162.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report