Toms Online Notebook Sharing my stuff.

My New Raspberry Pi2 running Fedora 21 with Full JAVA JDK

by tgutwin


Posted on Tuesday Jan 26, 2016 at 08:23PM in Technology


Raspberry IconI Got a Raspberry Pi2 ! It has a 900MHz quad-core ARM Cortex-A7 CPU  and 1GB RAM.


I first tried noobs with Debian and it ran out of the noobs box very
well.  The noobs version of Fedora DID NOT because it was not built for
the new version of the ARM processor in the Pi2. That was no big deal
because thanks to user clivem on the Pi Forums an image was avaialble.  See the forum link for the details. It is a full F21 version that is called FIDORA.


It was very easy to get this working. It is Fedora 21 for the ARM, with full yum repo support including rpmFusion.


I did the following, all from a linux desktop.



  1. Download the Raspbery Pi 2B image file



  2. confirm the checksums (Important)


    • md5sum Pi2B-Fedora-Xfce-armhfp-21-5-20150219-1-sda.raw.xz

    • and compare it with the one posted in the Fidora/21 download dir file



  3. uncompress it


    • unxz Pi2B-Fedora-Xfce-armhfp-21-5-20150219-1-sda.raw.xz



  4. rename it from .raw to .img


    • mv Pi2B-Fedora-Xfce-armhfp-21-5-20150219-1-sda.raw Pi2B-Fedora-Xfce-armhfp-21-5-20150219-1-sda.img



  5. get an SD that is 8GB or bigger


  6. Put the SD in your desktop computer and see what device it shows up as: (Mine was /dev/sdc )


    • watch the system message log while you plug it in, OR

    • use gparted , or

    • df command or

    • ls -la /dev    or

    • whatever works for you



  7. copy the image to the SD


    • Make sure you specify the correct device for your SD - the following command DESTROYS DATA

    • sudo dd bs=4M if=Pi2B-Fedora-Xfce-armhfp-21-5-20150219-1-sda.img of=/dev/sdc



  8. Check that it copied OK (because the 1st time I did it it had many
    errors on the SD card. I re-did all the steps above - especially
    checking the md5sum)


    • unplug and plug back in the SD in my desktop so it mounts the partitions

    • checked the mount logs for errors



  9. put the SD in the Pi2 and power-up


  10. it first boots to an initial Fedora config screen


  11. Do a yum update


    • sudo yum update



  12. Install Java


    • sudo yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel

    • click yes to all dependants



  13. go get Pi4J (a Java Library for the Pi)


    • got Pi4J download page and get the latest zip file

    • I created a /opt/java dir and will be putting all my Java Stuff inside

    • unzipped the pi4j downloaded file into /opt/java/pi4j



  14. Add the required Library paths that are used by Pi4J native calls:

    • The SystemInfo Object uses native calls to /opt/vc/bin/vcgencmd and also needs its libs

    • as root:


      • export PATH=$PATH:/opt/vc/bin

      • echo "/opt/vc/lib" > /etc/ld.so.conf.d/vc-arm.conf

      • ldconfig





  15. Have fun



After a few intial boots into the GUI Fxce deskktop, I set it to boot into a simple commandline (no desktop) by default:



  • sudo systemctl set-default multi-user.target


This is equivalent to RunLevel 3 Multi-User from sysv init.


 If I want an Xfce X session, I just type:



  • startxfce4

    • as opposed to the old startx which does not work





I then started setting up SMB/samba sharing so I could transfer files easier.  



  1. sudo yum install samba

  2. Edited the /etc/samba/smb.conf


    • security = user

    • interfaces = lo eth0 10.0.0.232/24



  3. turned OFF the firewall


    • sudo systemctl disable firewalld




  4. disabled selinux in the /etc/selinux/config file


samba now works



No one has commented yet.

Leave a Comment

HTML Syntax: NOT allowed