19

I know Fedora has ARMv7 images. Can those be used on the Raspberry Pi 2, and if so, how?

0

6 Answers 6

13

[There is now a Fedora aarch64 release for the Pi 3, and on the same page an armv7 for the 2/3. I'm leaving this answer as is though, since it can be applied to any generic GNU/Linux ARM distribution.]

Yep, Fedora 21 [and more recently, 23...27] works. However, the pi 2 still requires a special out-of-tree kernel, and you need the firmware and bootloader, so you should start with an existing pi 2 image; here I'm using raspbian (make sure it is a version subsequent to 1-31-2015). There's an alternative to ripping stuff from Raspbian, see the note about /opt/vc at bottom -- but using a Raspbian card at first is simpler.

The Xorg GUI server works using the fbdev driver, as it does on raspbian. The repo won't have pi specific things such as oxmplayer, but they can be compiled from source or connived out of Raspbian packages (for an example involving omxplayer see here). For raspicam, see the /opt/vc note.

You'll also have to do your own kernel and firmware updates. This is simple enough -- you just need the rpi-update script from the raspbian image (it's in /usr/bin and has no dependencies other than curl and the shell) or github. There is a slight potential complication with that, see step #6.

  1. Create the SD card from the raspbian image normally and make sure it boots. This failed for me the first time and the kernel errors implied it was trying the armv6 kernel; "bcm_2835" was mentioned. Adding kernel=kernel7.img to config.txt on the first partition fixed this. Once it boots to the blue set-up screen, you can pull the plug -- that root fs is about to get deleted anyway.

  2. Put the card in another linux machine and mount the second partition. Inside /lib/modules you should find a -v7 directory, eg.3.18.5-v7. You want to copy that out and save it. Also get a copy of /etc/fstab. You can instead pull this stuff out of the downloaded raspbian image later (see here).

  3. Unmount the partition and run fdisk on the card. Delete the second partition and replace it with a new 0x83 (Linux) second partition (this is your chance to make the second partition fill the card). Next, run mkfs -t ext4 ... on that partition.

  4. Download an image via Fedora 21's ARM release page. I used Fedora-Minimal-armhfp-21-5-sda.raw.xz. This is xz compressed, uncompress it with unxz. The image file contains three partitions. The first two are of no interest; the third one contains the root fs. You can get the offset with fdisk Fedora-Minimal-armhfp-21-5-sda.raw; the "Start" number is probably 1251328 and the "Units" are probably 512 bytes, 1251328 * 512 = 640679936, so:

    mount -o offset=640679936 Fedora-Minimal-armhfp-21-5-sda.raw /mnt/whatever
    

    Copy everything into the new empty second partition on the SD card (cp -a works for this).

  5. Copy the kernel module directory from raspbian into /lib/modules/ on the newly populated second partition; make sure you preserve the "-v7" subdirectory name exactly. Also copy the /etc/fstab, replacing the Fedora one. Edit that so the first partition is mounted on /boot/rpi instead of just /boot, and create such a directory on the second partition. This is in case subsequent Fedora updates put stuff here (they will) which will never get used; the actual raspberry pi stuff might as well be kept separate. There's a bit of a complication, though, if you are going to use rpi-update, since that writes to /boot. You can either remount the first partition over /boot before you do that (and put it back afterward), or edit BOOT_PATH in rpi-update (but beware rpi-update updates itself).

    See the note at bottom about /opt/vc for an option about keeping the firmware and kernel updated.

  6. Unmount the SD card and stick it in the pi. The "minimal" version of Fedora 21 ARM I used had a minimal setup with 4 options (language, time zone, root password, create user). I had to go through a bit of work with yum to test X, but if you choose one of the GUI images (KDE, Xfce, Mate etc.) you won't have to bother with that.

    Run yum update once you log in.


/opt/vc

You'll probably at some point want something from what's in /opt/vc on Raspbian (and may be included other ways by other pi distros). This is actually from a github repo which includes the firmware and pre-compiled kernels, so if you clone the "firmware" part of that repo:

git clone https://github.com/raspberrypi/firmware

You get pretty much everything, including all the stuff for the first /boot partition, and the corresponding /lib/modules -- i.e., you could create the card completely from scratch using just this and the Fedora image, and update manually with git pull.

[Be warned that this is 3.5+ GB worth of stuff. Note you don't need to do it on the pi.]

The /opt/vc directory of that repo contains some libraries and executables, including vcgencmd and raspivid, etc. /opt/vc/bin is in $PATH on Raspbian and you can do the same thing or copy what you want where ever. What's critical is that the libraries in /opt/vc/lib are found by the linker. If you copy /opt/vc directly to the pi, as root:

echo "/opt/vc/lib" > /etc/ld.so.conf.d/rpi.conf
ldconfig

Otherwise the stuff in /opt/vc/bin won't work. The openGL ES libraries for hardware acceleration on the GPU are also in here.

3
  • Cool :) but with the 'pull the plug' bit, this is also a good way to mess up SD cards...
    – Wilf
    Feb 13, 2015 at 0:36
  • @Wilf: In that context it's fine; nothing has changed on the first partition (unless you go through with raspi-config), and the second partition doesn't matter as it is never going to be used again.
    – goldilocks
    Feb 13, 2015 at 15:31
  • 2
    instead of changing rpi-update since it updates itself overwriting the changes you can call it and give it the new path ROOT_PATH=/ BOOT_PATH=/boot/rpi rpi-update BTW, you need to pass it both paths or it won't work, so root path should be / as normal, but boor path is whatever you chose for your rpi-boot May 4, 2015 at 20:40
5

You can install "Fedora 21 REMIX for Raspbery Pi 2B"

Instructions here:

http://www.raspberrypi.org/forums/viewtopic.php?f=51&t=101027

Images here:

http://www.digitaldreamtime.co.uk/images/Fidora/21/

3
  • 2
    Thank your for submitting your first answer. I would like to point out though that answers should contain more than just links to other sites. Links have a tendency to die and cause answers to become useless. Please flush out your answer a little more.
    – Jacobm001
    Mar 2, 2015 at 17:22
  • +1 And much appreciated; I disagree with Jacobm001 in this case in so far as it's not necessary to explain further. I'm leaving my answer as my accepted one, though, for the reason I've added to the top of it.
    – goldilocks
    Mar 2, 2015 at 19:32
  • Image download link appears to be dead but this one works: fedberry.agrez.net
    – trip0d199
    Oct 21, 2015 at 21:03
3

Since this question was answered, a version of Fedora 25 in a new state has been released for some Rasberry Pi models:

We currently only support the Raspberry Pi Model B versions 2 and 3.

Note that support is "very new":

The Raspberry Pi support is now supported in Fedora 25 Beta and later. Fedora 25 final release support is still very new so please report issues to the ARM mailing list or IRC channel

Source: https://fedoraproject.org/wiki/Raspberry_Pi

1
  • Well, that makes things a bit easier. For those interested, most of the issues listed on that page (no camera, no sound, etc.) are because of the kernel they're using, but you should be fine using the one from the Foundation firmware repos instead (don't forget the modules too..).
    – goldilocks
    Dec 5, 2016 at 13:41
1

Yes, instructions for someone with minimal Linux experience are at: https://chisight.wordpress.com/2015/10/19/fedora-22-or-23-on-raspberry-pi-2/

2
  • Here, at StackExchange, in the Raspberry Pi community, we like answers to stand on their on, without the complete answer being in a link. Oct 21, 2015 at 2:47
  • Have these instructions changed with the Fedora 25 support for pi?
    – Daryl
    Jan 2, 2017 at 14:13
1

Fedberry is worth having a look at. It is based on Fedora 23. They provide images as download. The large one (~720 MB download) extracts to a 4.6 GB disk image including XFCE.

On Windows, I was able to uncompress the unusual .xz extension with the help of 7Zip. I then wrote it to the SD card using Win32DiskImager as I would do for Raspbian. Since the extracted file does not have the required .img extension, you have to enter * in the file open dialog to find it.

Like Raspbian it will resize the disk at first boot and ask for configuration when booted.

Uncompressing with 7Zip on Windows

Win32DiskImager select Fedberry

0

Try Fedberry Fedora remix. I'm currently using Fedberry and it works great. You can directly burn the image onto the sd card but using Pinn was easier for me.

1
  • I also noticed another fedora remix called pidora, I dont know how it compares to Fedberry
    – Auniverse
    Aug 1, 2019 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.