OrangePi: Installing OpenELEC chroot into Armbian

Hi all,

since I found, that Debian chroot on OpenELEC is not the best solution, I tried to do it vice-versa. This is what I needed to do.

  1. First step is to install armbian, I’m not going to describe it here
  2. Download and untar OpenELEC .tar upgrade file onto your device
    root@orangepipc:~# wget https://down.nu/updates/OpenELEC-H3.arm-7.0-devel-20170221190834-r23330-g94644893c.tar
    --2017-03-04 12:44:48--  https://down.nu/updates/OpenELEC-H3.arm-7.0-devel-20170221190834-r23330-g94644893c.tar
    Resolving down.nu (down.nu)... 138.68.124.4, 2a03:b0c0:3:d0::1231:4001
    Connecting to down.nu (down.nu)|138.68.124.4|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 144998400 (138M) [application/x-tar]
    Saving to: ‘OpenELEC-H3.arm-7.0-devel-20170221190834-r23330-g94644893c.tar’
    
    OpenELEC-H3.arm-7.0-devel-20170221190834-r 100%[========================================================================================>] 138.28M  8.13MB/s    in 22s     
    
    2017-03-04 12:45:11 (6.15 MB/s) - ‘OpenELEC-H3.arm-7.0-devel-20170221190834-r23330-g94644893c.tar’ saved [144998400/144998400]
    
    root@orangepipc:~# tar -xf OpenELEC-H3.arm-7.0-devel-*.tar
  3. Strip u-boot header from kernel and put it into /boot folder
    root@orangepipc:~# tail -c+65 < OpenELEC-H3.arm-7.0-devel-*/target/KERNEL > /boot/vmlinuz-openelec
  4. Move OE root to /opt and create moutpoint
    root@orangepipc:~# mv OpenELEC-H3.arm-7.0-devel-*/target/SYSTEM /opt/openelec-root
    root@orangepipc:~# mkdir /opt/openelec
  5. Change symlink to boot OE kernel
    root@orangepipc:~# cd /boot
    root@orangepipc:/boot# rm zImage
    root@orangepipc:/boot# ln -s vmlinuz-openelec zImage
  6. Set video resolution
    root@orangepipc:~# h3disp -m 1080p60
    Now trying to patch script.bin with your settings. Successfully finished. Please reboot for changes to take effect
  7. Install pulseaudio
    root@orangepipc:~# apt install pulseaudio
  8. Create home for kodi
    root@orangepipc:~# mkdir /storage
  9. Create chroot startup file /storage/start.sh
    mount -t devtmpfs /dev /dev
    mount -t proc /proc /proc
    mount -t devtmpfs /dev /dev
    mount -t sysfs /sys /sys
    
    modprobe mali
    
    mkdir /run/connman/
    echo "nameserver 8.8.8.8" > /run/connman/resolv.conf
    
    export HOME=/storage
    /usr/lib/kodi/kodi.sh --standalone -fs &
    
    
  10. Create chroot starter file /root/kodi-start.sh
    mount -o loop /opt/openelec-root /opt/openelec
    mount -o bind /storage /opt/openelec/storage
    mount -o bind /var /opt/openelec/var
    mount -o bind /run /opt/openelec/run
    
    pulseaudio --system --daemonize
    
    chroot /opt/openelec/ /storage/start.sh
    
    
  11. Make them both executable
    root@orangepipc:~# chmod +x /storage/start.sh
    root@orangepipc:~# chmod +x /root/kodi-start.sh
  12. Edit /etc/rc.local
    # disable console cursor blinking
    echo 0 > /sys/class/graphics/fbcon/cursor_blink
    
    /root/kodi-start.sh &
    
    exit 0
  13. Reboot

And that’s it. HW accelerated kodi should start after boot.

Enjoy!

11 thoughts on “OrangePi: Installing OpenELEC chroot into Armbian”

  1. Thank you, very detailed instructions, works ok!
    Some questions: is it safe to do upgrades via apt-get, even when there is a new Armbian kernel available?
    And, how to enable Samba sharing?

      1. Thanks, but what do you mean “replace the kernel after upgrading”?
        And, after “apt install samba”, the setup/configuration is done in Openelec or in the native Armbian system?

        1. * step 5 replaces kernel
          * in native armbian, you can’t do anything in openelec since it’s mounted read-only

  2. having a problem here. it shows “starting Kernel” than the screen goes black for a minute and than reboots. rinse and repeat.

    Have tried many SDcards and redone the image many times.
    boxes is a BX2(H3 board)

    anyone have any ideas to fix this?

    1. I’ve had something like that while trying to install openelec on a Opi (A20)… kernel was not starting, machid error IIRC.

Leave a Reply

Your email address will not be published. Required fields are marked *