Posts by ivoR.

    My setup is described here: RE: LibreELEC v9 RPI3 PXE

    For updates, I just do this:

    Download the image for my Raspi, create an update directory and move the image in the new directory:

    root:/nfs/Raspi# wget
    root:/nfs/Raspi# mkdir -p upd/p1
    root:/nfs/Raspi# mv LibreELEC-RPi2.arm-9.2.7.img upd/p1

    Mount the first partition of the image:

    root:/nfs/Raspi# mount $(losetup --show -r -f -P upd/LibreELEC-RPi2.arm-9.2.7.img)p1 upd/p1
    mount: /nfs/Raspi/upd/p1: WARNING: device write-protected, mounted read-only.

    Overwrite the SYSTEM over my old one

    root:/nfs/Raspi# cp -vax upd/p1/SYSTEM 3X84XbXf.boot/SYSTEM
    'upd/p1/SYSTEM' -> '3X84XbXf.boot/SYSTEM'

    Overwrite the rest to the tftpboot directory:

    root:/nfs/Raspi# rsync -av upd/p1/* /var/lib/tftpboot/3X84XbXf/ --exclude SYSTEM* --exclude cmdline.txt --exclude config.txt

    Clean up

    [email protected]:/nfs/Raspi# umount upd/p1
    [email protected]:/nfs/Raspi# losetup|grep LibreELEC-RPi2.arm-9.2.7.img
    /dev/loop2         0      0         0  1 /nfs/Raspi/upd/LibreELEC-RPi2.arm-9.2.7.img   0     512
    [email protected]:/nfs/Raspi# losetup -d /dev/loop2
    [email protected]:/nfs/Raspi# rm -fr upd
    [email protected]:/nfs/Raspi#

    Well done :)


    Because I can't find a straight forward documentation about PXE boot with Raspi and LibreELEC, I will post my configuration, where I did today. I won't go in the details like how to install DHCP server, NFS server etc. There are a lot of good documentation... So let's start...

    Prerequirements (can be found on the net):

    - A working DHCP server

    - A working TFTP server

    - A working NFS server

    - A Raspberry who can and is configured for PXE boot

    - Knowledge about TFTP, NFS, DHCP, Linux etc.

    My setup:

    - opnSense firewall who is responsible for DHCP requests (

    - Ubuntu 18.04.3 who do the TFTP and NFS stuff with the IP

    - Rasperry Pi 3B+ with serial number 3X84XbXf and a via DHCP assigned IP

    - LibreELEC 9.2.0

    1. DHCP server configuration

    I use my opnSense as my DHCP server, so maybe you have to adapt the settings to your DHCP server, but here is my configuration with the Raspi PXE special configured fields:

    Services/DHCPv4/[lan]/TFTP server/Set TFTP hostname:
    Services/DHCPv4/[lan]/TFTP server/Set Bootfile: [let them empty]
    Services/DHCPv4/[lan]/Additional Options/Number:43 Type:Text Value:Raspberry Pi Boot
    Services/DHCPv4/[lan]/Additional Options/Number:60 Type:Text Value:PXEClient

    2. TFTP server configuration

    I use tftpd-hpa (apt-get install tftpd-hpa) as server and I made these changes:

    # /etc/default/tftpd-hpa
    TFTP_OPTIONS="--secure -vvv"

    Don't forget to systemctl restart tftpd-hpa.service and let the TFTP server automatic start after reboot.

    3. NFS server

    There is nothing special configured on the NFS server, but here is my /etc/exports config to understand also next points:


    So, everything related to NFS is in the /nfs directory and don't forget to let the NFS server start after a reboot.

    4. LibreELEC image

    Download the latest LibreELEC Image from (or whatever you have) to your TFTP server, extract it, mount it temporary and copy the bootcode.bin file to the root directory from the TFTP server:

    [email protected]:/tmp# wget
    [email protected]:/tmp# losetup -f -P /tmp/LibreELEC-RPi2.arm-9.2.0.img
    [email protected]:/tmp# losetup -l
    /dev/loop1         0      0         1  1 /var/lib/snapd/snaps/core_8268.snap   0     512
    /dev/loop0         0      0         1  1 /var/lib/snapd/snaps/core_8213.snap   0     512
    /dev/loop3         0      0         0  0 /tmp/LibreELEC-RPi2.arm-9.2.0.img     0     512
    [email protected]:/tmp# mkdir /tmp/1
    [email protected]:/tmp# mount /dev/loop3p1 /tmp/1/
    [email protected]:/tmp# cp -vax /tmp/1/bootcode.bin /var/lib/tftpboot/

    Don't unmount the loop device, we need it later again...

    5. Get the Raspi serial number

    Now, just let your Raspi boot with PXE and have a look in /var/log/syslog, you can find a lot of sending NAK (1, File not found) to, but also the requests to the requested files, like RRQ from filename 3X84XbXf/start.elf

    And here you are, you have your Raspi serial number: 3X84XbXf

    Ah, the filename in the syslog is relative to the tftp configuration where I set in /etc/default/tftpd-hpa:TFTP_DIRECTORY before.

    So you can have for each Raspi in your network your own PXE configuration, cool...

    6. Prepare the files on the TFTP server

    Because we have the LibreELEC image still mounted and also the serial number from our Raspi, we have to bring the things together and I change the cmdline.txt file:

    [email protected]:/tmp# mkdir /var/lib/tftpboot/3X84XbXf
    [email protected]:/tmp# cp -vax /tmp/1/* /var/lib/tftpboot/3X84XbXf/
    [email protected]:/tmp# echo "boot=NFS= disk=NFS= ssh ip=dhcp" >/var/lib/tftpboot/3X84XbXf/cmdline.txt

    7. Prepare the files on the NFS server

    On the NFS server, we have to prepare now the directories. The 3X84XbXf.boot is for the little binary stuff (only the "SYSTEM" file) and the 3X84XbXf.disk for the data from LibreELEC, we let them empty, LibreELEC fill it up after the first start. If you have the TFTP and NFS server on separate machines, you have to copy the file for the 3X84XbXf.boot directory from your TFTP server or download the LibreELEC again and attach it via loop again. For me, it's on the same machine and the image is still mounted to /tmp/1:

    [email protected]:/tmp# mkdir -p /nfs/Raspi/3X84XbXf.boot /nfs/Raspi/3X84XbXf.disk
    [email protected]:/tmp# cp -vax /tmp/1/SYSTEM /nfs/Raspi/3X84XbXf.boot

    Now, we don't need the LibreELEC image anymore, so you can unmount it and remove it as a loop device, or just reboot everything... Also the Raspi, because it should now boot from network and you can start to configure it :)

    8. Something won't work

    Check the DHCP server log, what's going on with the requests (maybe you need to dump the packets with tcpdump).

    Have a look on the TFTP server's syslog file about "not found's".

    If everything is fine there and the problem is on the NFS side, you can start NFS debugging in the NFS server with rpcdebug -m nfsd -s proc, now everything is logged also to the syslog file. Stop it with rpcdebug -m nfsd -c

    I hope this help's you a bit through the jungle...

    gruss ivo