diff --git a/config/noobs/os.json b/config/noobs/os.json index 2fb08c7f63..5b5cbbb413 100644 --- a/config/noobs/os.json +++ b/config/noobs/os.json @@ -1,6 +1,6 @@ { "name": "@DISTRONAME@_@PROJECT@", - "version": "@LIBREELEC_VERSION@", + "version": "@DISTRO_VERSION@", "release_date": "@RELEASE_DATE@", "kernel": "@KERNEL_VERSION@", "description": "@DESCRIPTION@", diff --git a/config/path b/config/path index 0151372e24..48b04d5a07 100644 --- a/config/path +++ b/config/path @@ -16,9 +16,9 @@ set -e [ -z "${HOST_NAME}" ] && export HOST_NAME="$($LOCAL_CC -dumpmachine)" TARGET_NAME=$TARGET_GCC_ARCH-libreelec-linux-gnu${TARGET_ABI} -BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${LIBREELEC_VERSION} -if [ "${LIBREELEC_VERSION}" = "devel" ] ; then - BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${OS_VERSION}-${LIBREELEC_VERSION} +BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${DISTRO_VERSION} +if [ "${DISTRO_VERSION}" = "devel" ] ; then + BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${OS_VERSION}-${DISTRO_VERSION} fi if [ -n "$BUILD_SUFFIX" ]; then diff --git a/distributions/LEIoT/LEIoT.png b/distributions/LEIoT/LEIoT.png new file mode 100644 index 0000000000..5f2bfec244 Binary files /dev/null and b/distributions/LEIoT/LEIoT.png differ diff --git a/distributions/LEIoT/LEIoT_40x40.png b/distributions/LEIoT/LEIoT_40x40.png new file mode 100644 index 0000000000..8b6ca86271 Binary files /dev/null and b/distributions/LEIoT/LEIoT_40x40.png differ diff --git a/distributions/LEIoT/kernel_options b/distributions/LEIoT/kernel_options new file mode 120000 index 0000000000..1c8f75ccda --- /dev/null +++ b/distributions/LEIoT/kernel_options @@ -0,0 +1 @@ +distributions/LibreELEC/kernel_options \ No newline at end of file diff --git a/distributions/LEIoT/options b/distributions/LEIoT/options new file mode 100644 index 0000000000..8221c23829 --- /dev/null +++ b/distributions/LEIoT/options @@ -0,0 +1,272 @@ +### DISTRO INFORMATION ### + +# Distro name (full name, without special characters) + DISTRONAME="LEIoT" + +# Short distro description + DESCRIPTION="LibreELEC for IoT (LEIoT) is a simple appliance OS for containers." + +# Distribution Source location + DISTRO_MIRROR="https://src.leiot.org/mirror" + DISTRO_SRC="https://src.leiot.org/$DISTRO_VERSION" + +# Distribution Home URL + DISTRO_HOME_URL="https://leiot.org" + +# Welcome Message for SSH Server (up to 5 Lines) + GREETING0="##############################################" + GREETING1="# LEIoT #" + GREETING2="# https://leiot.org #" + GREETING3="##############################################" + GREETING4="" + +# Root password to integrate in the target system + ROOT_PASSWORD="libreelec" + +# Partition labels for USB/SD installation media + DISTRO_BOOTLABEL="LEIOT" + DISTRO_DISKLABEL="STORAGE" + + +### BUILDSYSTEM SETTINGS #### + +# LTO (Link Time Optimization) support + LTO_SUPPORT="yes" + +# GOLD (Google Linker) support + GOLD_SUPPORT="yes" + +# MOLD (Modern Linker) support + MOLD_SUPPORT="no" + +# default linker (bfd / gold / mold) + DEFAULT_LINKER="gold" + +# HARDENING (security relevant linker and compiler flags) support + HARDENING_SUPPORT="no" + +# Default supported get handlers (archive, git, file etc.) + GET_HANDLER_SUPPORT="archive" + +# use local ccache on build host, if available, for early package +# builds before ccache has been built + LOCAL_CCACHE_SUPPORT="yes" + +### OS CONFIGURATION ### + +# Install glibc locales to the build (yes / no) + GLIBC_LOCALES="yes" + +# Install arm-mem package on ARM32 (yes / no) + if [ "${TARGET_ARCH}" = "arm" ]; then + ARM_MEM_SUPPORT="yes" + else + ARM_MEM_SUPPORT="no" + fi + +# additional drivers to install: +# for a list of additional drivers see packages/linux-drivers +# Space separated list is supported, +# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" + ADDITIONAL_DRIVERS="" + +# Default size of system partition, in MB, eg. 512 + SYSTEM_SIZE=1024 + +# Default system partition offset, in sectors, eg. 2048 + SYSTEM_PART_START=8192 + +# Size of storage partition, in MB. Must be >=32 + STORAGE_SIZE=32 + +# build with swap support (yes / no) + SWAP_SUPPORT="yes" + +# swap support enabled per default (yes / no) + SWAP_ENABLED_DEFAULT="yes" + +# swapfile size if SWAP_SUPPORT=yes in MB + SWAPFILESIZE="2048" + +# debug tty path + DEBUG_TTY="/dev/tty3" + +# local console login prompt (yes / no) + LOCAL_LOGIN="yes" + +# Enable SSH on boot (yes / no) + SSH_ENABLED_DEFAULT="yes" + +### KODI SETTINGS ### +# Mediacenter to use (kodi / no) + MEDIACENTER="no" + +# Skins to install (Estuary) +# Space separated list is supported, +# e.g. SKINS="Estuary" + SKINS="" + +# Default Skin (Estuary) + SKIN_DEFAULT="" + +# install extra subtitle Fonts for KODI (yes / no) + KODI_EXTRA_FONTS="no" + +# build and install PulseAudio support (yes / no) + PULSEAUDIO_SUPPORT="no" + +# build and install pipewire support (yes / no) + PIPEWIRE_SUPPORT="no" + +# build and install eSpeak-NG support (yes / no) + ESPEAK_SUPPORT="no" + +# build and install with BluRay support (yes / no) + KODI_BLURAY_SUPPORT="no" + +# build and install with BD+ support +# (BD+ decryption support in KODI) (yes / no) + BLURAY_BDPLUS_SUPPORT="no" + +# build and install with AACS support +# (BD decryption support in KODI) (yes / no) + BLURAY_AACS_SUPPORT="no" + +# build and install with DVDCSS support +# (DVD decryption support in KODI) (yes / no) + KODI_DVDCSS_SUPPORT="no" + +# build and install bluetooth support (yes / no) + BLUETOOTH_SUPPORT="no" + +# build and install with KODI webfrontend (yes / no) + KODI_WEBSERVER_SUPPORT="no" + +# build and install Avahi (Zeroconf) daemon (yes / no) + AVAHI_DAEMON="yes" + +# build with UPnP support (yes / no) + KODI_UPNP_SUPPORT="yes" + +# build with MySQL support (mariadb / none) + KODI_MYSQL_SUPPORT="mariadb" + +# build Kodi with optical drive support (yes / no) + KODI_OPTICAL_SUPPORT="yes" + +# build with AirPlay support (stream videos from iDevices to KODI) (yes / no) + KODI_AIRPLAY_SUPPORT="yes" + +# build with AirTunes support (stream music from iDevices to KODI) (yes / no) + KODI_AIRTUNES_SUPPORT="yes" + +# build with libnfs support (mounting nfs shares with KODI) (yes / no) + KODI_NFS_SUPPORT="yes" + +# build with Samba Client support (mounting SAMBA shares with KODI) (yes / no) + KODI_SAMBA_SUPPORT="yes" + +# build kodi with alsa support (yes/no) + KODI_ALSA_SUPPORT="yes" + +# build kodi with pulseaudio support (yes/no) + KODI_PULSEAUDIO_SUPPORT="yes" + +# build kodi with pipewire support (yes/no) + KODI_PIPEWIRE_SUPPORT="no" + +### KODI ADDONS ### + +# Addon Server Url + ADDON_SERVER_URL="https://addons.libreelec.tv" + +# set the default addon project + ADDON_PROJECT="${DEVICE:-$PROJECT}" + +# Settings package name - blank if not required + DISTRO_PKG_SETTINGS="" + DISTRO_PKG_SETTINGS_ID="" + + +### ADDITIONAL PROGRAMS / FUNCTIONS ### + +# Testpackages for development (yes / no) + TESTING="no" + +# Configure debug groups (space delimited key=value pairs, with each value comma-delimited) and default group when DEBUG=yes +# Use ! or - prefix to prevent a dependent package from being built with debug. Add + suffix to build dependenencies with debug. + DEBUG_GROUPS="" + DEBUG_GROUP_YES="" + +# build and install iSCSI support - iscsistart (yes / no) + ISCSI_SUPPORT="no" + +# build with NFS support (mounting nfs shares via the OS) (yes / no) + NFS_SUPPORT="no" + +# build with Samba Client support (mounting samba shares via the OS) (yes / no) + SAMBA_SUPPORT="no" + +# build and install Samba Server (yes / no) + SAMBA_SERVER="no" + +# build and install SFTP Server (yes / no) + SFTP_SERVER="yes" + +# build and install OpenVPN support (yes / no) + OPENVPN_SUPPORT="yes" + +# build and install WireGuard support (yes / no) + WIREGUARD_SUPPORT="yes" + +# build and install diskmounter support (udevil) +# this service provide auto mounting support for external drives in the +# mediacenter also automount internally drives at boottime via udev (yes / no) + UDEVIL="yes" + +# Support for partitioning and formatting disks in initramfs (yes / no) +# This adds support for parted and mkfs.ext3/4 to initramfs for OEM usage + INITRAMFS_PARTED_SUPPORT="no" + +# build and install nano text editor (yes / no) + NANO_EDITOR="yes" + +# cron support (yes / no) + CRON_SUPPORT="yes" + +# build with installer (yes / no) + INSTALLER_SUPPORT="yes" + +# build and install remote support (yes / no) + REMOTE_SUPPORT="no" + +# IR remote keymaps supported in default config + IR_REMOTE_KEYMAPS="rc6_mce xbox_360 xbox_one" + +# build and install Joystick support (yes / no) + JOYSTICK_SUPPORT="no" + +# build and install CEC adapter support (yes / no) + CEC_SUPPORT="no" + +# build and install CEC framework support (yes / no) + CEC_FRAMEWORK_SUPPORT="no" + +# OEM packages for OEM's (yes / no) + OEM_SUPPORT="no" + +# build and install ALSA Audio support (yes / no) + ALSA_SUPPORT="no" + +# additional packages to install: +# Space separated list is supported, +# e.g. ADDITIONAL_PACKAGES="PACKAGE1 PACKAGE2" + ADDITIONAL_PACKAGES="avahi curl docker htop Python3" + +# build and install driver addons (yes / no) + DRIVER_ADDONS_SUPPORT="no" + +# driver addons to install: +# for a list of additional drivers see packages/linux-driver-addons +# Space separated list is supported, + DRIVER_ADDONS="" diff --git a/distributions/LEIoT/show_config b/distributions/LEIoT/show_config new file mode 100644 index 0000000000..d187eb59ab --- /dev/null +++ b/distributions/LEIoT/show_config @@ -0,0 +1,3 @@ +show_distro_config() { + : no-op +} diff --git a/distributions/LEIoT/splash/splash-1080.png b/distributions/LEIoT/splash/splash-1080.png new file mode 100644 index 0000000000..3325fbf147 Binary files /dev/null and b/distributions/LEIoT/splash/splash-1080.png differ diff --git a/distributions/LEIoT/splash/splash-1200.png b/distributions/LEIoT/splash/splash-1200.png new file mode 100644 index 0000000000..0f1eba7698 Binary files /dev/null and b/distributions/LEIoT/splash/splash-1200.png differ diff --git a/distributions/LEIoT/splash/splash-2160.png b/distributions/LEIoT/splash/splash-2160.png new file mode 100644 index 0000000000..aa189f1eec Binary files /dev/null and b/distributions/LEIoT/splash/splash-2160.png differ diff --git a/distributions/LEIoT/splash/splash-720.png b/distributions/LEIoT/splash/splash-720.png new file mode 100644 index 0000000000..579a1e49a3 Binary files /dev/null and b/distributions/LEIoT/splash/splash-720.png differ diff --git a/distributions/LEIoT/splash/splash-768.png b/distributions/LEIoT/splash/splash-768.png new file mode 100644 index 0000000000..03cfe66b48 Binary files /dev/null and b/distributions/LEIoT/splash/splash-768.png differ diff --git a/distributions/LEIoT/version b/distributions/LEIoT/version new file mode 100644 index 0000000000..a506766d91 --- /dev/null +++ b/distributions/LEIoT/version @@ -0,0 +1,5 @@ +# VERSION: set full version, use "devel" for development version + DISTRO_VERSION="devel" + +# OS_VERSION: OS Version + OS_VERSION="13.0" diff --git a/distributions/LibreELEC/options b/distributions/LibreELEC/options index 0b93737c0f..f01cbd74d3 100644 --- a/distributions/LibreELEC/options +++ b/distributions/LibreELEC/options @@ -1,15 +1,19 @@ ### DISTRO INFORMATION ### -# Name of the Distro to build (full name, without special characters) +# Distro name (full name, without special characters) DISTRONAME="LibreELEC" -# short project description +# Short distro description DESCRIPTION="LibreELEC is a fast and user-friendly Kodi Entertainment Center distribution." +# Distribution Source location + DISTRO_MIRROR="https://sources.libreelec.tv/mirror" + DISTRO_SRC="https://sources.libreelec.tv/$DISTRO_VERSION" -### USER INTERFACE SETTINGS ### +# Distribution Home URL + DISTRO_HOME_URL="https://libreelec.tv" -# Welcome Message for e.g. SSH Server (up to 5 Lines) +# Welcome Message for SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# LibreELEC #" GREETING2="# https://libreelec.tv #" @@ -90,6 +94,9 @@ # local console login prompt (yes / no) LOCAL_LOGIN="no" +# Enable SSH on boot (yes / no) + SSH_ENABLED_DEFAULT="no" + ### KODI SETTINGS ### # Mediacenter to use (kodi / no) MEDIACENTER="kodi" @@ -170,10 +177,6 @@ ### KODI ADDONS ### -# Distribution Specific source location - DISTRO_MIRROR="http://sources.libreelec.tv/mirror" - DISTRO_SRC="http://sources.libreelec.tv/$LIBREELEC_VERSION" - # Addon Server Url ADDON_SERVER_URL="https://addons.libreelec.tv" @@ -259,3 +262,11 @@ # Space separated list is supported, # e.g. ADDITIONAL_PACKAGES="PACKAGE1 PACKAGE2" ADDITIONAL_PACKAGES="" + +# build and install driver addons (yes / no) + DRIVER_ADDONS_SUPPORT="no" + +# driver addons to install: +# for a list of additional drivers see packages/linux-driver-addons +# Space separated list is supported, + DRIVER_ADDONS="crazycat digital_devices dvb-latest" diff --git a/distributions/LibreELEC/version b/distributions/LibreELEC/version index 1efd036ffa..80b4c1ce36 100644 --- a/distributions/LibreELEC/version +++ b/distributions/LibreELEC/version @@ -1,5 +1,5 @@ # VERSION: set full version, use "devel" for development version - LIBREELEC_VERSION="devel" + DISTRO_VERSION="devel" # OS_VERSION: OS Version OS_VERSION="13.0" diff --git a/packages/addons/addon-depends/docker/docker-compose/package.mk b/packages/addons/addon-depends/docker/docker-compose/package.mk new file mode 100644 index 0000000000..7447c15e60 --- /dev/null +++ b/packages/addons/addon-depends/docker/docker-compose/package.mk @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2025-present Team LibreELEC (https://libreelec.tv) + +PKG_NAME="docker-compose" +PKG_VERSION="2.35.1" +PKG_LICENSE="Apache-2.0" +PKG_SITE="https://github.com/docker/compose" +PKG_LONGDESC="Define and run multi-container applications with Docker." +PKG_TOOLCHAIN="manual" + +case ${ARCH} in + x86_64) + PKG_URL="${PKG_SITE}/releases/download/v${PKG_VERSION}/docker-compose-linux-x86_64" + PKG_SHA256="7bdb2ce2916e5dd0354e5d129892bf96fdcdb1a9ab8eed69b9173e131db4c230" + ;; + aarch64) + PKG_URL="${PKG_SITE}/releases/download/v${PKG_VERSION}/docker-compose-linux-aarch64" + PKG_SHA256="a91e930a076b91e6c69f11d1dbe3c06729ae765fb9dbb3f97cb808e784647399" + ;; + arm) + PKG_URL="${PKG_SITE}/releases/download/v${PKG_VERSION}/docker-compose-linux-armv7" + PKG_SHA256="50aba1c8fe1eb8efefede3dab9e6c2226ba756a5ffa5cf4f4f5baadaee9a7455" + ;; +esac + +PKG_SOURCE_NAME="docker-compose-linux-${ARCH}-${PKG_VERSION}" + +unpack() { + mkdir -p ${PKG_BUILD} + cp -P ${SOURCES}/${PKG_NAME}/${PKG_SOURCE_NAME} ${PKG_BUILD}/docker-compose + chmod +x ${PKG_BUILD}/docker-compose +} diff --git a/packages/addons/service/docker/config/docker.conf b/packages/addons/service/docker/config/docker.conf new file mode 100644 index 0000000000..acc6e63df4 --- /dev/null +++ b/packages/addons/service/docker/config/docker.conf @@ -0,0 +1,2 @@ +DOCKER_DAEMON_OPTS="--data-root=/storage/docker" +DOCKER_STORAGE_OPTS="--storage-driver=overlay2" diff --git a/packages/addons/service/docker/lib/dockermon.py b/packages/addons/service/docker/lib/dockermon.py new file mode 100755 index 0000000000..2a973bc355 --- /dev/null +++ b/packages/addons/service/docker/lib/dockermon.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python +"""docker monitor using docker /events HTTP streaming API""" +"""https://github.com/CyberInt/dockermon""" + +from contextlib import closing +from functools import partial +from socket import socket, AF_UNIX, timeout +from subprocess import Popen, PIPE +from sys import stdout, version_info +import json +import shlex + +if version_info[:2] < (3, 0): + from httplib import OK as HTTP_OK + from urlparse import urlparse +else: + from http.client import OK as HTTP_OK + from urllib.parse import urlparse + +__version__ = '0.2.2' +# buffer size must be 256 or lower otherwise events won't show in realtime +bufsize = 256 +default_sock_url = 'ipc:///var/run/docker.sock' + + +class DockermonError(Exception): + pass + + +def read_http_header(sock): + """Read HTTP header from socket, return header and rest of data.""" + buf = [] + hdr_end = '\r\n\r\n' + + while True: + buf.append(sock.recv(bufsize).decode('utf-8')) + data = ''.join(buf) + i = data.find(hdr_end) + if i == -1: + continue + return data[:i], data[i + len(hdr_end):] + + +def header_status(header): + """Parse HTTP status line, return status (int) and reason.""" + status_line = header[:header.find('\r')] + # 'HTTP/1.1 200 OK' -> (200, 'OK') + fields = status_line.split(None, 2) + return int(fields[1]), fields[2] + + +def connect(url): + """Connect to UNIX or TCP socket. + + url can be either tcp://:port or ipc:// + """ + url = urlparse(url) + if url.scheme == 'tcp': + sock = socket() + netloc = tuple(url.netloc.rsplit(':', 1)) + hostname = socket.gethostname() + elif url.scheme == 'ipc': + sock = socket(AF_UNIX) + netloc = url.path + hostname = 'localhost' + else: + raise ValueError('unknown socket type: %s' % url.scheme) + + sock.connect(netloc) + return sock, hostname + + +def watch(callback, url=default_sock_url, run=None): + """Watch docker events. Will call callback with each new event (dict). + + url can be either tcp://:port or ipc:// + """ + sock, hostname = connect(url) + if run: + sock.settimeout(1.5) + request = 'GET /events HTTP/1.1\nHost: %s\n\n' % hostname + request = request.encode('utf-8') + + with closing(sock): + sock.sendall(request) + header, payload = read_http_header(sock) + status, reason = header_status(header) + if status != HTTP_OK: + raise DockermonError('bad HTTP status: %s %s' % (status, reason)) + + # Messages are \r\n\r\n + buf = [payload] + while True: + try: + chunk = sock.recv(bufsize) + except timeout: + if run(): + continue + if run and not run(): + raise DockermonError('stopped') + if not chunk: + raise EOFError('socket closed') + buf.append(chunk.decode('utf-8')) + data = ''.join(buf) + i = data.find('\r\n') + if i == -1: + continue + + size = int(data[:i], 16) + start = i + 2 # Skip initial \r\n + + if len(data) < start + size + 2: + continue + payload = data[start:start+size] + callback(json.loads(payload)) + buf = [data[start+size+2:]] # Skip \r\n suffix + + +def print_callback(msg): + """Print callback, prints message to stdout as JSON in one line.""" + json.dump(msg, stdout) + stdout.write('\n') + stdout.flush() + + +def prog_callback(prog, msg): + """Program callback, calls prog with message in stdin""" + pipe = Popen(prog, stdin=PIPE) + data = json.dumps(msg) + pipe.stdin.write(data.encode('utf-8')) + pipe.stdin.close() + + +if __name__ == '__main__': + from argparse import ArgumentParser + + parser = ArgumentParser(description=__doc__) + parser.add_argument('--prog', default=None, + help='program to call (e.g. "jq --unbuffered .")') + parser.add_argument( + '--socket-url', default=default_sock_url, + help='socket url (ipc:///path/to/sock or tcp:///host:port)') + parser.add_argument( + '--version', help='print version and exit', + action='store_true', default=False) + args = parser.parse_args() + + if args.version: + print('dockermon %s' % __version__) + raise SystemExit + + if args.prog: + prog = shlex.split(args.prog) + callback = partial(prog_callback, prog) + else: + callback = print_callback + + try: + watch(callback, args.socket_url) + except (KeyboardInterrupt, EOFError): + pass diff --git a/packages/addons/service/docker/package.mk b/packages/addons/service/docker/package.mk index a7e056349b..a1166a48e5 100644 --- a/packages/addons/service/docker/package.mk +++ b/packages/addons/service/docker/package.mk @@ -6,7 +6,7 @@ PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="ASL" PKG_SITE="http://www.docker.com/" -PKG_DEPENDS_TARGET="cli containerd ctop moby runc tini" +PKG_DEPENDS_TARGET="cli containerd ctop docker-compose moby runc tini" PKG_SECTION="service/system" PKG_SHORTDESC="Docker is an open-source engine that automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere." PKG_LONGDESC="Docker containers can encapsulate any payload, and will run consistently on and between virtually any server. The same container that a developer builds and tests on a laptop will run at scale, in production*, on VMs, bare-metal servers, OpenStack clusters, public instances, or combinations of the above." @@ -43,3 +43,40 @@ addon() { post_install_addon() { sed -e "s/@DISTRO_PKG_SETTINGS_ID@/${DISTRO_PKG_SETTINGS_ID}/g" -i "${INSTALL}/default.py" } + +post_makeinstall_target() { + mkdir -p ${INSTALL}/etc + # docker.conf + cp -P ${PKG_DIR}/config/docker.conf ${INSTALL}/etc + + mkdir -p ${INSTALL}/usr/bin + # dockermon.py + cp -P ${PKG_DIR}/lib/dockermon.py ${INSTALL}/usr/bin/dockermon + + # cli + cp -P $(get_build_dir cli)/bin/docker ${INSTALL}/usr/bin + + # moby + cp -P $(get_build_dir moby)/bin/dockerd ${INSTALL}/usr/bin + cp -P $(get_build_dir moby)/bin/docker-proxy ${INSTALL}/usr/bin/docker-proxy + + # containerd + cp -P $(get_build_dir containerd)/bin/containerd ${INSTALL}/usr/bin/containerd + cp -P $(get_build_dir containerd)/bin/containerd-shim-runc-v2 ${INSTALL}/usr/bin/containerd-shim-runc-v2 + + # ctop + cp -P $(get_build_dir ctop)/bin/ctop ${INSTALL}/usr/bin/ctop + + # docker-compose + cp -P $(get_build_dir docker-compose)/docker-compose ${INSTALL}/usr/bin/docker-compose + + # runc + cp -P $(get_build_dir runc)/bin/runc ${INSTALL}/usr/bin/runc + + # tini + cp -P $(get_build_dir tini)/.${TARGET_NAME}/tini-static ${INSTALL}/usr/bin/docker-init +} + +post_install() { + enable_service docker.service +} diff --git a/packages/addons/service/docker/system.d/docker.service b/packages/addons/service/docker/system.d/docker.service new file mode 100644 index 0000000000..61008ba6b7 --- /dev/null +++ b/packages/addons/service/docker/system.d/docker.service @@ -0,0 +1,23 @@ +[Unit] +Description=Docker Application Container Engine +Documentation=https://docs.docker.com +After=network.target + +[Service] +Type=notify +EnvironmentFile=-/etc/docker.conf +ExecStart=/usr/bin/dockerd --exec-opt native.cgroupdriver=systemd \ + --log-driver=journald \ + --group=root \ + $DOCKER_DAEMON_OPTS \ + $DOCKER_STORAGE_OPTS +ExecReload=/bin/kill -s HUP $MAINPID +TasksMax=8192 +LimitNOFILE=1048576 +LimitNPROC=1048576 +LimitCORE=infinity +TimeoutStartSec=0 +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target diff --git a/packages/addons/service/docker/tmpfiles.d/z_05_docker.conf b/packages/addons/service/docker/tmpfiles.d/z_05_docker.conf new file mode 100644 index 0000000000..b5c233efef --- /dev/null +++ b/packages/addons/service/docker/tmpfiles.d/z_05_docker.conf @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2025-present Team LibreELEC (https://libreelec.tv) + +d /storage/docker 0755 root root - - diff --git a/packages/addons/service/snapclient/source/bin/snapclient.start b/packages/addons/service/snapclient/source/bin/snapclient.start index f46d6f046d..4dc2b52f23 100644 --- a/packages/addons/service/snapclient/source/bin/snapclient.start +++ b/packages/addons/service/snapclient/source/bin/snapclient.start @@ -7,7 +7,7 @@ oe_setup_addon service.snapclient . /etc/os-release -case "$LIBREELEC_ARCH" in +case "$DISTRO_ARCH" in RPi*.arm) if [ "$sc_a" == "true" ]; then ALSA="/proc/asound/ALSA" diff --git a/packages/addons/tools/system-tools/source/default.py b/packages/addons/tools/system-tools/source/default.py index 4655d0c679..95c5d81108 100644 --- a/packages/addons/tools/system-tools/source/default.py +++ b/packages/addons/tools/system-tools/source/default.py @@ -13,7 +13,7 @@ vars = re.findall(r"^[a-zA-Z0-9_]+=.*$", contents, flags=re.MULTILINE) reader = csv.reader(vars, delimiter="=") osrelease = dict(reader) -if osrelease['LIBREELEC_ARCH'] == 'x11.x86_64' or osrelease['LIBREELEC_ARCH'] == 'Generic-legacy.x86_64': +if osrelease['DISTRO_ARCH'] == 'x11.x86_64' or osrelease['DISTRO_ARCH'] == 'Generic-legacy.x86_64': yes = xbmcgui.Dialog().yesno('System Tools', 'This is a console-only addon.[CR][CR]Open a terminal window?',nolabel='No',yeslabel='Yes') if yes: subprocess.Popen(["systemd-run","sh","-c",". /etc/profile;cd;exec st -e sh -l"], shell=False, close_fds=True) diff --git a/packages/devel/elfutils/package.mk b/packages/devel/elfutils/package.mk index 600655dd71..006150323e 100644 --- a/packages/devel/elfutils/package.mk +++ b/packages/devel/elfutils/package.mk @@ -14,7 +14,7 @@ PKG_LONGDESC="A collection of utilities to handle ELF objects." PKG_TOOLCHAIN="autotools" PKG_BUILD_FLAGS="+pic -cfg-libs -cfg-libs:host" -if [ "${LIBREELEC_VERSION}" = "devel" ]; then +if [ "${DISTRO_VERSION}" = "devel" ]; then PKG_PROGRAMS="--enable-programs --program-prefix=" PKG_PROGRAMS_LIST="readelf" else diff --git a/packages/mediacenter/kodi/scripts/pastekodi b/packages/mediacenter/kodi/scripts/pastekodi index 009c7b9c5c..963df98e0e 100755 --- a/packages/mediacenter/kodi/scripts/pastekodi +++ b/packages/mediacenter/kodi/scripts/pastekodi @@ -54,7 +54,7 @@ while getopts ":hc" opt; do done source /etc/os-release -SYSTEM_ARCH="${LIBREELEC_ARCH#*.}" +SYSTEM_ARCH="${DISTRO_ARCH#*.}" # If running in SAFE mode, send FAILED logs if [ "$(cat "/storage/.config/boot.status" 2>/dev/null)" = "SAFE" ]; then @@ -81,7 +81,7 @@ fi echo "Firmware Boot Mode: BIOS" fi fi - if [ "${LIBREELEC_PROJECT}" = "RPi" ]; then + if [ "${DISTRO_PROJECT}" = "RPi" ]; then echo "RPi Hardware Revision: $(vcgencmd otp_dump | grep 30: | cut -d: -f2)" echo "RPi $(vcgencmd get_throttled)" fi @@ -92,7 +92,7 @@ fi kmsprint | cat_data "kmsprint" - if [ "${LIBREELEC_PROJECT}" = "RPi" ]; then + if [ "${DISTRO_PROJECT}" = "RPi" ]; then vcgencmd bootloader_version | cat_data "Bootloader version" fi diff --git a/packages/network/openssh/package.mk b/packages/network/openssh/package.mk index a7f1c0b3ca..fe33245d2a 100644 --- a/packages/network/openssh/package.mk +++ b/packages/network/openssh/package.mk @@ -55,5 +55,8 @@ post_makeinstall_target() { } post_install() { + if [ "${SSH_ENABLED_DEFAULT}" = "yes" ]; then + sed -e "\|^Condition.*|d" -i ${INSTALL}/usr/lib/systemd/system/sshd.service + fi enable_service sshd.service } diff --git a/packages/sysutils/busybox/scripts/init b/packages/sysutils/busybox/scripts/init index 96ee59ff53..0ac85fcb54 100755 --- a/packages/sysutils/busybox/scripts/init +++ b/packages/sysutils/busybox/scripts/init @@ -261,7 +261,7 @@ mount_sysroot() { get_project_arch() { if [ -f ${1}/etc/os-release ]; then . ${1}/etc/os-release - echo "${LIBREELEC_ARCH}" + echo "${DISTRO_ARCH}" fi } diff --git a/packages/sysutils/busybox/system.d/ledfix.service b/packages/sysutils/busybox/system.d/ledfix.service index 5fbafbc56c..dade743d04 100644 --- a/packages/sysutils/busybox/system.d/ledfix.service +++ b/packages/sysutils/busybox/system.d/ledfix.service @@ -1,8 +1,6 @@ [Unit] Description=LEDfix Service -After=network-online.target graphical.target -Requires=graphical.target -Wants=kodi.target +After=network-online.target [Service] Type=oneshot @@ -11,4 +9,4 @@ RemainAfterExit=yes StartLimitInterval=0 [Install] -WantedBy=kodi.target +WantedBy=multi-user.target diff --git a/packages/sysutils/v4l-utils/package.mk b/packages/sysutils/v4l-utils/package.mk index bccda93218..2262816c29 100644 --- a/packages/sysutils/v4l-utils/package.mk +++ b/packages/sysutils/v4l-utils/package.mk @@ -35,7 +35,7 @@ create_multi_keymap() { post_makeinstall_target() { local f keymap - if [ ! "${LIBREELEC_VERSION}" == "devel" ]; then + if [ ! "${DISTRO_VERSION}" == "devel" ]; then rm ${INSTALL}/usr/bin/v4l2-compliance fi diff --git a/packages/tools/installer/scripts/installer b/packages/tools/installer/scripts/installer index 54164aa5ee..9967cbf89f 100755 --- a/packages/tools/installer/scripts/installer +++ b/packages/tools/installer/scripts/installer @@ -281,9 +281,9 @@ EOF cat << EOF > $TMPDIR/part1/EFI/BOOT/grub.cfg set timeout="0" -set default="LibreELEC" +set default="@DISTRONAME@" -menuentry "LibreELEC" { +menuentry "@DISTRONAME@" { search --set -f /KERNEL linux /KERNEL boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE quiet } diff --git a/projects/Amlogic/bootloader/mkimage b/projects/Amlogic/bootloader/mkimage index 282600bd55..2bb4437a23 100644 --- a/projects/Amlogic/bootloader/mkimage +++ b/projects/Amlogic/bootloader/mkimage @@ -25,35 +25,35 @@ mkimage_bootini(){ mkimage_uEnv(){ echo "image: creating uEnv.ini" -cat << EOF > "${LE_TMP}/uEnv.ini" +cat << EOF > "${IMG_TMP}/uEnv.ini" dtb_name=/amlogic/${DTB} bootargs=boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE} EOF - mcopy -s "${LE_TMP}/uEnv.ini" :: + mcopy -s "${IMG_TMP}/uEnv.ini" :: } mkimage_extlinux(){ echo "image: copying exlinux.conf" - mkdir -p "${LE_TMP}/extlinux" - cat << EOF > "${LE_TMP}/extlinux/extlinux.conf" + mkdir -p "${IMG_TMP}/extlinux" + cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf" LABEL ${DISTRO} LINUX /${KERNEL_NAME} FDT /amlogic/${DTB} APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} quiet ${EXTRA_CMDLINE} EOF - mcopy -s -o "${LE_TMP}/extlinux" :: + mcopy -s -o "${IMG_TMP}/extlinux" :: } mkimage_extlinux_fdtdir(){ echo "image: copying exlinux.conf" - mkdir -p "${LE_TMP}/extlinux" - cat << EOF > "${LE_TMP}/extlinux/extlinux.conf" + mkdir -p "${IMG_TMP}/extlinux" + cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf" LABEL ${DISTRO} LINUX /${KERNEL_NAME} FDTDIR / APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} quiet ${EXTRA_CMDLINE} EOF - mcopy -s -o "${LE_TMP}/extlinux" :: + mcopy -s -o "${IMG_TMP}/extlinux" :: } mkimage_dtb(){ diff --git a/projects/Amlogic/options b/projects/Amlogic/options index 3cd89e6d95..d95b36116a 100644 --- a/projects/Amlogic/options +++ b/projects/Amlogic/options @@ -66,14 +66,6 @@ # e.g. ADDITIONAL_DRIVERS+=" DRIVER1 DRIVER2" ADDITIONAL_DRIVERS+="" - # build and install driver addons (yes / no) - DRIVER_ADDONS_SUPPORT="no" - - # driver addons to install: - # for a list of additional drivers see packages/linux-driver-addons - # Space separated list is supported, - DRIVER_ADDONS="crazycat dvb-latest" - # additional packages to install: ADDITIONAL_PACKAGES+=" dtc ethmactool emmctool flashrom pciutils" diff --git a/projects/Generic/config/ovf.template b/projects/Generic/config/ovf.template index 7184beb6cf..35fa502d73 100644 --- a/projects/Generic/config/ovf.template +++ b/projects/Generic/config/ovf.template @@ -19,14 +19,14 @@ xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemS @DISTRO@ Meta-information about the installed software - LibreELEC - LibreELEC - https://libreelec.tv - https://libreelec.tv + @DISTRO@ + @DISTRO@ + @DISTRO_HOME_URL@ + @DISTRO_HOME_URL@ A human-readable annotation - LibreELEC is ‘Just enough OS’ for Kodi, a Linux distribution built to run Kodi on current and popular mediacentre hardware. After importing the OVA image adjust CPU, RAM, and HDD storage to the required configuration before first boot. + After importing the OVA image, adjust CPU, RAM, and HDD storage to the required configuration before first boot. The kind of installed guest operating system @@ -35,7 +35,7 @@ xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemS Virtual Hardware Family 0 - LibreELEC + @DISTRO@ vmx-12 diff --git a/projects/Generic/options b/projects/Generic/options index d23531047e..0b2da2ef49 100644 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -62,14 +62,6 @@ # e.g. ADDITIONAL_DRIVERS+=" DRIVER1 DRIVER2" ADDITIONAL_DRIVERS+="" - # build and install driver addons (yes / no) - DRIVER_ADDONS_SUPPORT="no" - - # driver addons to install: - # for a list of additional drivers see packages/linux-driver-addons - # Space separated list is supported, - DRIVER_ADDONS="crazycat digital_devices dvb-latest" - # Default size of the ova image, in MB, eg. 4096 OVA_SIZE="4096" diff --git a/projects/NXP/devices/iMX6/bootloader/mkimage b/projects/NXP/devices/iMX6/bootloader/mkimage index 1cdf3ca848..d497ed3e41 100644 --- a/projects/NXP/devices/iMX6/bootloader/mkimage +++ b/projects/NXP/devices/iMX6/bootloader/mkimage @@ -16,11 +16,11 @@ mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader"/imx6d*${UBOOT_SYSTEM}*.dtb :: mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader"/imx6q*${UBOOT_SYSTEM}*.dtb :: echo "image: copying exlinux.conf" -mkdir -p "${LE_TMP}/extlinux" -cat << EOF > "${LE_TMP}/extlinux/extlinux.conf" +mkdir -p "${IMG_TMP}/extlinux" +cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf" LABEL ${DISTRO} LINUX /${KERNEL_NAME} FDTDIR / APPEND boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE} EOF -mcopy -s -o "${LE_TMP}/extlinux" :: +mcopy -s -o "${IMG_TMP}/extlinux" :: diff --git a/projects/NXP/options b/projects/NXP/options index 38758016fb..05820bf8e6 100644 --- a/projects/NXP/options +++ b/projects/NXP/options @@ -52,14 +52,6 @@ # KODI Player implementation to use (default / bcm2835-driver / libfslvpuwrap) KODIPLAYER_DRIVER="mesa" - # build and install driver addons (yes / no) - DRIVER_ADDONS_SUPPORT="no" - - # driver addons to install: - # for a list of additional drivers see packages/linux-driver-addons - # Space separated list is supported, - DRIVER_ADDONS="crazycat dvb-latest" - # additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware) # Space separated list is supported, # e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware" diff --git a/projects/Qualcomm/devices/Dragonboard/options b/projects/Qualcomm/devices/Dragonboard/options index f7dda9d0a8..dd56d1faba 100644 --- a/projects/Qualcomm/devices/Dragonboard/options +++ b/projects/Qualcomm/devices/Dragonboard/options @@ -85,14 +85,6 @@ # e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware" FIRMWARE="misc-firmware wlan-firmware dvb-firmware firmware-dragonboard" - # build and install driver addons (yes / no) - DRIVER_ADDONS_SUPPORT="no" - - # driver addons to install: - # for a list of additional drivers see packages/linux-driver-addons - # Space separated list is supported, - DRIVER_ADDONS="crazycat dvb-latest" - # build with installer (yes / no) INSTALLER_SUPPORT="no" diff --git a/projects/RPi/options b/projects/RPi/options index dbba3f22fd..8552dfa420 100644 --- a/projects/RPi/options +++ b/projects/RPi/options @@ -80,14 +80,6 @@ ADDITIONAL_DRIVERS+=" rpi-cirrus-config" fi - # build and install driver addons (yes / no) - DRIVER_ADDONS_SUPPORT="no" - - # driver addons to install: - # for a list of additional drivers see packages/linux-driver-addons - # Space separated list is supported, - DRIVER_ADDONS="crazycat dvb-latest" - # additional packages to install: ADDITIONAL_PACKAGES+=" bcm2835-utils dtc" diff --git a/projects/Rockchip/options b/projects/Rockchip/options index 83d79af254..0ddd428fea 100644 --- a/projects/Rockchip/options +++ b/projects/Rockchip/options @@ -73,13 +73,5 @@ # Start boot partition at 16MiB, same as https://github.com/rockchip-linux/build images SYSTEM_PART_START=32768 - # build and install driver addons (yes / no) - DRIVER_ADDONS_SUPPORT="no" - - # driver addons to install: - # for a list of additinoal drivers see packages/linux-driver-addons - # Space separated list is supported, - DRIVER_ADDONS="dvb-latest" - # debug tty path DEBUG_TTY="/dev/ttyS2" diff --git a/projects/Samsung/bootloader/mkimage b/projects/Samsung/bootloader/mkimage index f5af45ab15..0e16dee79f 100644 --- a/projects/Samsung/bootloader/mkimage +++ b/projects/Samsung/bootloader/mkimage @@ -14,14 +14,14 @@ mkimage_uboot(){ mkimage_extlinux(){ echo "image: copying exlinux.conf" - mkdir -p "${LE_TMP}/extlinux" - cat << EOF > "${LE_TMP}/extlinux/extlinux.conf" + mkdir -p "${IMG_TMP}/extlinux" + cat << EOF > "${IMG_TMP}/extlinux/extlinux.conf" LABEL ${DISTRO} LINUX /${KERNEL_NAME} FDT /${DTB} APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE} EOF - mcopy -s -o "${LE_TMP}/extlinux" :: + mcopy -s -o "${IMG_TMP}/extlinux" :: } mkimage_dtb(){ diff --git a/projects/Samsung/options b/projects/Samsung/options index 2fb31ebbdd..5928b2d023 100644 --- a/projects/Samsung/options +++ b/projects/Samsung/options @@ -73,14 +73,6 @@ # e.g. ADDITIONAL_DRIVERS+=" DRIVER1 DRIVER2" ADDITIONAL_DRIVERS+="" - # build and install driver addons (yes / no) - DRIVER_ADDONS_SUPPORT="no" - - # driver addons to install: - # for a list of additional drivers see packages/linux-driver-addons - # Space separated list is supported, - DRIVER_ADDONS="crazycat dvb-latest" - # use the kernel CEC framework for libcec (yes / no) CEC_FRAMEWORK_SUPPORT="yes" diff --git a/scripts/image b/scripts/image index a4caaf0ee6..66fe6f5183 100755 --- a/scripts/image +++ b/scripts/image @@ -38,6 +38,7 @@ function do_mkimage() { PROJECT="${PROJECT}" \ DEVICE="${DEVICE}" \ DISTRO="${DISTRO}" \ + DISTRO_HOME_URL="${DISTRO_HOME_URL}" \ TARGET_IMG="${TARGET_IMG}" \ BUILD_NAME="${IMAGE_NAME}" \ IMAGE_NAME="${1:-${IMAGE_NAME}}" \ @@ -64,24 +65,24 @@ else GIT_HASH=$(git rev-parse HEAD) fi -if [ "${LIBREELEC_VERSION}" = "devel" ]; then +if [ "${DISTRO_VERSION}" = "devel" ]; then GIT_ABBREV=${GIT_HASH:0:7} - DEVEL_VERSION=${LIBREELEC_VERSION} + DEVEL_VERSION=${DISTRO_VERSION} case "${BUILD_PERIODIC}" in nightly) - LIBREELEC_VERSION=nightly-$(date +%Y%m%d)-${GIT_ABBREV} + DISTRO_VERSION=nightly-$(date +%Y%m%d)-${GIT_ABBREV} ;; daily) - LIBREELEC_VERSION=daily-$(date +%Y%j)-${GIT_ABBREV} + DISTRO_VERSION=daily-$(date +%Y%j)-${GIT_ABBREV} ;; weekly) - LIBREELEC_VERSION=weekly-$(date +%G%V)-${GIT_ABBREV} + DISTRO_VERSION=weekly-$(date +%G%V)-${GIT_ABBREV} ;; monthly) - LIBREELEC_VERSION=monthly-$(date +%Y%m)-${GIT_ABBREV} + DISTRO_VERSION=monthly-$(date +%Y%m)-${GIT_ABBREV} ;; *) - LIBREELEC_VERSION=devel-$(date +%Y%m%d%H%M%S)-${GIT_ABBREV} + DISTRO_VERSION=devel-$(date +%Y%m%d%H%M%S)-${GIT_ABBREV} ;; esac fi @@ -91,27 +92,27 @@ ORIGIN_URL="$(git remote -v | awk '$1 == "origin" { print $2 }' | head -1 | sed [ "${BUILDER_NAME,,}" = "official" ] && BUILDER_NAME= if [ "${OFFICIAL}" = "yes" ]; then - LIBREELEC_BUILD="official" + DISTRO_BUILD="official" else if [ -n "${BUILDER_NAME}" ]; then - LIBREELEC_BUILD="${BUILDER_NAME}" + DISTRO_BUILD="${BUILDER_NAME}" else - LIBREELEC_BUILD="community" + DISTRO_BUILD="community" fi fi if [ -n "${CUSTOM_VERSION}" ]; then - LIBREELEC_VERSION="${CUSTOM_VERSION}" + DISTRO_VERSION="${CUSTOM_VERSION}" fi -LIBREELEC_ARCH="${DEVICE:-${PROJECT}}.${TARGET_ARCH}" -TARGET_VERSION="${LIBREELEC_ARCH}-${LIBREELEC_VERSION}" +DISTRO_ARCH="${DEVICE:-${PROJECT}}.${TARGET_ARCH}" +TARGET_VERSION="${DISTRO_ARCH}-${DISTRO_VERSION}" if [ -n "${CUSTOM_IMAGE_NAME}" ]; then IMAGE_NAME="${CUSTOM_IMAGE_NAME}" else if [ "${DEVEL_VERSION}" = "devel" ]; then - IMAGE_NAME="${DISTRONAME}-${LIBREELEC_ARCH}-${OS_VERSION}-${LIBREELEC_VERSION}" + IMAGE_NAME="${DISTRONAME}-${DISTRO_ARCH}-${OS_VERSION}-${DISTRO_VERSION}" else IMAGE_NAME="${DISTRONAME}-${TARGET_VERSION}" fi @@ -139,7 +140,7 @@ rm -rf ${INSTALL} rm -rf ${STAMPS_INSTALL} mkdir -p ${INSTALL} -# Create base layout of LibreELEC read-only file system +# Create base layout of read-only file system for directory in etc dev proc run sys tmp usr var flash storage; do mkdir -p ${INSTALL}/${directory} done @@ -166,18 +167,18 @@ echo "${TARGET_VERSION}" >${INSTALL}/etc/release # Create /etc/os-release cat <${INSTALL}/etc/os-release NAME="${DISTRONAME}" -VERSION="${LIBREELEC_VERSION}" +VERSION="${DISTRO_VERSION}" ID="${DISTRONAME,,}" VERSION_ID="${OS_VERSION}" -PRETTY_NAME="${DISTRONAME} (${LIBREELEC_BUILD}): ${LIBREELEC_VERSION}" -HOME_URL="https://libreelec.tv" +PRETTY_NAME="${DISTRONAME} (${DISTRO_BUILD}): ${DISTRO_VERSION}" +HOME_URL="${DISTRO_HOME_URL}" BUG_REPORT_URL="${ORIGIN_URL}" BUILD_ID="${GIT_HASH}" -LIBREELEC_ARCH="${LIBREELEC_ARCH}" -LIBREELEC_BUILD="${LIBREELEC_BUILD}" -LIBREELEC_PROJECT="${PROJECT}" +DISTRO_ARCH="${DISTRO_ARCH}" +DISTRO_BUILD="${DISTRO_BUILD}" +DISTRO_PROJECT="${PROJECT}" EOF -[ -n "${DEVICE}" ] && echo "LIBREELEC_DEVICE=\"${DEVICE}\"" >>${INSTALL}/etc/os-release +[ -n "${DEVICE}" ] && echo "DISTRO_DEVICE=\"${DEVICE}\"" >>${INSTALL}/etc/os-release [ -n "${BUILDER_NAME}" ] && echo "BUILDER_NAME=\"${BUILDER_NAME}\"" >>${INSTALL}/etc/os-release [ -n "${BUILDER_VERSION}" ] && echo "BUILDER_VERSION=\"${BUILDER_VERSION}\"" >>${INSTALL}/etc/os-release @@ -188,7 +189,7 @@ ${GREETING1} ${GREETING2} ${GREETING3} ${GREETING4} -${DISTRONAME} (${LIBREELEC_BUILD}): ${LIBREELEC_VERSION} (${LIBREELEC_ARCH}) +${DISTRONAME} (${DISTRO_BUILD}): ${DISTRO_VERSION} (${DISTRO_ARCH}) EOF ln -sf /etc/issue ${INSTALL}/etc/motd @@ -374,7 +375,7 @@ if [ "${1}" = "release" -o "${1}" = "mkimage" -o "${1}" = "noobs" ]; then RELEASE_DIR="${TARGET_IMG}/${IMAGE_NAME}-${1}" - # eg. LibreELEC_RPi, LibreELEC_RPi2 etc. + # eg. Distro_RPi, Distro_RPi2 etc. NOOBS_DISTRO="${DISTRONAME}_${DEVICE:-${PROJECT}}" # Create release dir @@ -406,7 +407,7 @@ if [ "${1}" = "release" -o "${1}" = "mkimage" -o "${1}" = "noobs" ]; then sed -e "s%@DISTRONAME@%${DISTRONAME}%g" \ -e "s%@PROJECT@%${DEVICE:-${PROJECT}}%g" \ - -e "s%@LIBREELEC_VERSION@%${LIBREELEC_VERSION}%g" \ + -e "s%@DISTRO_VERSION@%${DISTRO_VERSION}%g" \ -e "s%@RELEASE_DATE@%$(date +%F)%g" \ -e "s%@KERNEL_VERSION@%$(kernel_version)%g" \ -e "s%@DESCRIPTION@%${DESCRIPTION}%g" \ diff --git a/scripts/mkimage b/scripts/mkimage index c29761ea4a..1823ed3667 100755 --- a/scripts/mkimage +++ b/scripts/mkimage @@ -10,8 +10,8 @@ ################################################################################ # set variables -LE_TMP=$(mktemp -d -p ${TARGET_IMG}) -SAVE_ERROR="${LE_TMP}/save_error" +IMG_TMP=$(mktemp -d -p ${TARGET_IMG}) +SAVE_ERROR="${IMG_TMP}/save_error" if [ -z "${SYSTEM_SIZE}" -o -z "${SYSTEM_PART_START}" ]; then echo "mkimage: SYSTEM_SIZE and SYSTEM_PART_START must be configured!" @@ -27,7 +27,7 @@ DISK="${DISK_BASENAME}.img" # functions cleanup() { echo -e "image: cleanup...\n" - rm -rf "${LE_TMP}" + rm -rf "${IMG_TMP}" } show_error() { @@ -36,7 +36,7 @@ show_error() { if [ -s "${SAVE_ERROR}" ]; then cat "${SAVE_ERROR}" else - echo "Folder ${LE_TMP} might be out of free space..." + echo "Folder ${IMG_TMP} might be out of free space..." fi echo cleanup @@ -88,26 +88,26 @@ fi echo "image: creating sparse file for part2..." STORAGE_PART_COUNT=$((${STORAGE_PART_END} - ${STORAGE_PART_START} + 1)) sync -dd if="${DISK}" of="${LE_TMP}/part2.ext4" bs=512 count=0 seek="${STORAGE_PART_COUNT}" conv=fsync >"${SAVE_ERROR}" 2>&1 || show_error +dd if="${DISK}" of="${IMG_TMP}/part2.ext4" bs=512 count=0 seek="${STORAGE_PART_COUNT}" conv=fsync >"${SAVE_ERROR}" 2>&1 || show_error # create filesystem on part2 echo "image: creating filesystem on part2..." -mke2fs -F -q -t ext4 -O ^orphan_file -m 0 "${LE_TMP}/part2.ext4" -tune2fs -L "${DISTRO_DISKLABEL}" -U ${UUID_STORAGE} "${LE_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error -e2fsck -n "${LE_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error +mke2fs -F -q -t ext4 -O ^orphan_file -m 0 "${IMG_TMP}/part2.ext4" +tune2fs -L "${DISTRO_DISKLABEL}" -U ${UUID_STORAGE} "${IMG_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error +e2fsck -n "${IMG_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error sync # add resize mark -mkdir "${LE_TMP}/part2.fs" -touch "${LE_TMP}/part2.fs/.please_resize_me" +mkdir "${IMG_TMP}/part2.fs" +touch "${IMG_TMP}/part2.fs/.please_resize_me" echo "image: populating filesystem on part2..." -populatefs -U -d "${LE_TMP}/part2.fs" "${LE_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error +populatefs -U -d "${IMG_TMP}/part2.fs" "${IMG_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error sync -e2fsck -n "${LE_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error +e2fsck -n "${IMG_TMP}/part2.ext4" >"${SAVE_ERROR}" 2>&1 || show_error # merge part2 into disk image echo "image: merging part2 into disk image..." -dd if="${LE_TMP}/part2.ext4" of="${DISK}" bs=512 seek="${STORAGE_PART_START}" conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error +dd if="${IMG_TMP}/part2.ext4" of="${DISK}" bs=512 seek="${STORAGE_PART_START}" conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error # create disk image for virtual appliance if [ "${PROJECT}" = "Generic" ]; then @@ -120,24 +120,24 @@ fi echo "image: creating sparse file for part1..." SYSTEM_PART_COUNT=$((${SYSTEM_PART_END} - ${SYSTEM_PART_START} + 1)) sync -dd if=/dev/zero of="${LE_TMP}/part1.fat" bs=512 count=0 seek="${SYSTEM_PART_COUNT}" conv=fsync >"${SAVE_ERROR}" 2>&1 || show_error +dd if=/dev/zero of="${IMG_TMP}/part1.fat" bs=512 count=0 seek="${SYSTEM_PART_COUNT}" conv=fsync >"${SAVE_ERROR}" 2>&1 || show_error shopt -s expand_aliases # enables alias expansion in script -alias mcopy='mcopy -i "${LE_TMP}/part1.fat" -o' -alias mmd='mmd -i "${LE_TMP}/part1.fat"' +alias mcopy='mcopy -i "${IMG_TMP}/part1.fat" -o' +alias mmd='mmd -i "${IMG_TMP}/part1.fat"' # create filesystem on part1 echo "image: creating filesystem on part1..." if [ "${BOOTLOADER}" = "syslinux" -o "${BOOTLOADER}" = "bcm2835-bootloader" -o "${BOOTLOADER}" = "u-boot" ]; then - mformat -i "${LE_TMP}/part1.fat" -v "${DISTRO_BOOTLABEL}" -N "${UUID_SYSTEM//-/}" :: >"${SAVE_ERROR}" 2>&1 || show_error + mformat -i "${IMG_TMP}/part1.fat" -v "${DISTRO_BOOTLABEL}" -N "${UUID_SYSTEM//-/}" :: >"${SAVE_ERROR}" 2>&1 || show_error fi sync if [ "${BOOTLOADER}" = "syslinux" ]; then # create bootloader configuration echo "image: creating bootloader configuration..." - cat <"${LE_TMP}/syslinux.cfg" + cat <"${IMG_TMP}/syslinux.cfg" SAY Wait for installer mode to start automatically in 5 seconds... SAY SAY Options @@ -163,7 +163,7 @@ LABEL run APPEND boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} portable quiet EOF - cat <"${LE_TMP}/grub.cfg" + cat <"${IMG_TMP}/grub.cfg" set timeout="25" set default="Installer" menuentry "Installer" { @@ -180,11 +180,11 @@ menuentry "Run" { } EOF - mcopy "${LE_TMP}/syslinux.cfg" :: >"${SAVE_ERROR}" 2>&1 || show_error + mcopy "${IMG_TMP}/syslinux.cfg" :: >"${SAVE_ERROR}" 2>&1 || show_error # install syslinux echo "image: installing syslinux to part1..." - syslinux.mtools -i "${LE_TMP}/part1.fat" >"${SAVE_ERROR}" 2>&1 || show_error + syslinux.mtools -i "${IMG_TMP}/part1.fat" >"${SAVE_ERROR}" 2>&1 || show_error # copy files echo "image: copying files to part1..." @@ -197,16 +197,16 @@ EOF mcopy "${TOOLCHAIN}/share/syslinux/bootx64.efi" ::/EFI/BOOT >"${SAVE_ERROR}" 2>&1 || show_error mcopy "${TOOLCHAIN}/share/syslinux/ldlinux.e64" ::/EFI/BOOT >"${SAVE_ERROR}" 2>&1 || show_error mcopy "${TOOLCHAIN}/share/grub/bootia32.efi" ::/EFI/BOOT >"${SAVE_ERROR}" 2>&1 || show_error - mcopy "${LE_TMP}/grub.cfg" ::/EFI/BOOT >"${SAVE_ERROR}" 2>&1 || show_error + mcopy "${IMG_TMP}/grub.cfg" ::/EFI/BOOT >"${SAVE_ERROR}" 2>&1 || show_error elif [ "${BOOTLOADER}" = "bcm2835-bootloader" ]; then # create bootloader configuration echo "image: creating bootloader configuration..." - cat <"${LE_TMP}/cmdline.txt" + cat <"${IMG_TMP}/cmdline.txt" boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE} EOF - mcopy "${LE_TMP}/cmdline.txt" :: >"${SAVE_ERROR}" 2>&1 || show_error + mcopy "${IMG_TMP}/cmdline.txt" :: >"${SAVE_ERROR}" 2>&1 || show_error # copy files echo "image: copying files to part1..." @@ -253,16 +253,16 @@ elif [ "${BOOTLOADER}" = "u-boot" -a -n "${UBOOT_SYSTEM}" ]; then mcopy -s "${RELEASE_DIR}/3rdparty/bootloader/overlays" :: >"${SAVE_ERROR}" 2>&1 || show_error fi - mkdir -p "${LE_TMP}/extlinux" + mkdir -p "${IMG_TMP}/extlinux" - cat <"${LE_TMP}/extlinux/extlinux.conf" + cat <"${IMG_TMP}/extlinux/extlinux.conf" LABEL ${DISTRO} LINUX /${KERNEL_NAME} FDT /${DTB} APPEND boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE} EOF - mcopy -s "${LE_TMP}/extlinux" :: >"${SAVE_ERROR}" 2>&1 || show_error + mcopy -s "${IMG_TMP}/extlinux" :: >"${SAVE_ERROR}" 2>&1 || show_error fi if [ -f "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/bootloader/mkimage" ]; then @@ -288,32 +288,34 @@ fi # bootloader # run fsck echo "image: checking filesystem on part1..." sync -fsck.fat -n "${LE_TMP}/part1.fat" >"${SAVE_ERROR}" 2>&1 || show_error +fsck.fat -n "${IMG_TMP}/part1.fat" >"${SAVE_ERROR}" 2>&1 || show_error # merge part1 into disk image echo "image: merging part1 into disk image..." -dd if="${LE_TMP}/part1.fat" of="${DISK}" bs=512 seek="${SYSTEM_PART_START}" conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error +dd if="${IMG_TMP}/part1.fat" of="${DISK}" bs=512 seek="${SYSTEM_PART_START}" conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error # finalize virtual appliance if [ "${PROJECT}" = "Generic" ]; then # change syslinux default to 'run' echo "image: modifying files on part1 for open virtual appliance..." - sed -e "/DEFAULT/ s/installer/run/" -i "${LE_TMP}/syslinux.cfg" - sed -e "/set default=/s/\"Installer\"/\"Run\"/" -i "${LE_TMP}/grub.cfg" - mcopy "${LE_TMP}/syslinux.cfg" :: >"${SAVE_ERROR}" 2>&1 || show_error - mcopy "${LE_TMP}/grub.cfg" ::/EFI/BOOT >"${SAVE_ERROR}" 2>&1 || show_error + sed -e "/DEFAULT/ s/installer/run/" -i "${IMG_TMP}/syslinux.cfg" + sed -e "/set default=/s/\"Installer\"/\"Run\"/" -i "${IMG_TMP}/grub.cfg" + mcopy "${IMG_TMP}/syslinux.cfg" :: >"${SAVE_ERROR}" 2>&1 || show_error + mcopy "${IMG_TMP}/grub.cfg" ::/EFI/BOOT >"${SAVE_ERROR}" 2>&1 || show_error sync # run fsck echo "image: checking filesystem on part1..." - fsck.fat -n "${LE_TMP}/part1.fat" >"${SAVE_ERROR}" 2>&1 || show_error + fsck.fat -n "${IMG_TMP}/part1.fat" >"${SAVE_ERROR}" 2>&1 || show_error # merge modified part1 into tmp disk image echo "image: merging part1 into open virtual appliance..." - dd if="${LE_TMP}/part1.fat" of="${DISK_BASENAME}.tmp" bs=512 seek="${SYSTEM_PART_START}" conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error + dd if="${IMG_TMP}/part1.fat" of="${DISK_BASENAME}.tmp" bs=512 seek="${SYSTEM_PART_START}" conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error # create vmdk from tmp ${DISK} echo "image: creating vmdk for open virtual appliance..." qemu-img convert -O vmdk -o subformat=streamOptimized "${DISK_BASENAME}.tmp" "${DISK_BASENAME}.vmdk" # generate ovf from template - sed -e "s,@DISTRO@,${DISTRO},g" -e "s,@DISK@,${IMAGE_NAME},g" \ + sed -e "s,@DISTRO@,${DISTRO},g" \ + -e "s,@DISTRO_HOME_URL@,${DISTRO_HOME_URL},g" \ + -e "s,@DISK@,${IMAGE_NAME},g" \ -e "s,@OVA_SIZE@,$((${OVA_SIZE} * 1024 * 1024)),g" \ "${PROJECT_DIR}/${PROJECT}/config/ovf.template" >"${DISK_BASENAME}.ovf" # combine ovf and vmdk into official ova diff --git a/tools/distro-tool b/tools/distro-tool index 00441bc0bd..b2164717bf 100755 --- a/tools/distro-tool +++ b/tools/distro-tool @@ -9,7 +9,7 @@ export NOONEXIT=yes [ -z "${DEBUG_LOG}" ] && DEBUG_LOG=/tmp/distro-tool.log -LIBREELEC_DIR=$HOME/LibreELEC.tv +DISTRO_DIR=$HOME/LibreELEC.tv TARGET_DIR=$HOME/sources DOWNLOAD_DIR=$HOME/download REVISION= @@ -737,15 +737,15 @@ Options: EOF } -get_libreelec_branch() { - cd $LIBREELEC_DIR +get_distro_branch() { + cd $DISTRO_DIR git rev-parse --abbrev-ref HEAD } -# 1: LibreELEC variable, eg. LIBREELEC_VERSION -get_libreelec_option() { +# 1: LibreELEC variable, eg. DISTRO_VERSION +get_distro_option() { local variable="$1" - cd $LIBREELEC_DIR + cd $DISTRO_DIR source config/options "" echo "${!variable}" } @@ -827,7 +827,7 @@ generate_work_worker() { : } - cd $LIBREELEC_DIR + cd $DISTRO_DIR source config/options "" @@ -845,8 +845,8 @@ generate_work_worker() { fi PKG_IS_ADDON=No - [[ ${PKG_DIR/${LIBREELEC_DIR}/} =~ ^/packages/addons/.* ]] && PKG_IS_ADDON=Yes - [[ ${PKG_DIR/${LIBREELEC_DIR}/} =~ ^/packages/mediacenter/kodi-binary-addons/.* ]] && PKG_IS_ADDON=Yes + [[ ${PKG_DIR/${DISTRO_DIR}/} =~ ^/packages/addons/.* ]] && PKG_IS_ADDON=Yes + [[ ${PKG_DIR/${DISTRO_DIR}/} =~ ^/packages/mediacenter/kodi-binary-addons/.* ]] && PKG_IS_ADDON=Yes echo " {" >>${workfile_o} for var in ${wanted_vars}; do @@ -883,7 +883,7 @@ get_packages() { local anchor="@?+?@" ( - cd $LIBREELEC_DIR + cd $DISTRO_DIR # Generate package caches... source config/options "" @@ -945,7 +945,7 @@ while [ : ]; do ;; -l | --libreelec) shift - LIBREELEC_DIR=$1 + DISTRO_DIR=$1 ;; -t | --target) shift @@ -1031,33 +1031,33 @@ done if [ ${DOGIT} = yes ]; then ( - if [ -d ${LIBREELEC_DIR}/.git ]; then - cd ${LIBREELEC_DIR} + if [ -d ${DISTRO_DIR}/.git ]; then + cd ${DISTRO_DIR} git pull else - mkdir -p $(dirname "${LIBREELEC_DIR}") 2>/dev/null - cd $(dirname "${LIBREELEC_DIR}") - git clone https://github.com/LibreELEC/LibreELEC.tv.git $(basename "${LIBREELEC_DIR}") + mkdir -p $(dirname "${DISTRO_DIR}") 2>/dev/null + cd $(dirname "${DISTRO_DIR}") + git clone https://github.com/LibreELEC/LibreELEC.tv.git $(basename "${DISTRO_DIR}") fi ) fi -check_exists LIBREELEC_DIR || exit -LIBREELEC_DIR="$(get_abs_path "${LIBREELEC_DIR}")" +check_exists DISTRO_DIR || exit +DISTRO_DIR="$(get_abs_path "${DISTRO_DIR}")" -DISTRO_SOURCE="$(get_libreelec_option DISTRO_SRC)" -DISTRO_MIRROR="$(get_libreelec_option DISTRO_MIRROR)" -LIBREELEC_VER="$(get_libreelec_option LIBREELEC_VERSION)" +DISTRO_SOURCE="$(get_distro_option DISTRO_SRC)" +DISTRO_MIRROR="$(get_distro_option DISTRO_MIRROR)" +DISTRO_VER="$(get_distro_option DISTRO_VERSION)" if [ ${IS_MIRROR} = no ]; then - TARGET_DIR="$(get_abs_path "${TARGET_DIR}/${LIBREELEC_VER}")" + TARGET_DIR="$(get_abs_path "${TARGET_DIR}/${DISTRO_VER}")" else TARGET_DIR="$(get_abs_path "${TARGET_DIR}/mirror")" fi check_exists TARGET_DIR || exit if [ ${IS_MIRROR} = no ]; then - DOWNLOAD_DIR="$(get_abs_path "${DOWNLOAD_DIR}/${LIBREELEC_VER}")" + DOWNLOAD_DIR="$(get_abs_path "${DOWNLOAD_DIR}/${DISTRO_VER}")" else DOWNLOAD_DIR="$(get_abs_path "${DOWNLOAD_DIR}/mirror")" fi @@ -1070,9 +1070,9 @@ fi echo if [ ${IS_MIRROR} = yes ]; then - echo "Synchronising LibreELEC.tv (branch: $(get_libreelec_branch), version: ${LIBREELEC_VER}) with MIRROR server ${TARGET_DIR}" + echo "Synchronising (branch: $(get_distro_branch), version: ${DISTRO_VER}) with MIRROR server ${TARGET_DIR}" else - echo "Synchronising LibreELEC.tv (branch: $(get_libreelec_branch), version: ${LIBREELEC_VER}) with SOURCE server ${TARGET_DIR}" + echo "Synchronising (branch: $(get_distro_branch), version: ${DISTRO_VER}) with SOURCE server ${TARGET_DIR}" fi echo echo "Distro Source is: ${DISTRO_SOURCE}"