XBMC

= Kodi Shortcuts = Kodi/XBMC Shortcuts

O Ctrl + Shift + O
 * Video Information Shortcuts:

= OpenELEC Dual Boot on PC=

How to dual boot(actually Triple boot) OpenELEC with Ubuntu and Windows.


 * OpenELEC itself requires at least 2 partitions.


 * Create the first partition, EXT4
 * Label it 'OE_SYSTEM', size 512MB to 1GB.
 * The OE_SYSTEM partition must be flagged as bootable.
 * Both operating system files, SYSTEM and KERNEL, must be placed into the OE_SYSTEM partition (assume /dev/sda6)


 * Create the second partition, EXT4
 * Label it 'OE_DATA', size.
 * Here all local OpenELEC/XBMC data will be placed, such as databases and thumbnails (assume /dev/sda7)


 * Write down the linux drive letters & update the below file with it
 * Unlike Grub, Grub2 starts partition counting from 1 not 0.

sudo gedit /etc/grub.d/40_custom
 * Now update Grub2:

exec tail -n +3 $0 # menuentry "OpenELEC" { search --set=root --label OE_SYSTEM --hint hd0,msdos6 linux /KERNEL boot=LABEL=OE_SYSTEM disk=LABEL=OE_DATA quiet } menuentry "OpenELEC debugging" { search --set=root --label OE_SYSTEM --hint hd0,msdos6 linux /KERNEL boot=LABEL=OE_SYSTEM disk=LABEL=OE_DATA debugging }
 * 1) !/bin/sh
 * 1) This file provides an easy way to add custom menu entries.  Simply type the
 * 2) menu entries you want to add after this comment.  Be careful not to change
 * 3) the 'exec tail' line above.

Now finalize the grub menu additions:

sudo update-grub

= LibreElec Shutdown Button =



Source: libreelec.tv, lowpowerlab.com, libreelec.tv

Program ---> Get more ... ---> Raspberry Pi Tools ---> install
 * Install Raspberry Pi Tools from libreELEC UI:

nano /storage/.config/shutdown_pi.py
 * Create shutdown script:

nano /storage/.config/autostart.sh
 * Create Autostart Script:

chmod +x shutdown_pi.py chmod +x autostart.sh
 * Make files executable

mount -o remount,rw /flash nano /flash/config.txt enable_uart=1
 * Enable UART for the Status LED:


 * Reboot

= OSMC =

OSMC Shutdown Button
Source: discourse.osmc.tv



sudo apt update sudo apt install python-pip python-dev gcc python-setuptools wheel pip install rpi.gpio
 * Install Raspberry Pi Tools from CLI:

nano /home/osmc/.config/shutdown_pi.py
 * Create shutdown script:

sudo chmod +x shutdown_pi.py
 * Make files executable

./home/osmc/.config/shutdown_pi.py
 * Test Script:


 * Auto Start as a Service

Create systemd service file: sudo nano /lib/systemd/system/shutdownpi.service

[Unit] Description = GPIO shutdown button

[Service] Type = idle ExecStart = /home/osmc/.config/shutdown_pi.py

[Install] WantedBy = multi-user.target

Enable the service: sudo systemctl enable shutdownpi

Start the service: sudo systemctl start shutdownpi

sudo nano /boot/config.txt enable_uart=1
 * Enable UART for the Status LED:


 * Reboot

= Patch for MPEG2 & VC1 Codecs = Source: reddit.com

xxd -u start_x.elf > /tmp/start_x.elf.hex grep '47 *E9 *33 *36 *32 *48' /tmp/start_x.elf.hex 00b9db0: 47E9 4341 4C46 2118 47E9 3336 3248 1D18 G.CALF!.G.362H..
 * Convert Binary to Hex & grep the file contents:

cp /boot/start_x.elf /boot/start_x.elf_backup cp /boot/start_x.elf ~/start_x.elf cd ~ cp start_x.elf start_x.elf_backup
 * Backup files:

perl -pne 's/\x47\xE9362H\x1D\x18/\x47\xE9362H\x1D\x1F/g' < start_x.elf_backup > start_x.elf diff start_x.elf start_x.elf_backup             # This should show binaries are different
 * Convert \x1D\x18 -> \x1D\x1F:

mv ~/start_x.elf /boot/start_x.elf reboot
 * Replace the binary: