mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 22:26:42 +00:00
busybox: add initial rdate support
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
3781244cd9
commit
80fc3215ab
@ -557,7 +557,7 @@ CONFIG_FEATURE_USE_TERMIOS=y
|
|||||||
# CONFIG_FEATURE_MOUNT_FLAGS is not set
|
# CONFIG_FEATURE_MOUNT_FLAGS is not set
|
||||||
# CONFIG_FEATURE_MOUNT_FSTAB is not set
|
# CONFIG_FEATURE_MOUNT_FSTAB is not set
|
||||||
# CONFIG_PIVOT_ROOT is not set
|
# CONFIG_PIVOT_ROOT is not set
|
||||||
# CONFIG_RDATE is not set
|
CONFIG_RDATE=y
|
||||||
# CONFIG_RDEV is not set
|
# CONFIG_RDEV is not set
|
||||||
# CONFIG_READPROFILE is not set
|
# CONFIG_READPROFILE is not set
|
||||||
# CONFIG_RTCWAKE is not set
|
# CONFIG_RTCWAKE is not set
|
||||||
|
2
packages/sysutils/busybox/config/time.conf
Normal file
2
packages/sysutils/busybox/config/time.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Timeserver
|
||||||
|
TIMEHOST="pool.net.org"
|
31
packages/sysutils/busybox/init.d/44_rdate
Executable file
31
packages/sysutils/busybox/init.d/44_rdate
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Copyright (C) 2009-2010 OpenELEC.tv
|
||||||
|
# http://www.openelec.tv
|
||||||
|
#
|
||||||
|
# This Program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This Program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# run rdate update system time
|
||||||
|
#
|
||||||
|
# runlevels: openelec, textmode
|
||||||
|
|
||||||
|
. /etc/profile
|
||||||
|
|
||||||
|
progress "Syncronizing time"
|
||||||
|
timesync &
|
@ -18,6 +18,9 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`"
|
|||||||
mkdir -p $INSTALL/bin
|
mkdir -p $INSTALL/bin
|
||||||
cp $PKG_DIR/scripts/lsb-release $INSTALL/bin/
|
cp $PKG_DIR/scripts/lsb-release $INSTALL/bin/
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/usr/bin
|
||||||
|
cp $PKG_DIR/scripts/timesync $INSTALL/usr/bin/
|
||||||
|
|
||||||
mkdir -p $INSTALL/sbin
|
mkdir -p $INSTALL/sbin
|
||||||
cp $PKG_DIR/scripts/init $INSTALL/sbin/
|
cp $PKG_DIR/scripts/init $INSTALL/sbin/
|
||||||
|
|
||||||
@ -50,3 +53,11 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`"
|
|||||||
|
|
||||||
mkdir -p $INSTALL/etc/modprobe.d
|
mkdir -p $INSTALL/etc/modprobe.d
|
||||||
cp $PKG_DIR/modprobe.d/* $INSTALL/etc/modprobe.d
|
cp $PKG_DIR/modprobe.d/* $INSTALL/etc/modprobe.d
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/etc/crontabs
|
||||||
|
echo -e "* 21 * * *\t/usr/bin/timesync" >> $INSTALL/etc/crontabs/root
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/usr/config
|
||||||
|
cp $PKG_DIR/config/time.conf $INSTALL/usr/config
|
||||||
|
|
||||||
|
|
||||||
|
31
packages/sysutils/busybox/scripts/timesync
Executable file
31
packages/sysutils/busybox/scripts/timesync
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Copyright (C) 2009-2010 OpenELEC.tv
|
||||||
|
# http://www.openelec.tv
|
||||||
|
#
|
||||||
|
# This Program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This Program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
. /etc/profile
|
||||||
|
|
||||||
|
[ -f $HOME/.config/time.conf ] && . $HOME/.config/time.conf
|
||||||
|
|
||||||
|
if [ -n "$TIMEHOST" ]; then
|
||||||
|
wait_for_network # wait for networking
|
||||||
|
usleep 500000
|
||||||
|
rdate "$TIMEHOST" &
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user