Difference between revisions of "Ubuntu 18.04"

From UpWiki
Jump to: navigation, search
(Install Ubuntu kernel 5.0.0 for UP Xtreme only from PPA on Ubuntu 18.04)
(Installation)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Ubuntu 18.04 installation and configuration =
 
  
 
== Install Ubuntu for UP, UP Squared, UP Core, UP Core Plus and UP Xtreme  ==
 
== Install Ubuntu for UP, UP Squared, UP Core, UP Core Plus and UP Xtreme  ==
Line 13: Line 11:
 
http://releases.ubuntu.com/18.04/ubuntu-18.04.4-desktop-amd64.iso
 
http://releases.ubuntu.com/18.04/ubuntu-18.04.4-desktop-amd64.iso
  
http://releases.ubuntu.com/18.04/ubuntu-18.04.4-live-server-amd64.iso
+
http://cdimage.ubuntu.com/releases/18.04.4/release/ubuntu-18.04.4-server-amd64.iso
  
 
* Burn the downloaded image on a USB stick. We suggest to use etcher for doing that. You can download it from
 
* Burn the downloaded image on a USB stick. We suggest to use etcher for doing that. You can download it from
Line 21: Line 19:
 
** While installing, do not select the option "automatic updates"
 
** While installing, do not select the option "automatic updates"
  
