Manjaro Linux, Bash and Touchscreen on a Raspberry PI 4 Model B
Total Page:16
File Type:pdf, Size:1020Kb
Manjaro Linux, Bash and Touchscreen on a Raspberry PI 4 Model B A HowTo and helper for Manjaro ARM with RPI4 And a lot of generic stuff on BASH, Linux, etc. By Atanas Rusev, March 2020 www.atanasrusev.com Read time: 30+ minutes – check the Table of Contents for overview. INTRODUCTION: I decided to work with a Raspberry Pi 4 (RPI4), with attached 7 inch touch screen (sold by Kuman, HDMI based). I wanted a scalable OS, which will provide me the biggest support of SW and libraries - and this can be only Linux. I wanted to be able to custom trim it up to level where I really have only and exactly what I need - so this would be Yocto based builds. So - as I person who have used Ubuntu, Fedora, Linux Mint and Arch Linux - I had to look for better, purer and trimmable Linux. Some details related to this research are in this article. To keep the long story short - I chose Arch Linux. Arch is one of the distros known for keeping most up-to-date kernel, to be rolling release based; most limited in extra features; has a great community; and is around since 2002. I wanted to use on the test PC the same Linux Distro I can use on the RPI4 - so that I can easily transfer developed modules. And later jump on Yocto to make my custom trims. And Arch Linux turned out to be hard lately - I had multiple issues when I installed the latest version on my test PC (despite that the previous time I worked with it I seldom had blockers). Hence I searched for the best user friendly (and with XFCE) Arch based distro. Manjaro was the best option I got. Plus - there were some ports for RPI4 already. It turned out the community is strong, and it is the most prominent Arch based distro around. In addition - after testing it – it was simple, stable, and good! Here are some whys. By the way - one of the greatest tools on the web to help you see ALL major and minor Linux distros, where they come from, when were they started is here on Wikipedia. This journal is a full summary of my milestones, issues, findings, recommendations, and HowTos. I hope that those will be helpful to others. I’ve cut the trash, and left here only the final, proved and corrected information. I also put some significant effort to provide a lot of links directly in the text for your convenience. If you have questions or spot an error – write me, I will be really grateful. But before this – google it, and try all the things by yourself. Self- experience and reading is the best teacher after all. Author: Atanas Rusev Revision 1.1, April 2020 License: GPL Website: www.atanasrusev.com Page 1 Contents 1. Basics – HW, Manjaro installation, few basic commands, package manager, installation of user SW .............. 4 1.1. HW overview and the heating issue with RPI4....................................................................................... 4 1.2. Installation........................................................................................................................................... 7 1.3. Basic Tools for SW Development .......................................................................................................... 8 1.4. Installing SW on Manjro / Arch Linux .................................................................................................... 8 2. BASH Shell (Terminal) Generic Commands - explanation, list of some basic commands, examples and hints, and finally basic C/C++ project compilation ........................................................................................................11 2.1. The basic Terminal commands with explanations and examples ...........................................................11 2.1.1. BASH basics ............................................................................................................................................ 11 2.1.2. sudo ........................................................................................................................................................ 12 2.1.3. ls and files permissions, chmod, chown ................................................................................................ 12 2.1.4. cd ............................................................................................................................................................ 13 2.1.5. ln ............................................................................................................................................................. 13 2.1.6. unlink ...................................................................................................................................................... 13 2.1.7. rm............................................................................................................................................................ 14 2.1.8. cat ........................................................................................................................................................... 14 2.1.9. grep – one of the most famous commands around! ............................................................................ 15 2.1.10. ps ............................................................................................................................................................ 16 2.1.11. top........................................................................................................................................................... 17 2.1.12. man – the show manual command ....................................................................................................... 17 2.1.13. clear – simply clear the BASH Terminal ................................................................................................. 17 2.1.14. find .......................................................................................................................................................... 17 2.1.15. cp – the copy command ......................................................................................................................... 18 2.1.16. pwd ......................................................................................................................................................... 18 2.1.17. pidof........................................................................................................................................................ 18 2.1.18. kill and killall........................................................................................................................................... 19 2.1.19. curl .......................................................................................................................................................... 20 2.1.20. whatis ..................................................................................................................................................... 21 2.1.21. whereis ................................................................................................................................................... 21 2.2. Piping and redirection of commands in bash – crucial to understand how it shall be used and also one of the greatest powers of the shell. ....................................................................................................................21 2.2.1. Piping ...................................................................................................................................................... 22 2.2.2. Redirection ............................................................................................................................................. 22 2.2.3. Piping and Redirection together............................................................................................................ 23 Author: Atanas Rusev Revision 1.1, April 2020 License: GPL Website: www.atanasrusev.com Page 2 2.2.4. The other operators - < and >> .............................................................................................................. 23 2.3. Using Autocomplete in BASH, starting commands on the foreground and background, writing a simple script. 25 2.3.1. Autocomplete......................................................................................................................................... 25 2.3.2. Execute a program / application ........................................................................................................... 25 2.3.3. Writing a simple BASH script ................................................................................................................. 26 2.3.4. The echo command – important specially about scripts ...................................................................... 27 2.4. More on multiple commands in BASH shell ..........................................................................................27 2.5. How to compile a simple C/C++ project ................................................................................................28 3. Next Step: Dual Boot vs Virtual Machine, Yocto Poky vs Manjaro ARM ........................................................29 3.1. Dual Boot vs Virtual Machine ..............................................................................................................29 3.2. Poky vs Manjaro for Raspberry Pi 4 (RPI4) Model B (4GB RAM) ............................................................29 4. Raspberry Pi 4 Model B and Kuman 7 inch Touchscreen HDMI LCD – specs, Manjaro ARM installation and SD cards .................................................................................................................................................................30