Recently a  friend of mine asked me, if it would be possible to get a media center or something like that running on his old flat screen TV, that wasn’t a SmartTV. He wanted a kind of SmartTv-like app system (Add-Ons). So I decided to install KODI Mediacenter on Raspberry Pi 2 B+ that I had laying around. Therefore I had to install OpenELEC (http://openelec.tv/), which  is an embaded operating system specially build for KODI (http://kodi.tv/). And yes it’s pretty cool. It hat a very huge community and a plugin system with plenty extensions.
I took the following steps to Install OpenELEC Mediacenter on RaspberryPi 2 B+
- Download  a appropriate disk image from http://openelec.tv/get-openelec (in our case http://releases.openelec.tv/OpenELEC-RPi2.arm-6.0.0.img.gz)
- Format the MicroSD card as a single partition of type ext4:
- List partitions:
$> sudo fdisk -l
This should list something like that:
Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xc16a9ea4 Device Boot Start End Blocks Id System /dev/mmcblk0p1 2048 31116287 15557120 b W95 FAT32
- Delete all existing partitions:
$> sudo fdisk /dev/mmcblk0
This should give you another dialog / prompt.
- type d to delete partitions
- recheck partitions (type p, should show an empty partition table)
Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xc16a9ea4 Device Boot Start End Blocks Id System
- Create a new overall size ext4 partition:
- Type n for a new partition
- Type p to make it a primary partition
- Press enter to set partition number to 1
- Press enter to set first sector to default value
- Press enter to set last sector to default value (use the whole disk)
- Now the partition table should look like that (press p to print it):
Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xc16a9ea4 Device Boot Start End Blocks Id System /dev/mmcblk0p1 2048 31116287 15557120 83 Linux
- Write the partition table to disk and exit by pressing w
- Format the new partition with ext4:
$> sudo umount /dev/mmcblk0p1 $> sudo mkfs.ext4 /dev/mmcblk0p1
The result should look like that:
mke2fs 1.42.9 (4-Feb-2014) Discarding device blocks: done Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 972944 inodes, 3889280 blocks 194464 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=3984588800 119 block groups 32768 blocks per group, 32768 fragments per group 8176 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done
- List partitions:
- Now you have to unpack the downloaded archive:
$> gunzip -d OpenELEC-RPi2.arm-6.0.0.img.gz
- Afterwards you have to copy the extracted disk image to the MicroSD card:
$> sudo dd if=OpenELEC-RPi2.arm-6.0.0.img of=/dev/mmcblk0 bs=4M
The result should look like that:
73+0 records in 73+0 records out 306184192 bytes (306 MB) copied, 23,004 s, 13,3 MB/s
Finally you should call sync once more, to make sure, all data is synced to your card:
$> sync
- THAT’S IT! Now you should be able to put the card into your Pi and plug it into your TV to run OpenELEC.