mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
systemd: add /etc/environment and service
This commit is contained in:
parent
bbd9f5ca16
commit
af5bf90616
@ -205,6 +205,7 @@ post_makeinstall_target() {
|
|||||||
cp $PKG_DIR/scripts/systemd-machine-id-setup $INSTALL/usr/bin
|
cp $PKG_DIR/scripts/systemd-machine-id-setup $INSTALL/usr/bin
|
||||||
cp $PKG_DIR/scripts/userconfig-setup $INSTALL/usr/bin
|
cp $PKG_DIR/scripts/userconfig-setup $INSTALL/usr/bin
|
||||||
cp $PKG_DIR/scripts/usercache-setup $INSTALL/usr/bin
|
cp $PKG_DIR/scripts/usercache-setup $INSTALL/usr/bin
|
||||||
|
cp $PKG_DIR/scripts/environment-setup $INSTALL/usr/bin
|
||||||
|
|
||||||
# use systemd to set cpufreq governor and tunables
|
# use systemd to set cpufreq governor and tunables
|
||||||
find_file_path scripts/cpufreq && cp -PRv $FOUND_PATH $INSTALL/usr/bin
|
find_file_path scripts/cpufreq && cp -PRv $FOUND_PATH $INSTALL/usr/bin
|
||||||
@ -217,6 +218,7 @@ post_makeinstall_target() {
|
|||||||
# /etc/resolv.conf and /etc/hosts must be writable
|
# /etc/resolv.conf and /etc/hosts must be writable
|
||||||
ln -sf /run/libreelec/resolv.conf $INSTALL/etc/resolv.conf
|
ln -sf /run/libreelec/resolv.conf $INSTALL/etc/resolv.conf
|
||||||
ln -sf /run/libreelec/hosts $INSTALL/etc/hosts
|
ln -sf /run/libreelec/hosts $INSTALL/etc/hosts
|
||||||
|
ln -sf /run/libreelec/environment $INSTALL/etc/environment
|
||||||
|
|
||||||
# provide 'halt', 'shutdown', 'reboot' & co.
|
# provide 'halt', 'shutdown', 'reboot' & co.
|
||||||
ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/halt
|
ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/halt
|
||||||
@ -276,6 +278,7 @@ post_install() {
|
|||||||
enable_service debugconfig.service
|
enable_service debugconfig.service
|
||||||
enable_service userconfig.service
|
enable_service userconfig.service
|
||||||
enable_service usercache.service
|
enable_service usercache.service
|
||||||
|
enable_service envconfig.service
|
||||||
enable_service kernel-overlays.service
|
enable_service kernel-overlays.service
|
||||||
enable_service hwdb.service
|
enable_service hwdb.service
|
||||||
enable_service cpufreq.service
|
enable_service cpufreq.service
|
||||||
|
16
packages/sysutils/systemd/scripts/environment-setup
Executable file
16
packages/sysutils/systemd/scripts/environment-setup
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
|
# read config files
|
||||||
|
for config in /etc/profile.d/*; do
|
||||||
|
if [ -f "$config" ] ; then
|
||||||
|
. $config
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# generate system-wide environment file
|
||||||
|
cat <<EOF >/run/libreelec/environment
|
||||||
|
PATH=${PATH}
|
||||||
|
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
|
||||||
|
EOF
|
12
packages/sysutils/systemd/system.d/envconfig.service
Normal file
12
packages/sysutils/systemd/system.d/envconfig.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Generate system-wide /etc/environment file
|
||||||
|
DefaultDependencies=no
|
||||||
|
After=systemd-tmpfiles-setup.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/environment-setup
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sysinit.target
|
Loading…
x
Reference in New Issue
Block a user