Ubuntu-18.04 LTS embedded linux development environment setup
ubuntu-18.04 Lts officially released on April 26, 2018, many netizens have been eager to download the installation, but also in the blog to share their own installation experience, sub-desktop and server articles, written a little easier. I have been busy these months embedded AI Arm+vpu platform design, not in time to experience ubuntu-18.04 LTS, but I also have to keep up with the pace, Because the latest version of the DM8127 platform developed by the company last year SDK3.9.1 need to use 64bit virtual machine, is playing the Intel Movidius Myriad 2 VPU, the SDK package involves deep learning, with the use of relatively new Python programming, For example, Caffe and Google's TensorFlow, all need a high version of Ubuntu to support, so these days to download the installation experience a bit. Experience in the process of finding some places to pay attention to, so decided to write down to share, let netizens criticize. Also the company focuses on embedded Linux image recognition, Machine vision development (TI DM8127, HiSilicon hi3516d,hi3519 platform), I will from the embedded Linux perspective to write this development environment, this and other netizens wrote the article there is a big difference, Want to be helpful to some friends who love embedded Linux.
ubuntu-18.04 lts Simple Introduction
ubuntu-18.04 lts Long-term support version code called Bionic Beaver, using the Linux kernel v4.15 version,
ubuntu-16.04 LTS Unity was canceled, replaced by ubuntu-18.04 Lts GNOME, other detailed advantages and disadvantages can be seen in other users of the article and the official introduction. : Https://www.ubuntu.com/download/alternative-downloads,
Under the beginning of our construction steps, with the diagram to speak, some steps and I wrote the "Image recognition DM8127 development strategy-- The ubuntu-16.04 Lts described in the development environment is similar, after all, the two release time interval is not very long.
Second, vmware-workstation-full-14.1.2 installation (for learning reference only)
We have been using VMware virtual machines, as many of the previous development tips articles have mentioned, in order to properly install ubuntu-18.04 LTS, we can only use this latest version of the virtual machine, At first 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 will try to use vmware-workstation-full-14.1.2 to reinstall ubuntu-18.04 LTS, everything goes well.
Click Install vmware-workstation-full-14.1.2, if the computer above the previous version of VM virtual machine, you can uninstall, and then install the latest VM virtual machine, this does not affect you previously installed in the use of those Ubuntu *.VMDK development environment, Like our old ubuntu16_. DM8127.VMDK, which is installed using vmware-workstation-full-12.5.7, is now installed well vmware-workstation-full-14.1.2 can also be used, the new version of the VM is definitely compatible with the previous version of the thing.
choose a good path to install, such as generally on the D drive.
It is better not to tick the download version on the Internet.
Do not rush to click "Done" after installation, you should use "license" to deal with. I do not provide a key here, to the words of their own online search, hehe. After entering the key to complete vmware-workstation-full-14.1.2 installation, do not immediately go to install ubuntu18.04, we need to first in WIN7 below the network properties into the property configuration interface. See, "Share" where you select VMware Network Adapter VMnet1, so that when you create a ubuntu18.04 virtual machine later, you can use the Bridge Gateway mode to allow the virtual machine to access the WIN7 shared folders and so on.
Then restart the computer, and then install ubuntu-18.04 LTS, the effect is better estimated
Third, ubuntu-18.04 LTS installation
The company's development department computer is basically 8G memory above, we generally recommend the use of 3G memory to the virtual machine, the minimum requirement is 2G.
Old topic, save virtual machine separate a file, under WIN7 good management, good compress save virtual machine for backup. Find a larger partition under WIN7, with at least 50G of space for the virtual machine, because there will be a lot of things to install later.
First click on "Custom Hardware", and then click Finish.
Find the Ubuntu-18.04-desktop-amd64.iso image file you downloaded.
Select this virtualization Intel Vt-x/ept, is guaranteed to start installing ubuntu-18.04 64-bit operating system, the initial installation is unsuccessful.
If you chose the virtualization Intel Vt-x/ept in Figure 18 also can not solve ubuntu-18.04 64-bit operating system installation problems, you need to start the computer, enter the BIOS to set, save exit bios, OK.
Go to the familiar installation interface and continue to see the diagram.
Allow upgrades to install some 3rd party packages.
Company focus on the platform to do embedded AI arm+vpu, we take the ordinary user name is called Ubuntu18vpu Bar. Figure 28 of the name definition will be reflected in [email protected]:
Start installing ubuntu-18.04 for a long time.
ubuntu-18.04 after installation, do not restart the virtual machine Restart now, you should first disconnect the virtual machine disc image by Figure 31, that is, do not allow the virtual machine to continue to run the Ubuntu-18.04-desktop-amd64.iso file when it starts.
Finally, restart the virtual machine.
Iv. Building a good development environment for ubuntu-18.04 LTS
1. ubuntu-18.04 LTS supports normal user login
Follow the above steps to install the ubuntu-18.04, restart the virtual machine, into the figure 33 of the normal user login interface (I found that the login time is a bit slow, there is no time to optimize the ubuntu-18.04 startup script, the Internet is said to be the interface management tool, responsible for the system to start the graphical display of the Plymouth-r Ead-write.service and Plymouth-quit-wait.service took more than 50 seconds, some said that the virtual machine inside the graphics card driver installation problem), click on the ordinary user account, enter the password login.
Next we are familiar with ubuntu-18.04 LTS interface, the lower left corner of the 9 points is: Show applications, click on it, familiar with it. In particular, the settings interface is shown in Figure 35, the first set up a wired network to ensure that the ubuntu-18.04 can be connected to the Internet, or can not be upgraded package. Other settings can be put back and then optimized.
In Figure 35 of the settings interface, we click on the network inside the Wired, you will see a figure 36 interface, enter the familiar network configuration, in order to pass our company routed to the extranet, this DNS must be based on your company to connect the network router assigned DNS consistent. After the network is set up, we can click on the Firefox browser to open the Web test, Internet access can do apt install these operations.
2. ubuntu-18.04 LTS supports root login
First, in the case of normal user login, use #sudo su, and then enter the password of the normal user Ubuntu18vpu 1234567, temporarily switch to the root permission to operate.
Install the Vim editor first, #apt-get install and the #apt Install command are the same.
#apt Install Vim
#apt Install v P n c git (v P n C is blocked, note no space)
Then follow figure 38 into the/ETC/PAM.D directory, #vim Gdm-autologin
Modify the mask as shown in Figure 39, and then save the file to exit.
Edit as per figure-40, #vim Gdm-password, save exit.
Using #passwd root, add root, and set the root login password 2 times, we use a simple 1234567 password, see figure-41.
Then edit the/root/.profile file, #vim/root/.profile
According to figure-42 red box to modify, first shielding MESG n | | True, and then add later:
Tty–s && MESG N | | True
Save exit.
Restart the virtual machine and enter the login screen below.
Click "not listed?" to select the root login, see Figure 43, figure-44, figure-45.
Do Linux embedded development, we like to use root permissions to operate, the following other steps are also under the authority of Root to do.
3. ubuntu-18.04 Lts Optimized interface
We 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 power off the screensaver, etc.
To set the display device mode, we select 1280*800 mode. Just start to see the entire interface, you can press-48 to operate,
Right-click on the top of displays, then select "Move",
To install the Net-tools tool:
In Ubuntu-18.04,ifconfig has been replaced by IP, such as ifconfig–a should be changed to ip–a, but we have some scripts need to use Ifconfig, after the installation of Vmware-tools need to use,
#apt-get Install Net-tools
Install the Gnome Optimization Interface tool, which can be a poison.
#apt Install Gnome-tweak-tool
#apt Install Gnome-shell-extensions
#apt Install Chrome-gnome-shell
Continue to install useful tools
#apt Install Unrar
installation folder and file Comparison tool meld
#apt Install Meld
4, in ubuntu-18.04 LTS installation Vmware-tools
Run the ubuntu-18.04 virtual machine and click on the VMware Workstation menu, see Figure 51.
The discs inside the virtual machine are linked to the images of VMware tools.
Under the/media/root/vmware Tools directory, unzip the zipped file package to a temporary directory.
After extracting, go to the Vmware-tools-distrib folder of the temp directory and execute the./vmware-install.pl.
Be sure to enter the "Y" carriage return.
This figure-57 of the place is that if you do not install the APT install net-tools, there is no ifconfig commonly used commands, there will be a graph 57 problem, and then enter "yes" to solve the problem, but follow the steps of this article to install, There will be no reason to find Ifconfig, vmware-tools installation will be smooth.
After the installation vmware-tools is finished, we continue to set up the virtual machine.
Set up and WIN7 shared folders.
A new shared folder is produced on a disk in WIN7.
To figure-61 where the basic WIN7 and virtual machine inside the ubuntu-18.04 shared folder. In the command line of the ubuntu-18.04 enter:
#cd/mnt/hgfs
#ls
You can see the name of the shared folder ubuntu18s.
5, solve the ubuntu-18.04 sleep freezing method
A netizen gives the following methods:
#apt Install Pm-units (ubuntu-18.04 has been installed, can not install)
#apt Install Laptop-mode-tools
#gedit/etc/laptop-mode/laptop-mode.conf
Save exit
#laptop_mode start
#cat/proc/sys/vm/laptop_mode
If the display value is not 0, then OK.
The above is the method provided by netizens, but I test or not, is my computer WIN7 into hibernation, is running in the virtual machine ubuntu-18.04 or the crash, the analysis of a lot of netizens the same problem, it is likely that the problem of graphics driver, there is a kernel version of the problem. I have not tested the graphics drivers in VM VMs yet. So this problem is still not very good solution, if a netizen can thoroughly this bug, can share out study.
V. Installing the TFTP server
ubuntu-18.04 install TFTP server and ubuntu-16.04.
Using TFTPD-HPA, it is a feature-enhanced TFTP server,
#apt Install xinetd
#apt Install TFTPD-HPA
(Note: Do not install TFTP-HPA client, otherwise the board cannot tftp download bin file)
#mkdir/tftpboot
#chmod –R 777/tftpboot
#gedit/ETC/DEFAULT/TFTPD-HPA
Then the embedded board to burn write bin file put to this/tftpboot directory, in the board of U-boot to tftp download the corresponding file, OK no problem, you can download the normal burn write.
VI. Installation of NFS server
#apt Install Nfs-kernel-server
#gedit/etc/exports
Directory of NFS file systems to be mounted after adding the board
There is another place to change:
After Ubuntu 17.10, NFS only supports protocol 3 and protocol 4 by default, but the embedded board Uboot is protocol 2, and if you want to require host NFS Support protocol 2, you need to:
#gedit/etc/default/nfs-kernel-server
Trailing add:
rpcnfsdopts= "--nfs-version 2,3,4--debug--syslog"
Save the file exit and do the last:
#/usr/sbin/exportfs–av
#/etc/init.d/nfs-kernel-server restart
Then take our development of the HiSilicon hi3516d board, in the Uboot set the Bootarg NFS login parameters, power-up start embedded hi3516d board.
A figure of 65 shows that the NFS Setup was successful.
Vii. Summary
So far, ubuntu-18.04 LTS embedded development environment has been set up good more than half, why say? Because the embedded board cross-compiler environment has not been set up, I do not want to add here, because we have developed a platform DM8127 (ARM+DSP), Hi3516 (arm+ive), Hi3519 (arm+ive), and support deep learning VPU platform, The cross-compilation tool for each platform is different, so I wrote it here. Later interested in writing other hi3516-hi3519 cross-build environment, and DM8127 development environment has been written before, but the latest SDK version 3.9.1 need to use 64-bit operating system, the other building steps are similar. Our focus here is how to build an embedded Linux development environment in ubuntu-18.04 LTS, because ubuntu-18.04 Lts just released soon, a lot of things need to experience and correction, I write, hope to get a master correct, let ubuntu-18.04 LTS development environment is more smooth and usable. I exchange contact: qq:2505133162.
Ubuntu-18.04 LTS Embedded Linux development environment Setup