13 April 2016

[1/2] Install Fedora 23 Minimal version (lightweight) on Raspberry Pi 3

This article explains how to install the most lightweight Fedora 23 Minimal Version on a microSD card, dedicated to a Raspberry Pi 3.
If you're looking for

an installation with only essentials packages and configuration, with access to all of the Raspberry Pi 3 hardware, only in 'text mode' and dedicated to remote use after setup, you are in the good place.

On the other hand, if you're willing to setup an OS with graphical desktop environment, you may complete your readings with this article explaining how to setup Fedora 23 with XFCE.
In any case, the Fedora documentation is interesting.
And you may find some additional information on this article, about Fedora 22/23 installation on Raspberry Pi 2.

Preparation

First of all, you need to download:
 - the Fedora 23 Minimal Version (you can download the Server Version if you're sure you'll need alot of corresponding packages)
 - the Raspberry Firmware

Create and format the partitions

You can manage the microSD card dedicated to the Raspberry Pi 3 on any card reader, on your computer.
You must create the following partitions:

  • a primary FAT32 partition* for /boot, 128 MB is enough (you can a bigger partition if you plan to have lots of kernel versions)
  • a swap partition, 512MB (or even 1024MB if you have plenty of space)
  • primary Linux partition for /
  • (optional) some other Linux partitions (e.g. /home ...)

* Raspberry is expecting this partition as the first one (and MUST be a primary partition)

You can follow these instructions, whilst adapting size to your needs.
Then you can format the partitions; if you want, you may format the Linux partitions as Xfs or ReiserFS, instead of ext4.

You can follow the Fedora Project instructions to mount the SD card partitions.
Let's say you mounted the SD card partitions on /mnt/rpi, and Fedora image on /mnt/fedoraImage (otherwise, adapt the paths in following instructions).

Prepare the boot partition

Follow these instructions to download the firmware, and uncompress it.
Then, you can copy the firmware files to the boot partition using rsync
rsync -av firmware-master/boot/ /mnt/rpi/boot/
rsync -av firmware-master/modules/ /mnt/rpi/lib/modules

The Raspberry Kernel reads the mandatory file /mnt/rpi/boot/cmdline.txt
For instance, you can create it with this line
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline ipv6.disable=1 rootwait

Adapt this line to your needs, keeping in mind:

  • don't change /dev/mmcblk0p3, it is the way your 3rd partition will be named on the Raspberry 
  • you can adapt rootfstype to your root partition format
  • ipv6.disable=1 is optional, and you can add more options according to your needs


Eventually, you can create the configuration file /mnt/rpi/boot/config.txt file to define BIOS-like options, with this contents (you can add all additional configuration options you want)
disable_overscan=1
hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=16

Prepare the root partition

You can follow these instructions to populate the root partition.
To copy the Fedora image's files to the root partition using rsync
rsync -av /mnt/fedoraImage/ /mnt/rpi/

Eventually, you must create the fstab file, following these instructions.
Adapt the instructions:

  • for the root partition file system if you formatted it with something different from ext4
  • add equivalent lines for any additional partitions you created (e.g. /home ...)

Finalization

Ensure all data are flushed on the SD card
sync

You can now:

  • unmount the SD card partitions
  • unmount the Fedora image
  • eject the card reader
  • put the SD card in your Raspberry Pi 3 and start it !


The next article will give instructions to conclude the installation (including Wifi, automatic @IP address at boot time delivered by DHCP ...) directly on the running Raspberry Pi 3.

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: