What is Fedora IoT Fedora IoT is a Fedora Edition for Internet of Things. It is one of the current Fedora Project objectives. It can obviously run on ARM (at the moment only the aarch64 architecture) devices like the Raspberry Pi as well on x86_64 machines. It is a Fedora edition based on OSTree, like the former Fedora Atomic Host [link] and the former Fedora Atomic Workstation, now Fedora Silverblue [link]. From a user point of view, OSTree, among other things imply these advantages: Atomic updates: an update to the operating system is performed as a whole, and it is not performed package per package. In addition, if something goes wrong, like a power outage during the update process, the system will reboot with the previous installation in place, without any modification; or if the upgrade introduces some unwanted bug, you will be able to rollback to the previous working image. In the future we will see automatic updates and rollback. Immutable system: the base operating system is read only. This is a great advantage from a security point of view: it is not allowed to put or change the files under certain core directories, for instance a potential malware cannot replace an executable in /usr/bin directory Container oriented. Even though Fedora uses rpm-ostree, with which you can install (overlay) traditional packages to the base operating system, it is an healthy habit leaving the base operating system unaltered and use the containers for actual applications and day-to-day job. For this scope, Fedora IoT ships podman. What is Podman Podman is an utility similar to the docker command line and is designed to create and manage containers. As opposed to Docker, Podman doesn’t need any daemon, making it suitable also for devices with limited resources. Get and install Fedora IoT Even though Fedora IoT images are considered in the very early stages, we should wait Fedora 29 for a more solid release, here you can download the image: https://kojipkgs.fedoraproject.org/compose/iot/latest-Fedora-IoT-28/compose/IoT/ To install the system you can flash the SD card with the dd command, or use the fedora-arm-installer tool. You can find more info on the Fedora wiki https://fedoraproject.org/wiki/InternetOfThings/GettingStarted#Setting_up_a_Physical_Device Remember that you probably have to resize the third partition. Once inserted the SD card in the device, to complete the initial setup you need a serial connection or an hdmi display with a keyboard. The only thing you have to complete is the creation of an user. Once logged in you have to configure the Ethernet connection. For instance nmcli connection add con-name cable ipv4.addresses 192.168.0.10/24 ipv4.gateway 192.168.0.1 connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" type ethernet ifname eth0 ipv4.method manual Or if there is a DHCP nmcli con add type ethernet con-name cable ifname eth0 Two words about the GPIO on Fedora GPIO sysfs interface is deprecated, and in the future upstream kernel will kill it off definitively due to security and other issues. So in Fedora the kernel is already compiled without such flag. As a consequence we don't have the /sys/class/gpio path and many examples you can find around doesn’t work. On the other hand, upstream kernel provides the new character device /dev/gpiochipN To interact with this device we can't use ordinary commands line tools (echo, cat, etc), but you have to go through library and cli tools. Such tools are in the libgpiod-utils package and a corresponding Python library is provided by python3-libgpiod Creating a container with Podman These are the steps: Create a container Install the required packages inside it Create an image based on such container (commit) Create a new container starting from our image With the following command you will create a container based on the a Fedora image, then the container packages will be updated and the utils to interact with the GPIO will be installed. podman run --name gpiotmp fedora /bin/bash -c "dnf -y update; dnf -y install libgpiod-utils python3-libgpiod" Now that you have a container updated and with our tools in place, we can “promote” (commit) it to an image and create the subsequent containers starting from this image. This way we can mess inside the container as far as we want, without having to start from scratch every time with the dnf stuff. podman commit gpiotmp localhost/gpiobase You don’t need the previous container, so you can remove it podman rm gpiotemp At the end, you can create a new container, based on the image just created, where you can actually experiment with the GPIO. You will use the “--device” option that will add the GPIO device to the container. In the Raspberry Pi 3 you are interested in /dev/gpiochip0 podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/gpiobase /bin/bash You are now inside the container. Let’s turn on an LED As stated before, you have to use the CLI tools provided by the libgpiod-utils package. # gpiodetect Will print the GPIO chips list gpiochip0 [pinctrl-bcm2835] (54 lines) To get the list of the lines exposed by a chip # gpioinfo gpiochip0 Please, pay attention here: there is not a correlation between the number of physical pins and the number of lines printed by this command. What you should interested in is the BCM number, as you can see on this site https://pinout.xyz Please don’t play with lines number that doesn’t have a corresponding BCM number! Now let’s connect an LED to the physical pin 40, that is BCM 21. Please remember: short leg of the LED (the negative leg, called the cathode) must be connected to a GND pin of the Raspberry Pi, maybe with a 330 ohm resistor, and the long leg (the anode) connected to the physical pin 40. With this command the LED should light up until you press CTRL+C gpioset --mode=wait gpiochip0 21=1 With this command the LED should be light up for 5 seconds (-b stans for background). gpioset -b -s 5 --mode=time gpiochip0 21=1 Another useful command is gpioget, to get the status of a pin (high or low), that can be useful to play with buttons and switches. Conclusions You can also play with the LEDs using Python (https://github.com/brgl/libgpiod/tree/master/bindings/python/examples). Moreover, inside the container you can use the i2c devices as well. However the aim of this article was an introductory overview of the technologies that Fedora IoT will offer: an OSTree operating system, focused on containers, using an upstream Linux kernel. In addition, Podman is not strictly related to this Fedora edition, but you can install and use it on a regular Fedora installation; and at the end it whort to say that OSTree and Podman are two core components of the compelling new entries in the Fedora Project: Fedora Silverblue and Fedora CoreOS.