Network booting to Kodi / LibreElec / CoreElec
This is my guide so far, getting my "fries" LaFrite 1G to boot to Kodi
Why am I doing this?
What is not working yet or as expected:
File sources:
./LaFrite <-- Directory. Make sure root has RW
./LaFrite/CoreElec <-- Directory. Make sure root has RW
./LaFrite/CoreElec/SYSTEM <-- extracted from CoreElec/LibreElec image
./LaFrite/CoreElec/KERNEL <-- extracted from CoreElec/LibreElec image
./LaFrite/1866c79d06b0 <-- Directory created by LibreElec/CoreElec as storage
./LaFrite/pxelinux.cfg <-- Directory containing files specific to each device
./LaFrite/pxelinux.cfg/01-18-66-c7-9d-06-b0 <-- the actual file. Note the match to the MAC in DHCP. Can also be called default-arm if you don't want to be specific
^-- note the 255.255.255.240 only allows access (because it is insecure) to IPs ending 0 to 15
FSTAB map for NFS export:
Why am I doing this?
- Because I didn't read the spec sheet and thought there was an SD-card slot.
- Also turns out the USB pendrive support isn't great (I haven't updated the uBoot to a newer revision)
- Because out-of-the-box, PXE support is there ( Woohoo! )
- Also, it's quicker for me to change something on my server, from my notebook and try again.
What is not working yet or as expected:
- Video (displays white when playing files. interface seems fine)
- Audio on LaFrite
- works with an external USB soundcard
- IR
- seems to double press and do strange things
- I'm running MS remotes from late 2000's. Work fine with external MS IR puck
- Suspend (reboots)
- Network MAC address after Kernel load is different to PXE
- second rule / static assign needed for DHCP
- Linux (I'm using LinuxMint, so please adjust accordingly if not Debian based)
- tftp-hpa (root of tftp is @ /var/lib/tftpboot)
- isc-DHCP
- NFS server
- IP address 192.168.137.3
- Wireshark -- Very helpful to debug (set filter in the capture setup for "ether host XX:XX:XX:XX:XX:XX" <-- the MAC address)
File sources:
- CoreElec : https://github.com/CoreELEC/CoreELEC/releases/download/9.2.0/CoreELEC-Amlogic.arm-9.2.0-LePotato.img.gz
- Thor's compiled versions: https://forum.loverpi.com/discussion/comment/2450#Comment_2450
- DTB file : https://d-i.debian.org/daily-images/arm64/daily/device-tree/amlogic/meson-gxl-s805x-libretech-ac.dtb
- DTB File: see @Thor's compiled version in link above
- # LaFriteLoungePXE
host LoungeFritePXE {
filename "LaFrite/pxelinux.cfg";
hardware ethernet 18:66:c7:9d:06:b0;
fixed-address 192.168.137.6;
} - # LaFriteLoungeOS
host LoungeFriteOS {
hardware ethernet 02:db:01:47:35:88;
fixed-address 192.168.137.6;
}
./LaFrite <-- Directory. Make sure root has RW
./LaFrite/CoreElec <-- Directory. Make sure root has RW
./LaFrite/CoreElec/SYSTEM <-- extracted from CoreElec/LibreElec image
./LaFrite/CoreElec/KERNEL <-- extracted from CoreElec/LibreElec image
./LaFrite/CoreElec/uEnv.ini <-- extracted from CoreElec/LibreElec image
./LaFrite/meson-gxl-s805x-libretech-ac.dtb <-- downloaded DTB file./LaFrite/1866c79d06b0 <-- Directory created by LibreElec/CoreElec as storage
./LaFrite/pxelinux.cfg <-- Directory containing files specific to each device
./LaFrite/pxelinux.cfg/01-18-66-c7-9d-06-b0 <-- the actual file. Note the match to the MAC in DHCP. Can also be called default-arm if you don't want to be specific
PXELinux file contents:
- DEFAULT Kodi
LABEL Kodi
KERNEL CoreElec/KERNEL
FDT meson-gxl-s805x-libretech-ac.dtb
APPEND ip=dhcp boot=NFS=192.168.137.3:/export/LaFrite/CoreElec disk=NFS=192.168.137.3:/export/LaFrite/ overlay ssh
^-- note the 255.255.255.240 only allows access (because it is insecure) to IPs ending 0 to 15
FSTAB map for NFS export:
/var/lib/tftpboot/LaFrite /export/LaFrite bind bind 0
Comments
2019-09-21:
- Initial writeup
2019-09-21 #2:apt install tftp-hpa tftpd-hpa
systemctl enable tftpd-hpa
systemctl start tftpd-hpa
touch /var/lib/tftpboot/tempfile
tftp localhost
#At the tftp> prompt then
get tempfile
quit
#Back to the regular prompt
ls
#check for existence of the tempfile file that we copied with the get command.
#Instead of running my own dhcp instance on my rig I thought it'd be better to use my router. I went to my DHCP server settings and found some options that listed "Option 128(tftp server ip):" i set it to my computer's ip address. Then set "Option 67(boot file name):" to 'LaFrite/pxelinux.cfg'
#Then it was time to set up my tftp directory
cd /var/lib/tftpboot
mkdir LaFrite
cd LaFrite
#And now I'm sort of stuck. I'm looking for syslinux, but does it need to be architecture specific? ie. arm64?
You do not need syslinux as it seems to be already built into the bootloader. You just need a syslinux/pxelinux config file pointing to all the right files.
Wireshark will be very useful on the server, unless you have a managed switch that can allow you to mirror the La Frite network port for the purpose of sniffing with Wireshark. It really is a helpful tool to test network booting, particularly to watch the initial conversations between server and device.
Another place to check, is whether your DHCP is making the correct offer information (setting the boot server and boot file to use).
Also, check with a tftp client that you can get to pxelinux.cfg/default or pxelinux.cfg/XX-XX-XX-XX-XX-XX or similar syslinux type file.
Something that is also a gotcha for me is checking the /etc/default/tftpd-hpa is setup right and all the files/folders have the right permissions. Another thing I found was don't symlink as ttpd runs a chroot and can break links -- in fact, just don't link if at all possible. I found that even if I got links working, when the NFS portion kicks in, things break again.