Just to complete this thread I played a little how to include addon in the image. Zip file is saved to image and unpacked to /storage on first boot. Just a quick idea not fully tested and investigated. I'm sure there are better solutions ![]()
packages/virtual/misc-packages/system.d/storage-addons-copy.service
Code
[Unit]
Description=Kodi storage addons copy script
Before=kodi.service
After=network-online.target graphical.target
[Service]
Type=oneshot
Environment=HOME=/storage
ExecStart=-/bin/sh -c ". /etc/profile; exec /bin/sh /usr/lib/libreelec/storage-addons-copy"
RemainAfterExit=yes
[Install]
WantedBy=kodi.service
Display More
packages/virtual/misc-packages/package.mk
Code
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="misc-packages"
PKG_VERSION=""
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"
PKG_URL=""
PKG_DEPENDS_TARGET="toolchain $ADDITIONAL_PACKAGES"
PKG_SECTION="virtual"
PKG_LONGDESC="misc-packages: Metapackage for miscellaneous packages"
pre_install() {
ADDON_OVERWRITE=yes ./scripts/create_addon system-tools
}
post_install() {
mkdir -p $INSTALL/usr/share/kodi/storage_addons
cp $ROOT/target/virtual.system-tools-9.0.111.zip $INSTALL/usr/share/kodi/storage_addons
mkdir -p $INSTALL/usr/lib/libreelec
cp -PR $PKG_DIR/scripts/* $INSTALL/usr/lib/libreelec
enable_service storage-addons-copy.service
# update addon manifest / enable addon in Kodi
ADDON_MANIFEST=$INSTALL/usr/share/kodi/system/addon-manifest.xml
xmlstarlet ed -L --subnode "/addons" -t elem -n "addon" -v "virtual.system-tools" $ADDON_MANIFEST
}
Display More
packages/virtual/misc-packages/scripts/storage-addons-copy
Bash
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
# how could we check if addon is enabled in Kodi ?
# if disabled don't unpack anymore
if [ ! -d /storage/.kodi/addons/virtual.system-tools ]; then
unzip -o -qq -d /storage/.kodi/addons \
/usr/share/kodi/storage_addons/virtual.system-tools-9.0.111.zip
fi
Display More