Browse Source

clockspeed: moved run scripts from sheba

0.2-maint
Alejandro Mery 13 years ago
parent
commit
93e75e3ff5
6 changed files with 145 additions and 0 deletions
  1. +21
    -0
      overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed-adjust_log_run.sh
  2. +36
    -0
      overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed-adjust_run.sh
  3. +20
    -0
      overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_finish.sh
  4. +21
    -0
      overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_log_run.sh
  5. +23
    -0
      overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_run.sh
  6. +24
    -0
      overlay.d/pkgs/clockspeed/D%sysconfdir_conf_clockspeed.txt

+ 21
- 0
overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed-adjust_log_run.sh

@ -0,0 +1,21 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: target/mnemosyne/overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed-adjust_log_run.sh
# Copyright (C) 2008 - 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# 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; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
LOGDIR=/var/log/clockspeed/adjust
mkdir -p "$LOGDIR"
[ -d "main/" ] || ln -s "$LOGDIR" main
exec svlogd -tt main/

+ 36
- 0
overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed-adjust_run.sh

@ -0,0 +1,36 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: target/mnemosyne/overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed-adjust_run.sh
# Copyright (C) 2008 - 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# 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; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
# based on http://www.thedjbway.org/clocksd/index.html
exec 2>&1
WAIT=$( expr 9 \* 3600 ) # first in 9 hours
WAIT_MAX=$( expr 7 \* 24 \* 3600 ) # at least once per week
# loop indefinitely
while true; do
echo "Waiting ${WAIT} seconds until next adjustment..."
sleep ${WAIT}
# obtain timing mark for calibrating clockspeed adjust:
clockctl mark
# log current "attoseconds":
clockctl atto
echo "==="
if [ $WAIT -lt $WAIT_MAX ]; then
WAIT=$( expr $WAIT \* 2 )
[ $WAIT -le $WAIT_MAX ] || WAIT=$WAIT_MAX
fi
done

+ 20
- 0
overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_finish.sh

@ -0,0 +1,20 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: target/mnemosyne/overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_finish.sh
# Copyright (C) 2008 - 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# 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; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
exec 2>&1
# save the current time on BIOS
echo "Saving current time in BIOS"
exec /sbin/hwclock -w -u

+ 21
- 0
overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_log_run.sh

@ -0,0 +1,21 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: target/mnemosyne/overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_log_run.sh
# Copyright (C) 2008 - 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# 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; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
LOGDIR=/var/log/clockspeed/clockspeed
mkdir -p "$LOGDIR"
[ -d "main/" ] || ln -s "$LOGDIR" main
exec svlogd -tt main/

+ 23
- 0
overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_run.sh

@ -0,0 +1,23 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: target/mnemosyne/overlay.d/pkgs/clockspeed/D%sysconfdir_clockspeed_clockspeed_run.sh
# Copyright (C) 2008 - 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# 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; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
exec 2>&1
if [ ! -e /var/state/clockspeed/adjust ]; then
D_bindir/clockctl sync || exit 1
fi
echo "Starting clockspeed"
exec D_bindir/clockspeed

+ 24
- 0
overlay.d/pkgs/clockspeed/D%sysconfdir_conf_clockspeed.txt

@ -0,0 +1,24 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: target/mnemosyne/overlay.d/pkgs/clockspeed/D%sysconfdir_conf_clockspeed.txt
# Copyright (C) 2008 - 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# 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; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
CLOCK_TYPE=ntp
CLOCK_SERVER=pool.ntp.org
if type dnsip > /dev/null 2>&1; then
CLOCK_IP=$(dnsip $CLOCK_SERVER | cut -d' ' -f1)
elif type gethostip > /dev/null 2>&1; then
CLOCK_IP=$(gethostip -d $CLOCK_SERVER)
else
CLOCK_IP=
fi

Loading…
Cancel
Save