LibreELEC.tv
LibreELEC.tv copied to clipboard
Copy files from distro's stub filesystem and cli update script
This adds a DISTRIBUTION level filesystem to copy files into the image, similar to the existing PROJECT or DEVICE filesystems. I went to use this and found it didn't already exist.
Busybox's package.mk has been serving this role solely. Some of the scripts attached to busybox get edited by sed on install, but others are drop in files. This should be able to serve those files.
The show_config commit is to use the DISTRO_DIR var instead of hardcoding the path.
Added a commit with the CLI update script which I intended to make use of this.
The script is self-contained; one may copy it to /storage for testing. Its logic prioritizes as follows:
Installed releases series -> latest bugfix release in series (it's willing to download the update the .tar file in this case) If running a nightly -> checks for a newer release in that series (by timestamp, requires new releases.json format to work) If on latest bugfix release -> latest release for the running device (will not download, points to libreelec.tv for release notes)
So... LE 11.0.0 would upgrade to 11.0.1 (or higher point release) LE11 nightly from before 11.0.1 would upgrade to 11.0.1 (once new releases.json is deployed) LE11 would print a message saying to go to the website when LE12 comes. If LE12 and a hypothetical 11.0.5 is out, but user is on 11.0.0, it would want to upgrade to 11.0.5 before acknowledging LE12 existed.
Added a commit that changes the URL it looks for releases.json to https://releases.libreelec.tv/releases_v2.json. If that URL 404s, then it falls back to https://releases.libreelec.tv/releases.json. The URL may still be overridden with the --json
option.
The change in release.json format is needed before the canary waiting period or updating from a nightly to stable works (or having update files in subdirectories). The script will fail gracefully / has overrides until then.
The script is self-contained. Copy it to /storage and run to test. Edit L285 or so to set ARCHITECTURE, VERSION and VERSION_ID to pretend to be different devices or on a non-devel version. ex:
ARCHITECTURE = 'RPi2.arm'
VERSION = '11.0.0'
VERSION_ID = '11.0'
Current release.json:
LibreELEC:~ # ./update-system -v
ARCHITECTURE='RPi2.arm'
DISTRIBUTION='LibreELEC'
VERSION='11.0.0'
VERSION_ID='11.0'
Failed to download releases.json: https://releases.libreelec.tv/releases_v2.json
Falling back to: https://releases.libreelec.tv/releases.json
Found update file: http://releases.libreelec.tv/LibreELEC-RPi2.arm-11.0.1.tar
Unable to determine testing period of update. Holding update back. Use --force to proceed anyway.
update_available=False
update_major=False
update_location=None
No eligible system updates found to apply.
LibreELEC:~ # ./update-system -v -f
ARCHITECTURE='RPi2.arm'
DISTRIBUTION='LibreELEC'
VERSION='11.0.0'
VERSION_ID='11.0'
Failed to download releases.json: https://releases.libreelec.tv/releases_v2.json
Falling back to: https://releases.libreelec.tv/releases.json
Found update file: http://releases.libreelec.tv/LibreELEC-RPi2.arm-11.0.1.tar
update_available=True
update_major=False
update_location='http://releases.libreelec.tv/LibreELEC-RPi2.arm-11.0.1.tar'
System update found. Use --upgrade to apply.
LibreELEC:~ # ./update-system -v -f -u
ARCHITECTURE='RPi2.arm'
DISTRIBUTION='LibreELEC'
VERSION='11.0.0'
VERSION_ID='11.0'
Failed to download releases.json: https://releases.libreelec.tv/releases_v2.json
Falling back to: https://releases.libreelec.tv/releases.json
Found update file: http://releases.libreelec.tv/LibreELEC-RPi2.arm-11.0.1.tar
update_available=True
update_major=False
update_location='http://releases.libreelec.tv/LibreELEC-RPi2.arm-11.0.1.tar'
Downloading: http://releases.libreelec.tv/LibreELEC-RPi2.arm-11.0.1.tar
Download finished.
Copying LibreELEC-RPi2.arm-11.0.1.tar to /storage/.update
Download complete. Reboot to continue the update.
LibreELEC:~ # ls .update/
LibreELEC-RPi2.arm-11.0.1.tar
New format json (second run has canary forced to 1000 days - 10.0.3 is "current" in my mock archive):
LibreELEC:~ # ./update-system -v -j /storage/releases.json
ARCHITECTURE='RPi2.arm'
DISTRIBUTION='LibreELEC'
VERSION='10.0.2'
VERSION_ID='10.0'
Found update file: https://releases.libreelec.tv/LibreELEC-RPi2.arm-10.0.3.tar
update_available=True
update_major=False
update_location='https://releases.libreelec.tv/LibreELEC-RPi2.arm-10.0.3.tar'
System update found. Use --upgrade to apply.
LibreELEC:~ # nano -Ec update-system
LibreELEC:~ # ./update-system -v -j /storage/releases.json
ARCHITECTURE='RPi2.arm'
DISTRIBUTION='LibreELEC'
VERSION='10.0.2'
VERSION_ID='10.0'
Found update file: https://releases.libreelec.tv/LibreELEC-RPi2.arm-10.0.3.tar
Update held until 2025-09-23 04:46:35 for general availability.
update_available=False
update_major=False
update_location=None
No eligible system updates found to apply.
Fixed minor issues revealed by pylint. Added checking sha256sums to file downloading.
Added --nightly
to pull latest nightly build for the device. For uboot images, it picks the first of the available uboot images to use for updating.
Some other miscellaneous cleanups. Needs to squash before it's merged.