== (Legacy) Install Ubuntu kernel 4.15.0 for UP from PPA on Ubuntu 18.04 (Not UP Xtreme) ==
+
== Install Ubuntu kernel 5.0.0 from PPA on Ubuntu 18.04 ==
This is a legacy kernel to enable support for UP, UP Squared, UP Core and UP Core plus. For the latest kernel available which supports all UP Series, including UP Xtreme please refer to the steps to [https://wiki.up-community.org/Ubuntu#Install_Ubuntu_kernel_5.0.0_for_UP_Xtreme_only_from_PPA_on_Ubuntu_18.04 install the Kernel 5.0].  
+
This is the latest Kernel available for the UP Series. It has been validated on UP Board, UP Core, UP Squared, UP Core Plus and UP Xtreme.
 +
It is the only Kernel for Ubuntu with support for UP Xtreme, it includes additional changes required by the Whiskey Lake-U SoC.
  
 
After the reboot you need to add our repository:
 
After the reboot you need to add our repository:
  sudo add-apt-repository ppa:aaeon-cm/up
+
  sudo add-apt-repository ppa:aaeon-cm/upboard
  
 
Update the repository list
 
Update the repository list
Line 34: Line 33:
  
 
Install our kernel:
 
Install our kernel:
  sudo apt-get install linux-image-generic-hwe-18.04-upboard
+
  sudo apt-get install linux-generic-hwe-18.04-edge-upboard
  
 
Install the updates:
 
Install the updates:
Line 45: Line 44:
 
After the reboot you can verify that the kernel is indeed installed by typing
 
After the reboot you can verify that the kernel is indeed installed by typing
 
  $ uname -a
 
  $ uname -a
  Linux upsquared-UP-APL01 4.15.0-37-generic #40~upboard04-Ubuntu SMP Thu Feb 14 13:49:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
+
  Linux upxtreme-UP-WHL01 5.0.0-1-generic #2~upboard5-Ubuntu SMP Thu Jul 25 13:35:27 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
 +
 
 +
== Install Ubuntu kernel 5.0.0 locally from debian packages on Ubuntu 18.04 ==
 +
Download the next debian packages from our Launchpad site listing the archives inside '''linux-hwe-edge - 5.0.0-1.2~upboard5''':
 +
 
 +
https://launchpad.net/~aaeon-cm/+archive/ubuntu/upboard/+packages
 +
 
 +
linux-headers-5.0.0-1_5.0.0-1.2~upboard5_all.deb
 +
linux-headers-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb
 +
linux-image-unsigned-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb
 +
linux-modules-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb
 +
linux-modules-extra-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb
 +
linux-source-5.0.0_5.0.0-1.2~upboard5_all.deb
 +
 
 +
Then, copy all the .deb files to your USB stick and connect to the USB port in your board.
 +
 
 +
To install the kernel locally you have to go to the directory where you saved the debian packages. There, just run the dpkg command to install all packages together:
 +
sudo dpkg -i *.deb
 +
 
 +
Once the installation is done successfully, be sure the GRUB is updated to include the newst kernel:
 +
sudo update-grub
 +
 
 +
Finally, reboot your machine and check your new kernel installed:
 +
sudo reboot
 +
 
 +
uname -a
 +
Linux upxtreme-UP-WHL01 5.0.0-1-generic #2~upboard5-Ubuntu SMP Thu Jul 25 13:35:27 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
 +
 
  
== Install Ubuntu kernel 5.0.0 for UP Xtreme only from PPA on Ubuntu 18.04 ==
+
== (Legacy) Install Ubuntu kernel 4.15.0 for UP from PPA on Ubuntu 18.04 (Not UP Xtreme) ==
To enable support for UP Xtreme, the Kernel 5.0 has been released which includes additional changes required by the Whiskey Lake-U SoC.
+
This is a legacy kernel to enable support for UP, UP Squared, UP Core and UP Core plus. For the latest kernel available which supports all UP Series, including UP Xtreme please refer to the steps to [https://wiki.up-community.org/Ubuntu_18.04#Install_Ubuntu_kernel_5.0.0_from_PPA_on_Ubuntu_18.04 install the Kernel 5.0].  
  
 
After the reboot you need to add our repository:
 
After the reboot you need to add our repository:
  sudo add-apt-repository ppa:aaeon-cm/upboard
+
  sudo add-apt-repository ppa:aaeon-cm/up
  
 
Update the repository list
 
Update the repository list
Line 60: Line 86:
  
 
Install our kernel:
 
Install our kernel:
  sudo apt-get install linux-generic-hwe-18.04-edge-upboard
+
  sudo apt-get install linux-image-generic-hwe-18.04-upboard
  
 
Install the updates:
 
Install the updates:
Line 71: Line 97:
 
After the reboot you can verify that the kernel is indeed installed by typing
 
After the reboot you can verify that the kernel is indeed installed by typing
 
  $ uname -a
 
  $ uname -a
  Linux upxtreme-UP-WHL01 5.0.0-1-generic #2~upboard4-Ubuntu SMP Thu Jul 25 13:35:27 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
+
  Linux upsquared-UP-APL01 4.15.0-37-generic #40~upboard07-Ubuntu SMP Thu Feb 14 13:49:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  
== Install Ubuntu kernel 4.15.0 for UP locally from debian packages on Ubuntu 18.04 (Not UP Xtreme) ==
+
== (Legacy) Install Ubuntu kernel 4.15.0 for UP locally from debian packages on Ubuntu 18.04 (Not UP Xtreme) ==
The following steps are valid for UP, UP Squared, UP Core and UP Core Plus. For UP Xtreme please refer to the [https://wiki.up-community.org/Ubuntu#Install_Ubuntu_kernel_5.0.0_for_UP_Xtreme_locally_from_debian_packages_on_Ubuntu_18.04 next section].
+
The following steps are to install the Legacy 4.15 kernel valid for UP, UP Squared, UP Core and UP Core Plus. For the latest kernel valid for all UP Series, including UP Xtreme, please refer to the [https://wiki.up-community.org/Ubuntu_18.04#Install_Ubuntu_kernel_5.0.0_locally_from_debian_packages_on_Ubuntu_18.04].
  
 
Download the next debian packages from our Launchpad site listing the archives inside '''linux-hwe - 4.15.0-37.40~upboard04''':  
 
Download the next debian packages from our Launchpad site listing the archives inside '''linux-hwe - 4.15.0-37.40~upboard04''':  
  
https://launchpad.net/~ubilinux/+archive/ubuntu/up/+packages
+
https://launchpad.net/~aaeon-cm/+archive/ubuntu/up/+packages
  
  linux-headers-4.15.0-37_4.15.0-37.40_upboard04_all.deb
+
  linux-headers-4.15.0-37_4.15.0-37.40_upboard07_all.deb
  linux-headers-4.15.0-37-generic_4.15.0-37.40_upboard04_amd64.deb
+
  linux-headers-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
  linux-image-unsigned-4.15.0-37-generic_4.15.0-37.40_upboard04_amd64.deb
+
  linux-image-unsigned-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
  linux-modules-4.15.0-37-generic_4.15.0-37.40_upboard04_amd64.deb
+
  linux-modules-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
  linux-modules-extra-4.15.0-37-generic_4.15.0-37.40_upboard04_amd64.deb
+
  linux-modules-extra-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
  linux-source-4.15.0_4.15.0-37.40_upboard04_all.deb
+
  linux-source-4.15.0_4.15.0-37.40_upboard07_all.deb
  
 
Then, copy all the .deb files to your USB stick and connect to the USB port in your board.
 
Then, copy all the .deb files to your USB stick and connect to the USB port in your board.
Line 99: Line 125:
  
 
  uname -a
 
  uname -a
  Linux upsquared-UP-APL01 4.15.0-37-generic #40~upboard04-Ubuntu SMP Thu Feb 14 13:49:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
+
  Linux upsquared-UP-APL01 4.15.0-37-generic #40~upboard07-Ubuntu SMP Thu Feb 14 13:49:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
 
 
== Install Ubuntu kernel 5.0.0 for UP Xtreme locally from debian packages on Ubuntu 18.04 ==
 
The following steps are valid only for UP Xtreme.
 
 
 
Download the next debian packages from our Launchpad site listing the archives inside '''linux-hwe-edge - 5.0.0-1.2~upboard4''':
 
 
 
https://launchpad.net/~aaeonaeu/+archive/ubuntu/upboard/+packages
 
 
 
linux-headers-5.0.0-1_5.0.0-1.2~upboard4_all.deb
 
linux-headers-5.0.0-1-generic_5.0.0-1.2~upboard4_amd64.deb
 
linux-image-unsigned-5.0.0-1-generic_5.0.0-1.2~upboard4_amd64.deb
 
linux-modules-5.0.0-1-generic_5.0.0-1.2~upboard4_amd64.deb
 
linux-modules-extra-5.0.0-1-generic_5.0.0-1.2~upboard4_amd64.deb
 
linux-source-5.0.0_5.0.0-1.2~upboard4_all.deb
 
  
Then, copy all the .deb files to your USB stick and connect to the USB port in your board.
+
= Configure WiFi/BT for UP Core and UP Core Plus =
 
 
To install the kernel locally you have to go to the directory where you saved the debian packages. There, just run the dpkg command to install all packages together:
 
sudo dpkg -i *.deb
 
 
 
Once the installation is done successfully, be sure the GRUB is updated to include the newst kernel:
 
sudo update-grub
 
 
 
Finally, reboot your machine and check your new kernel installed:
 
sudo reboot
 
 
 
uname -a
 
Linux upxtreme-UP-WHL01 5.0.0-1-generic #2~upboard4-Ubuntu SMP Thu Jul 25 13:35:27 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
 
  
 
== Install the Ampak firmware for WiFi and Bluetooth from PPA on Ubuntu 18.04 ==
 
== Install the Ampak firmware for WiFi and Bluetooth from PPA on Ubuntu 18.04 ==
Line 154: Line 154:
 
Download the next debian package from our Launchpad site listing the archives inside '''firmware-ampak - 1.2.1-0''':  
 
Download the next debian package from our Launchpad site listing the archives inside '''firmware-ampak - 1.2.1-0''':  
  
https://launchpad.net/~ubilinux/+archive/ubuntu/up/+packages
+
https://launchpad.net/~aaeon-cm/+archive/ubuntu/upboard/+packages
  
 
  firmware-ampak_1.2.1-0_all.deb
 
  firmware-ampak_1.2.1-0_all.deb
Line 177: Line 177:
 
  hcitool scan
 
  hcitool scan
  
 +
= Setup for other WiFi/BT modules tested on UP Series =
 
== Install the Realtek firmware to enable WiFi with the 5M02.B module on Ubuntu 18.04 ==
 
== Install the Realtek firmware to enable WiFi with the 5M02.B module on Ubuntu 18.04 ==
  
 
To enable support on Ubuntu for WiFi when using our [https://up-shop.org/up-peripherals/90-wifi-kit-for-up.html UP WiFi Kit 5M02.B module], please follow the steps available on the readme of our github repository:
 
To enable support on Ubuntu for WiFi when using our [https://up-shop.org/up-peripherals/90-wifi-kit-for-up.html UP WiFi Kit 5M02.B module], please follow the steps available on the readme of our github repository:
 
[https://github.com/AAEONAEU-SW/rtl8812AU_8821AU_linux | Add WiFi/BT support for 5M02.B]
 
[https://github.com/AAEONAEU-SW/rtl8812AU_8821AU_linux | Add WiFi/BT support for 5M02.B]
 +
 +
= Additional Audio configuration =
  
 
== Fixing HDMI Audio not working on UP Board and UP Core on Ubuntu 18.04 ==
 
== Fixing HDMI Audio not working on UP Board and UP Core on Ubuntu 18.04 ==
Line 194: Line 197:
 
Once the system is rebooted the HDMI audio will work automatically.
 
Once the system is rebooted the HDMI audio will work automatically.
  
== Enable the HAT functionality from userspace ==
+
= Enable the HAT functionality from userspace =
 
To be able to use the GPIO, PWM, SPI, I2C and uart functionality with a normal user we created a ubuntu package that set the correct permission.
 
To be able to use the GPIO, PWM, SPI, I2C and uart functionality with a normal user we created a ubuntu package that set the correct permission.
  
 
NOTE: this could create security problem, do only if you know what are you doing
 
NOTE: this could create security problem, do only if you know what are you doing
  
'''(Only for UP series with Kernel 4.15, no UP Xtreme)''' After adding our PPA you can install it with:
+
== Install upboard-extras ==
 +
Run the following command to install the upboard-extras package:
  
 
  sudo apt install upboard-extras
 
  sudo apt install upboard-extras
  
'''(For UP series including UP Xtreme with kernel 5.0 or newer)''' Alternatively you can create a bash script (e.g. permissiongroups.sh) script with the following content:
+
The command will add rules.d file as follows. The step is necessary.
 +
/lib/udev/rules.d/99-gpio.rules
 +
/lib/udev/rules.d/99-i2c.rules
 +
/lib/udev/rules.d/99-leds.rules
 +
/lib/udev/rules.d/99-spi.rules
 +
/lib/udev/rules.d/99-ttyAMA0.rules
 +
 
 +
== Add Groups ==
 +
You can create a bash script (e.g. permissiongroups.sh) script with the following content:
  
 
  #!/bin/sh
 
  #!/bin/sh

Latest revision as of 14:35, 26 June 2020

Install Ubuntu for UP, UP Squared, UP Core, UP Core Plus and UP Xtreme

Prerequisites

  • an UP, UP Squared, UP Core, UP Core Plus or UP Xtreme board
  • an USB stick with at least 8Gb of space
  • keyboard, mouse, a screen and an internet connection

Installation

  • Download Ubuntu 18.04.3 ISO from the Ubuntu download page (works with desktop and server edition)

http://releases.ubuntu.com/18.04/ubuntu-18.04.4-desktop-amd64.iso

http://cdimage.ubuntu.com/releases/18.04.4/release/ubuntu-18.04.4-server-amd64.iso

  • Burn the downloaded image on a USB stick. We suggest to use etcher for doing that. You can download it from
https://etcher.io
  • Insert the USB installer disk in a empty USB port and proceed with a normal Ubuntu installation.
    • While installing, do not select the option "automatic updates"

Install Ubuntu kernel 5.0.0 from PPA on Ubuntu 18.04

This is the latest Kernel available for the UP Series. It has been validated on UP Board, UP Core, UP Squared, UP Core Plus and UP Xtreme. It is the only Kernel for Ubuntu with support for UP Xtreme, it includes additional changes required by the Whiskey Lake-U SoC.

After the reboot you need to add our repository:

sudo add-apt-repository ppa:aaeon-cm/upboard

Update the repository list

sudo apt update

Remove all the generic installed kernel

sudo apt-get autoremove --purge 'linux-.*generic'

Install our kernel:

sudo apt-get install linux-generic-hwe-18.04-edge-upboard

Install the updates:

sudo apt dist-upgrade -y
sudo reboot

Reboot

sudo reboot

After the reboot you can verify that the kernel is indeed installed by typing

$ uname -a
Linux upxtreme-UP-WHL01 5.0.0-1-generic #2~upboard5-Ubuntu SMP Thu Jul 25 13:35:27 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Install Ubuntu kernel 5.0.0 locally from debian packages on Ubuntu 18.04

Download the next debian packages from our Launchpad site listing the archives inside linux-hwe-edge - 5.0.0-1.2~upboard5:

https://launchpad.net/~aaeon-cm/+archive/ubuntu/upboard/+packages

linux-headers-5.0.0-1_5.0.0-1.2~upboard5_all.deb 
linux-headers-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb
linux-image-unsigned-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb 
linux-modules-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb
linux-modules-extra-5.0.0-1-generic_5.0.0-1.2~upboard5_amd64.deb
linux-source-5.0.0_5.0.0-1.2~upboard5_all.deb

Then, copy all the .deb files to your USB stick and connect to the USB port in your board.

To install the kernel locally you have to go to the directory where you saved the debian packages. There, just run the dpkg command to install all packages together:

sudo dpkg -i *.deb

Once the installation is done successfully, be sure the GRUB is updated to include the newst kernel:

sudo update-grub

Finally, reboot your machine and check your new kernel installed:

sudo reboot
uname -a
Linux upxtreme-UP-WHL01 5.0.0-1-generic #2~upboard5-Ubuntu SMP Thu Jul 25 13:35:27 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


(Legacy) Install Ubuntu kernel 4.15.0 for UP from PPA on Ubuntu 18.04 (Not UP Xtreme)

This is a legacy kernel to enable support for UP, UP Squared, UP Core and UP Core plus. For the latest kernel available which supports all UP Series, including UP Xtreme please refer to the steps to install the Kernel 5.0.

After the reboot you need to add our repository:

sudo add-apt-repository ppa:aaeon-cm/up

Update the repository list

sudo apt update

Remove all the generic installed kernel

sudo apt-get autoremove --purge 'linux-.*generic'

Install our kernel:

sudo apt-get install linux-image-generic-hwe-18.04-upboard

Install the updates:

sudo apt dist-upgrade -y
sudo reboot

Reboot

sudo reboot

After the reboot you can verify that the kernel is indeed installed by typing

$ uname -a
Linux upsquared-UP-APL01 4.15.0-37-generic #40~upboard07-Ubuntu SMP Thu Feb 14 13:49:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

(Legacy) Install Ubuntu kernel 4.15.0 for UP locally from debian packages on Ubuntu 18.04 (Not UP Xtreme)

The following steps are to install the Legacy 4.15 kernel valid for UP, UP Squared, UP Core and UP Core Plus. For the latest kernel valid for all UP Series, including UP Xtreme, please refer to the [1].

Download the next debian packages from our Launchpad site listing the archives inside linux-hwe - 4.15.0-37.40~upboard04:

https://launchpad.net/~aaeon-cm/+archive/ubuntu/up/+packages

linux-headers-4.15.0-37_4.15.0-37.40_upboard07_all.deb
linux-headers-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
linux-image-unsigned-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
linux-modules-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
linux-modules-extra-4.15.0-37-generic_4.15.0-37.40_upboard07_amd64.deb
linux-source-4.15.0_4.15.0-37.40_upboard07_all.deb

Then, copy all the .deb files to your USB stick and connect to the USB port in your board.

To install the kernel locally you have to go to the directory where you saved the debian packages. There, just run the dpkg command to install all packages together:

sudo dpkg -i *.deb

Once the installation is done successfully, be sure the GRUB is updated to include the newst kernel:

sudo update-grub

Finally, reboot your machine and check your new kernel installed:

sudo reboot
uname -a
Linux upsquared-UP-APL01 4.15.0-37-generic #40~upboard07-Ubuntu SMP Thu Feb 14 13:49:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Configure WiFi/BT for UP Core and UP Core Plus

Install the Ampak firmware for WiFi and Bluetooth from PPA on Ubuntu 18.04

This firmware is available for UP Core (AP6214A chipset) and UP Core Plus (AP6355 chipset).

Just run the next command:

sudo apt install firmware-ampak

Reboot your machine to get the firmware working:

sudo reboot

WiFi

Scan your available WiFi networks:

sudo iwlist wlan0 scan

You will see all the WiFi interfaces in your area.

Bluetooth

Check your Bluetooth devices in your area:

hcitool scan

Install the Ampak firmware for WiFi and Bluetooth locally from debian package on Ubuntu 18.04

Download the next debian package from our Launchpad site listing the archives inside firmware-ampak - 1.2.1-0:

https://launchpad.net/~aaeon-cm/+archive/ubuntu/upboard/+packages

firmware-ampak_1.2.1-0_all.deb

Then, copy the .deb file to your USB stick and connect to the USB port in your board.

To install the Ampak firmware locally you have to go to the directory where you saved the debian package. There, just run the dpkg command to install the package:

sudo dpkg -i *.deb

Reboot your machine to get the firmware working:

sudo reboot

WiFi

Scan your available WiFi networks:

sudo iwlist wlan0 scan

You will see all the WiFi interfaces in your area.

Bluetooth

Check your Bluetooth devices in your area:

hcitool scan

Setup for other WiFi/BT modules tested on UP Series

Install the Realtek firmware to enable WiFi with the 5M02.B module on Ubuntu 18.04

To enable support on Ubuntu for WiFi when using our UP WiFi Kit 5M02.B module, please follow the steps available on the readme of our github repository: | Add WiFi/BT support for 5M02.B

Additional Audio configuration

Fixing HDMI Audio not working on UP Board and UP Core on Ubuntu 18.04

On Recent Ubuntu images the HDMI Audio configuration is broken. Once the installation of Ubuntu is complete from the terminal you can run this command to fix it:

sudo sed -i '/module-detect/ {n;a\
 ## fix HDMI audio on Intel Cherry Trail platforms with latest Ubuntu releases\
 unload-module module-alsa-card\
 load-module module-alsa-sink device=hw:0,2
 }' /etc/pulse/default.pa

Once the system is rebooted the HDMI audio will work automatically.

Enable the HAT functionality from userspace

To be able to use the GPIO, PWM, SPI, I2C and uart functionality with a normal user we created a ubuntu package that set the correct permission.

NOTE: this could create security problem, do only if you know what are you doing

Install upboard-extras

Run the following command to install the upboard-extras package:

sudo apt install upboard-extras

The command will add rules.d file as follows. The step is necessary. /lib/udev/rules.d/99-gpio.rules /lib/udev/rules.d/99-i2c.rules /lib/udev/rules.d/99-leds.rules /lib/udev/rules.d/99-spi.rules /lib/udev/rules.d/99-ttyAMA0.rules

Add Groups

You can create a bash script (e.g. permissiongroups.sh) script with the following content:

#!/bin/sh
set -e

for group in gpio leds spi i2c; do
	if ! getent group $group >/dev/null; then
		addgroup --system $group
	fi
done

Then add execution permissions ($ chmod +x permissiongroups.sh) and run it ($ ./permissiongroups.sh)


after that you need to add the user that need to access the HAT functionality to the corresponding groups:

for example this command permit to the current user to access to the gpio functionality

sudo usermod -a -G gpio ${USER}

leds

sudo usermod -a -G leds ${USER}

spi

sudo usermod -a -G spi ${USER}

i2c

sudo usermod -a -G i2c ${USER}

uart

sudo usermod -a -G dialout ${USER}

to apply the permission changes after issuing the previous command a reboot is needed

sudo reboot