supernaut
02-26-2006, 12:35 PM
Here is a compile of openntp (http://www.openntpd.org/) (3.7p1) for mips TiVo. Openntp is a daemon that can be used to sync your TiVo's time to other time servers. It can also act as a time server itself. The manual is here (http://www.openntpd.org/manual.html).
You can set up openntp on your TiVo as follows:
1. transfer openntp.zip to your TiVo and expand to /var/hack.
2. mkdir -p /tivo-bin/ntp
3. chmod 755 ntpd
4. mv ntpd /tivo-bin/.
5. mv ntpd.conf /tivo-bin/ntp/.
6. add "ntp:x:50:50:ntp:/var/tmp/ntp:/tivo-bin/false" (no quotes) to /etc/passwd.
7. add "ntp:x:50:" to /etc/group
8. echo -e '#!/bin/sh\nexit 1' > /tivo-bin/false
9. chmod 755 /tivo-bin/false
10. mkdir -p /var/tmp/ntp
11. Take a look at /tivo-bin/ntp/ntpd.conf:
# $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $
# sample ntpd configuration file, see ntpd.conf(5)
# Addresses to listen on (ntpd does not listen by default)
#listen on *
#listen on 127.0.0.1
#listen on ::1
# sync to a single server
#server ntp.example.org
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
# use a random selection of 8 public stratum 2 servers
# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
#servers north-america.pool.ntp.org
In this configuration, ntpd will sync with three random ntp servers localized to North America. It is NOT listening for sync requests. See the manual for other configurations.
12. start the daemon using "/tivo-bin/ntpd -s -d -f /tivo-bin/ntp/ntpd.conf" and check that it works.
13. if everything looks good, then you can launch it from rc.sysinit.author using:
#Start ntpd
[ ! -d /var/tmp/ntp ] && mkdir -p /var/tmp/ntp
/tivo-bin/ntpd -s -f /tivo-bin/ntp/ntpd.conf &
14. mv /bin/ntpdate /bin/ntpdate.orig
15. I have replaced /bin/ntpdate with this shell script (Note: touch is from busybox):
#!/bin/sh
#
(
/tivo-bin/touch /var/timestamp &&
/sbin/syslog -t ntpdate "TiVo call-in detected - touched timestamp"
)
exit 0
This just keeps "timestamp" in sync with each call in, and writes successes to /var/log/messages.
16. chmod 755 /bin/ntpdate
You can set up openntp on your TiVo as follows:
1. transfer openntp.zip to your TiVo and expand to /var/hack.
2. mkdir -p /tivo-bin/ntp
3. chmod 755 ntpd
4. mv ntpd /tivo-bin/.
5. mv ntpd.conf /tivo-bin/ntp/.
6. add "ntp:x:50:50:ntp:/var/tmp/ntp:/tivo-bin/false" (no quotes) to /etc/passwd.
7. add "ntp:x:50:" to /etc/group
8. echo -e '#!/bin/sh\nexit 1' > /tivo-bin/false
9. chmod 755 /tivo-bin/false
10. mkdir -p /var/tmp/ntp
11. Take a look at /tivo-bin/ntp/ntpd.conf:
# $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $
# sample ntpd configuration file, see ntpd.conf(5)
# Addresses to listen on (ntpd does not listen by default)
#listen on *
#listen on 127.0.0.1
#listen on ::1
# sync to a single server
#server ntp.example.org
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
# use a random selection of 8 public stratum 2 servers
# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
#servers north-america.pool.ntp.org
In this configuration, ntpd will sync with three random ntp servers localized to North America. It is NOT listening for sync requests. See the manual for other configurations.
12. start the daemon using "/tivo-bin/ntpd -s -d -f /tivo-bin/ntp/ntpd.conf" and check that it works.
13. if everything looks good, then you can launch it from rc.sysinit.author using:
#Start ntpd
[ ! -d /var/tmp/ntp ] && mkdir -p /var/tmp/ntp
/tivo-bin/ntpd -s -f /tivo-bin/ntp/ntpd.conf &
14. mv /bin/ntpdate /bin/ntpdate.orig
15. I have replaced /bin/ntpdate with this shell script (Note: touch is from busybox):
#!/bin/sh
#
(
/tivo-bin/touch /var/timestamp &&
/sbin/syslog -t ntpdate "TiVo call-in detected - touched timestamp"
)
exit 0
This just keeps "timestamp" in sync with each call in, and writes successes to /var/log/messages.
16. chmod 755 /bin/ntpdate