Install on a Raspberry Pi

## Installing on a Rasperry Pi

The simple way to install on a Rasperry Pi is to download the prepared image and dd it to an SD card. It is important to select the correct image for your hardware.

### Hardware

Several versions of Raspberry Pi's have been released.

#### The first generation

The original Pi was released in February 2012 in basic model A and a higher specification model B. There are slight diffences between the hardware of the original models and later models.

A+ and B+ models were released a year later. These use v2 images.

#### The second generation

Raspberry Pi 2 model A and B were released in February 2015. In the image files these are referred to as raspi2.

The Pi zero with a smaller footprint and limited IO capabilities released in November 2015. There is currently no RedSleeve image for the Pi Zero.

### Choosing the Image

#### First generation

There are two images available - CLI and GUI.

**Note:** There appears to be an issue with the images on the redsleeve website and the newer 512Mb v2 boards. Choose the image below to install Redsleeve on a Raspberry PI v2 board:

http://www.mirrorservice.org/sites/ftp.redsleeve.org/pub/el7-devel/el7/rootfs/raspi-redsleeve7.1-cli-0.4.img.xz

#### Second generation

There second generation images are provided by Jacco Ligthart and available here:

http://www.mirrorservice.org/sites/ftp.redsleeve.org/pub/el7-devel/el7/rootfs/raspi2-redsleeve7.1-cli-0.1.img.xz

### Installing the image

#### Linux

After downloading the image archive file, unpack and dd the image to a sd card:

`#xz -cd raspi-v2-redsleeve-cli-0.3.img.xz | dd of=/dev/mmcblk0 bs=4M`

```
(use /dev/sdb is your sdcard is sdb, check with dmesg)

```

### Starting RedSleeve

Boot from the sdcard, dhcp won't work since the dhclient package is not installed on this image so you have to configure static ip-adresses yourself:

`vi /etc/sysconfig/network` (for hostname and gateway specification)
`vi /etc/sysconfig/network-scripts/ifcfg-eth0` (for ip, netmask, network, onboot, static config)
`vi /etc/resolf.conf` (for dns resolving)

Remove the following file to make sure eth0 is properly loaded at boot: `rm /etc/udev/rules.d/70-persistent-net.rules`

Reboot: `reboot`

Check if everything is working and use yum to install packages.
I advise installing e2fsprogs to resize your 2nd partition if you have a sd card larger then 2 GB:

`fdisk /dev/mmcblk0`

Remove the 2nd partition using `d` and look closefully where the first partition ends (which block/cylinder).
Add a new parition:`n` and use as starting point the next number/cylinder/block where the first partition ends.
For example if partition 1 is cylinders 1-1242, then use 1243 as the new starting point for your new second partition and use the default as proposed by fdisk for the endpoint.
Keep also the default partition type (linux/ID 83).
Type `w`
Then `q`

Don't worry about the message and reboot `reboot` to start resizing your new 2nd partition.
When the raspberry pi is up, typ the following to resize your new created 2nd partition: `resize2fs /dev/mmcblk02p` and after the succesful resize check your new disk space with `df -h`.

**Alternative method:**

There is an alternative method below which should work in this case.

Assuming a linux box, you need to decompress it and burn it to the SD card like this:

CLI:

`#xz -cd raspi-redsleeve-cli-0.3.img.xz | dd of=/dev/mmcblk0 bs=8M`

GUI:

`#xz -cd raspi-redsleeve-gui-0.3.1.img.xz | dd of=/dev/mmcblk0 bs=8M`

Important Notes:

1. You will need at least a 2GB SD card.
2. Pay attention to the of=/dev/mmcblk0 in the above command. You will have to change this to whatever your SD card shows up as. You can typically find out what this should be by checking the output of dmesg after inserting the SD card. If you dd to the wrong target you can erase your system disk, so **BE CAREFUL**.

When this completes you can pop the SD card in the Rasperry Pi and boot up.

A couple of notes:

-- User login is user=pi, password=raspberry

-- Root login is user=root, password=redsleeve (user=root, password=password or password1234 on more recent images)

Original instructions and dd images for the Raspberry Pi were provided by John Cooper.

You can also use the Fedora ARM Installer to install the images to the SD card.

If you are looking for a decently performing SD card to use with your Rasperry Pi, you might want to check out the flash module benchmark results. The link to the results table is at the end of the article, and the relevant table is the second one (scroll down to the bottom of the results page). Specifically, the random-write IOPS figures are crucial.

## Switching from Debian Squeeze / Raspbian to Redsleeve (Alternative Method)

If you want to install RedSleeve manually, rather than using the image mentioned above, it is easiest to start with an existing, working SD card with the latest Debian “squeeze” image on it (get this from the Rasperry Pi download page. These instructions are a little rough, but they should get you running.

1. Mount the second partition of the card on your workstation. The rest of the instructions assume that this is `partition2` and you have this mounted under `/mnt`.
2. `cd /mnt`
3. Backup the modules and firmware: `tar -cf ~/raspi.tar lib/modules lib/firmware`
4. `cd ~`
5. `umount /mnt`
6. `mke2fs -t ext4 partition2`
7. `mount partition2 /mnt`
8. `cd /mnt`
9. Extract the RedSleeve rootfs: `tar --strip-components 1 -xjf ~/rsel6-rootfs.tar.bz2`
10. Restore the backed up files: `tar -xf ~/raspi.tar`
11. `cd etc`
12. `vi fstab`. Change root to mount from /dev/mmcblk0p2, /boot to mount from /dev/mmcblk0p1
13. `cd ~`
14. `umount /mnt`