mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 14:16:40 +00:00
timezone-data: add systemd support
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
3727ab75ac
commit
6bc7e8dbac
@ -53,4 +53,12 @@ post_makeinstall_target() {
|
||||
|
||||
mkdir -p $INSTALL/etc
|
||||
ln -sf /var/run/localtime $INSTALL/etc/localtime
|
||||
|
||||
mkdir -p $INSTALL/usr/lib/openelec
|
||||
cp -PR $PKG_DIR/scripts/tzdata-setup $INSTALL/usr/lib/openelec
|
||||
}
|
||||
|
||||
post_install() {
|
||||
enable_service tz-data-monitor.path
|
||||
enable_service tz-data.service
|
||||
}
|
||||
|
22
packages/sysutils/timezone-data/init.d/03_timezone → packages/sysutils/timezone-data/scripts/tzdata-setup
Normal file → Executable file
22
packages/sysutils/timezone-data/init.d/03_timezone → packages/sysutils/timezone-data/scripts/tzdata-setup
Normal file → Executable file
@ -1,3 +1,4 @@
|
||||
#!/bin/sh
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
@ -18,17 +19,14 @@
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# make variable directory structure
|
||||
#
|
||||
# runlevels: openelec, textmode
|
||||
|
||||
progress "setting timezone"
|
||||
GUISETTINGS="/storage/.xbmc/userdata/guisettings.xml"
|
||||
if [ -f "$GUISETTINGS" ] ; then
|
||||
TIMEZONE=`sed -n -e 's/.*<timezone>\(.*\)<\/timezone>.*/\1/p' /storage/.xbmc/userdata/guisettings.xml`
|
||||
fi
|
||||
|
||||
if [ ! "$TIMEZONE" == "" -a -f "/usr/share/zoneinfo/$TIMEZONE" ] ; then
|
||||
ln -sf "/usr/share/zoneinfo/$TIMEZONE" /var/run/localtime
|
||||
fi
|
||||
GUISETTINGS="/storage/.xbmc/userdata/guisettings.xml"
|
||||
|
||||
if [ -f "$GUISETTINGS" ] ; then
|
||||
TIMEZONE=`sed -n -e 's/.*<timezone>\(.*\)<\/timezone>.*/\1/p' /storage/.xbmc/userdata/guisettings.xml`
|
||||
fi
|
||||
|
||||
if [ ! "$TIMEZONE" == "" -a -f "/usr/share/zoneinfo/$TIMEZONE" ] ; then
|
||||
ln -sf "/usr/share/zoneinfo/$TIMEZONE" /var/run/localtime
|
||||
fi
|
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Timezone data monitor
|
||||
After=local-fs.target
|
||||
|
||||
[Path]
|
||||
PathModified=/storage/.xbmc/userdata/guisettings.xml
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Timezone data monitor
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/systemctl restart tz-data.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
13
packages/sysutils/timezone-data/system.d/tz-data.service
Normal file
13
packages/sysutils/timezone-data/system.d/tz-data.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Setup Timezone data
|
||||
Before=xbmc.service
|
||||
|
||||
ConditionPathExists=/storage/.xbmc/userdata/guisettings.xml
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/lib/openelec/tzdata-setup
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=xbmc.service
|
Loading…
x
Reference in New Issue
Block a user