We are happy to announce that it appears that LattePanda owners can install Ubuntu operating systems using Linuxium and some associated programs which make it possible to actually use these operating systems and fix any problems which you may encounter!
This post is originally from DFRobot Community User pATAq's forum post, and serves only as an English translation of what he wrote. When reposting or referencing, please give credit to the original author~
Preface
For original articles and reprinted references, please be sure to indicate the link....
Sometimes, when I buy something I like, I especially look forward to an early arrival, so I take a moment to open a mobile client to refresh and check the express delivery information. After a long enough time, though, I felt like I was wasting my time, so I wanted to use the computer to help me check for updates.
Software and Hardware Environment
LattePanda, Python3.8, Arduino 18.12, Lubuntu 20.04
This project is divided into three parts:
1. Preparation
Linux operating systems' customizability is greater, and offers a greater feeling of familiarity to people who use it for developing purposes.
Ubuntu of Mint: which one to choose?
The latest version of Mint is based on Ubuntu 18.04, which passes the test of meeting most people's standards. And yet, I don't like Ubuntu's Unity desktop, and the performance of the LattePanda is overburdened when using it, so we chose to use the relatively lightweight LXQt desktop's (previously LXDE, now rewritten as Qt) Lubuntu. This operating system is based on openbox, and we can see the legacy. Those who are interested can also check out some introductions from the developer of LXQt, Dr. Hong Renyu: particularly parts one and two.
When surfing the internet, we can discover the following information about running Linux on the LattePanda:
- Linux Ubuntu 16.04 LTS
- OpenSUSE Leap 15.0, an instructional guide by J.S. Evans
- lattepanda-mainline-4.11
- The official document says "Official Supported Version: S70CR200 Version," but actually my S70CR110 can also use this version
- Mop talks about changing the settings in the South Bridge in BIOS, but there's no real need to change it in the new version of ubuntu
1.2 The Problems We Are Facing
- rtl8723bs wifi & bluetooth driver
- HDMI audio output issue
- Goodix touch panel dirver
- PWM? (At this moment, I still don't know what problems it has)
Why does the LattePanda have the aforementioned problems that need to be solved? It is mainly related to the Intel Atom x5 z8350 CPU orocessor used by fatty. The specifications of this processor are as follows:
- Wireless and Bluetooth functions: used the RTL8723BS module, SDIO interface, 2.4GHz 802.11bgn, bt4.0, RealTek official website only provides Windows drivers
- Touch screen: used a Goodix gt911 solution
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post1.png)
Caution:
- The Intel Celeron N4100 used by the LattePanda Delta also does not support the avx instruction set, so if you want to run the new version of Tensorflow, you need to compile it yourself. Refer to "Tensorflow-Intel-Atom-CPU"
Reference Links:
- intel-atom-iso | *Important
- Fix-Intel-Z8350-for-ubuntu-kubuntu
- miix310 | *Important
- tuxblet
- lubuntu_in_chuwi_Hi10Pro
- linux-on-hi10
Between the lines, we found two things of import: Ian Morrison's isorespin.sh and kernel_gcc_patch
1.4.1 isorespin.sh
The project's main page and the project's introduction
In short, devices using Intel Bay Trail and Cherry Trail processors will encounter some compatibility problems when installing Linux on devices, especially when using the HDMI output, system suspension and wireless drivers. Linux 4.11 solves the problem of HDMI audio output and system suspension, and Linux 4.12 solves the problem with the wireless driver. Additionally, Ian Morrison (Linuxium) went a step further and developed the isorespin.sh tool, which can make a new version of an Ubuntu ISO installation disc image file with the Linux Mainline kernel suitable for the above CPU. In addition, Ian is also one of the authors of the cnx-software website. --Source
We used this guide to customize the Linux system, and the author has some of the latest system disc image files ready for download. Currently there is support for custom versions of 64bit Ubuntu, Ubuntu Flavoured, LinuxMint, etc.
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post2.png)
Concerning the HWE kernel, please refer to "Installing HWE for Ubuntu LTS to get updated kernel and graphics support"
After encountering this treasure, it seems that our problems can be solved in one package. Can we really sit back and relax? Download Lunbutu 20.04 LTS Atom here
1.4.2 kernel_gcc_patch
Project Main Page | Kernel patch enables gcc optimizations for additional CPUs.
Due to the relatively low performance of the Atom x5-8350 and Celeron N4100, the operating system will use the generic kernel by default, focusing on compatibility and universality. That is, most of the hardware can be run after installation. So, we can recompile the kernel in a targeted manner in order to obtain higher performance. In addition, this project also supports Celeron N4100 (Intel Goldmont Plus family of low-power Atom processors-Gemini Lake).
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post3.png)
2.1 Install Lubuntu Customized for Cherry Trail CPU
Customize Installation Media USB
I connected the monitor via HDMI instead of the MIPI interface display (hereinafter referred to as "IGD", built-In Graphics Display), which only led to wallpapers on the monitor without icons and taskbars, because, as it turns out, the main output went to the unconnected IGD. It really was just. . . blindly turning on the terminal, then entering sudo poweroff to turn off the machine first, and then plugging in the display and touch panel, and then finding out that the touch panel does not respond.
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post4.png)
Okay, we need to test ways to solve the problems mentioned above and solve the problems with the HDMI output and touch panel. First plug in the dedicated IPS screen, set the HDMI as the main output, and then install OpenSSH. We'll connect to the LP through the MobaXterm program. For more details, please refer to my article "Forget VNC/RDP--Pick up MobaXterm and easily use its remote desktop!".
- The Openbox desktop is one choice for the graphical interface, but please note that MobaXterm currently does not support the default LXQt, and only LXDE is supported.
- The Interactive shell is the traditional choice for the terminal interface.
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post5.png)
Code: Select all
sudo apt install openssh-server tmux
What we download is the disc image file made by the author for the atom processor, and made in accordance with the introduction of isorespin.sh instructions:
That is, the wireless Bluetooth firmware of rtl8723bs is installed. Note that some of these are systems equipped with drivers but without the correct firmware, which cannot be used properly. I added a UCM file for audio output.
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post6.png)
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post7.png)
Connect to wireless network CLI
After some understanding, I found that the networkmanager is used, which is easy to use graphically. The CLI is nmcli:
The above command is enough. Make sure to change the wireless network name SSID and password in the above command to your computer's SSID and password, respectively. For more details, please refer to the nm operation guide.
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post8.png)
Other related commands:
Code: Select all
dmesg | grep XXX
lsmod | grep XXX
lshw
lsusb
lspci
This was a headache to set up. I first used a dedicated screen to connect to the wireless network and install the ssh server, and then temporarily use it from SSH. Although it can be used normally after entering the desktop and manually changing the primary/secondary output, it then returns to the same situation after restarting, so I simply turned off the IGD output.
Check out How to Disable Internal Display from BIOS? The means that the official site prescribed: BIOS->"Chipset"->"North Bridge"->"IGD-LCD Control"->"Force Lid Status"->"Off" did not work, so I finally had to resort to the last reference: K3dAR's reply to the solution: add kernel parameter: video=DSI-1:d
How did it do it? Check out the Kernel parameters page of archwiki:
Code: Select all
sudo nano /etc/default/grub
# Add video=DSI-1:d before "GRUB_CMDLINE_LINUX_DEFAULT"
# For example GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=cb38daad-4618-4b36-98de-1915abb168cf video=DSI-1:d"
# Regenerate the grub.cfg file
sudo grub-mkconfig -o /boot/grub/grub.cfg
# TODO: Use sed to make changes
2.2.3 Solve the touch panel drive problem
After the installation, the main functions worked as normal, but the touch screen was not working. I thought it was because I didn't plug it in. I tried it several times and it was always the same. I didn't see it when I used the xinput list command. Using dmesg | grep Goodix, I could see that a device was, in fact, recognized, but did not have the proper drivers; It is also loaded when using lsmod goodix into the system. It is suspected that the problem is an incorrect driver.
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post9.png)
Code: Select all
dmesg | grep goodix # The device can be identified, but an error is reported
lsmod # I don’t remember what the output is, you can take a look at it yourself
xinput list # Cannot recognize Goodix Capacitive TouchScreen
- Beta Ubuntu Image for LattePanda - Official version
- Goodix Touchscreen and Stylus share device
- Showing posts sorted by relevance for query goodix
Code: Select all
# Compile the driver
git clone https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver
cd goodix-touchscreen-linux-driver
make
# Test drive (delete the original driver and load the newly compiled driver), I am successful here
sudo su
rmmod goodix
insmod goodix.ko
# install driver
xz goodix.ko
mv goodix.ko.xz /lib/modules/$(uname -r)/kernel/drivers/input/touchscreen/goodix.ko.xz
Complete set of debug commands:
Code: Select all
$ dmesg | grep -i goodix
$ cat /proc/bus/input/devices | grep -B 1 -A 8 -i goodix
# libinput list-devices | grep -A 17 -i goodix
# libinput debug-events
$ xinput list
As mentioned earlier, recompiling the kernel for Atom X5 z8350 can improve performance a bit, so let’s do it now.
Code: Select all
sjqlwy@LattePanda:~$ uname -a
Linux LattePanda 5.6.8 #1 SMP Sat May 2 23:36:54 CST 2020 x86_64 x86_64 x86_64 GNU/Linux
sjqlwy@LattePanda:~$ cat /proc/version
Linux version 5.6.8 (sjqlwy@LattePanda) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)) #1 SMP Sat May 2 23:36:54 CST 2020
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post10.png)
2.3.1 Download the source code and apply the patch
Open the Linux Kernel website and you can see that the latest Stable version is 5.6.x. *Download it for later use.* It is recommended to read Linux Kernels Versions' Introduction and Queries. The kernel that comes with Ubuntu emphasizes versatility, so we will use the patch to recompile the kernel for z8350 in order to get better performance. Fortunately, someone has already done it and performed daily maintenance on it, *and can be found here*: kernel_gcc_patch.
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post11.png)
- Cherry Trail, Apollo Lake, Gemini Lake, etc. are Code Name development codes
- Silvermont, Goldmont, Airmont, etc. are CPU microarchitectures
- There are sub-sets under these micro-architectures, for example, Airmont is a subset of Silvermont, and Goldmont Plus is a subset
- Goldmont Plus--Gemini Lake--Celeron N4100 (Mobile processors)
- Airmont——Cherry Trail——Atom X5 z8350(consumer SoCs aimed at tablets)
- Airmont is the 14 nm die shrink of Silvermont(22 nm)
- Here we download enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v5.5+.patch (5.6) and put it in the folder where the Linux source code is located.
- This patch works with gcc versions 9.1+ and with kernel version 5.5+ and should
NOT be applied when compiling on older versions of gcc due to key name changes
of the march flags introduced with the version 4.9 release of gcc - If you use Ubuntu 20.04, the gcc version and kernel version of the compilation environment are both satisfied, otherwise you need to enter the settings
- patch -p1 <PATCH_NAME.patch will report an error
Code: Select all
sudo apt-get install gcc make libncurses5-dev libssl-dev bison flex libelf-dev
patch -Np1 -i /path/to/patch
make menuconfig
![Image](https://www.lattepanda.com/wp-content/uploads/2020/08/post12.png)
Code: Select all
make -j4 bindeb-pkg # Compile the kernel, it takes about 20m-2h depending on the machine performance
sudo dpkg -i linux*.deb # Install the compiled kernel, and the grub will be set automatically
References:
As mentioned above, gcc 9.1 or above is required to use this patch, but I can see that gcc 7.5 is installed by default on my other machines (Ubuntu 18.04 LTS), which will cause the installation to fail.
Code: Select all
ubuntu@VM-126-41-ubuntu:~$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Code: Select all
root@build-server:~# gcc --version
gcc (Ubuntu 9.3.0-11ubuntu0~18.04.1) 9.3.0
# Ubuntu 20.04 does not have this problem
sjqlwy@LattePanda:~$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
It will remind you to install the generic kernel when we run apt upgrade. We use the apt-mark command to prevent this behavior from occurring.
Code: Select all
apt list --installed
dpkg-query -l # The output is clearer
apt-mark hold <pkg> # Change <pkg> to all kernel-related packages suggested in apt upgrade
apt-mark unhold <pkg>
apt-mark showhold
Refer to the DIY NAS Project (2) Docker and ownCloud, as well as the settings of Miix 310 above to configure the kernel compilation parameters
- Refer to Compiling your own kernel using isorespin.sh, where you can use Ubuntu's kernel source code and patches and have them integrated into our performance patches
- Change the default IO scheduling, increase file system support, and improve emmc performance and lifespan
In the end, we installed Lunbutu 20.04 perfectly on the LattePanda, which solved the problems of the BT/Wifi/Audio Output/Touch Panel and IGD, and used the optimized kernel to improve the performance of the LP. If you have time, you can customize the ISO disc image file to be suitable for the LP, including:
- Turning off the defauult built-in output, and utilizing the HDMI output signal instead
- Give Docker support to and get better performance out of our optimized kernel
- Make a pre-installed touch screen driver
- Change io scheduling and add more file system support
- Pre-install the SSH Server
- Usage of the English dash, and Usage of the English comma *Chinese
- RTL8723BS Wifi and BT firmware package for Ubuntu mainline v4.12 kernels | sudo systemctl start rtl8723bsbt.service
- New features in isorespin.sh
- --debug | show more information
- --interactive | Enter root shell, customize changes. For example, modify the mirrorlist
- --dist-upgrade | More thorough upgrade, can be used with --debug
- Why choose a low latency kernel over a generic or realtime one?
- If you do not require low latency for your system then please use the -generic kernel.
- If you need a low latency system (e.g. for recording audio) then please use the -preempt kernel as a first choice. This reduces latency but doesn't sacrifice power saving features. It is available only for 64 bit systems (also called amd64).
- If the -preempt kernel does not provide enough low latency for your needs (or you have an 32 bit system) then you should try the -lowlatency kernel.
- If the -lowlatency kernel isn't enough then you should try the -rt kernel
- If the -rt kernel isn't enough stable for you then you should try the -realtime kernel
- -generic——>preempt——>lowlatency——>rt——>realtime, [the fewer the delays, the higher the power consumption]
- Introducing 'isorespin.sh' templates | Important
- Resize EFI partition
- Latest improvements to isorespin.sh | rclone copy GDrive:rclone/ ~/downloads
- Fixing broken HDMI audio (again)
- Fixing broken HDMI audio
- Respinning ISOs with rEFInd
- ISO respin script now handles SourceForge outages
- Adding and deleting kernel boot parameters with isorespin.sh | Important
- Compiling your own kernel using isorespin.sh | Important