diff options
Diffstat (limited to 'meta/recipes-support/ntp/files')
-rw-r--r-- | meta/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch | 17 | ||||
-rw-r--r-- | meta/recipes-support/ntp/files/ntp.conf | 14 | ||||
-rwxr-xr-x | meta/recipes-support/ntp/files/ntpd | 62 | ||||
-rwxr-xr-x | meta/recipes-support/ntp/files/ntpdate | 54 | ||||
-rw-r--r-- | meta/recipes-support/ntp/files/ntpdate.default | 7 | ||||
-rw-r--r-- | meta/recipes-support/ntp/files/openssl-check.patch | 59 | ||||
-rw-r--r-- | meta/recipes-support/ntp/files/tickadj.c.patch | 32 |
7 files changed, 245 insertions, 0 deletions
diff --git a/meta/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch b/meta/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch new file mode 100644 index 0000000000..cb1e2f7341 --- /dev/null +++ b/meta/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | --- a/include/ntp_syscall.h.orig 2009-05-19 16:44:55.048156467 -0400 | ||
2 | +++ b/include/ntp_syscall.h 2009-05-19 16:46:19.293323686 -0400 | ||
3 | @@ -14,6 +14,14 @@ | ||
4 | # include <sys/timex.h> | ||
5 | #endif | ||
6 | |||
7 | +#if defined(ADJ_NANO) && !defined(MOD_NANO) | ||
8 | +#define MOD_NANO ADJ_NANO | ||
9 | +#endif | ||
10 | + | ||
11 | +#if defined(ADJ_TAI) && !defined(MOD_TAI) | ||
12 | +#define MOD_TAI ADJ_TAI | ||
13 | +#endif | ||
14 | + | ||
15 | #ifndef NTP_SYSCALLS_LIBC | ||
16 | #ifdef NTP_SYSCALLS_STD | ||
17 | # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t)) | ||
diff --git a/meta/recipes-support/ntp/files/ntp.conf b/meta/recipes-support/ntp/files/ntp.conf new file mode 100644 index 0000000000..a9cc838450 --- /dev/null +++ b/meta/recipes-support/ntp/files/ntp.conf | |||
@@ -0,0 +1,14 @@ | |||
1 | # This is the most basic ntp configuration file | ||
2 | # The driftfile must remain in a place specific to this | ||
3 | # machine - it records the machine specific clock error | ||
4 | driftfile /etc/ntp.drift | ||
5 | # This obtains a random server which will be close | ||
6 | # (in IP terms) to the machine. Add other servers | ||
7 | # as required, or change this. | ||
8 | server time.server.example.com | ||
9 | # Using local hardware clock as fallback | ||
10 | # Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself | ||
11 | server 127.127.1.0 | ||
12 | fudge 127.127.1.0 stratum 14 | ||
13 | # Defining a default security setting | ||
14 | restrict default | ||
diff --git a/meta/recipes-support/ntp/files/ntpd b/meta/recipes-support/ntp/files/ntpd new file mode 100755 index 0000000000..ae50f135d0 --- /dev/null +++ b/meta/recipes-support/ntp/files/ntpd | |||
@@ -0,0 +1,62 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # ntpd init.d script for ntpdc from ntp.isc.org | ||
4 | test -x /usr/bin/ntpd -a -r /etc/ntp.conf || exit 0 | ||
5 | # rcS contains TICKADJ | ||
6 | test -r /etc/default/rcS && . /etc/default/rcS | ||
7 | |||
8 | # Functions to do individual actions | ||
9 | settick(){ | ||
10 | # If TICKADJ is set we *must* adjust it before we start, because the | ||
11 | # driftfile relies on the correct setting | ||
12 | test -n "$TICKADJ" -a -x /usr/bin/tickadj && { | ||
13 | echo -n "Setting tick to $TICKADJ: " | ||
14 | /usr/bin/tickadj "$TICKADJ" | ||
15 | echo "done" | ||
16 | } | ||
17 | } | ||
18 | startdaemon(){ | ||
19 | # The -g option allows ntpd to step the time to correct it just | ||
20 | # once. The daemon will exit if the clock drifts too much after | ||
21 | # this. If ntpd seems to disappear after a while assume TICKADJ | ||
22 | # above is set to a totally incorrect value. | ||
23 | echo -n "Starting ntpd: " | ||
24 | start-stop-daemon --start -x /usr/bin/ntpd -- -p /var/run/ntp.pid "$@" | ||
25 | echo "done" | ||
26 | } | ||
27 | stopdaemon(){ | ||
28 | echo -n "Stopping ntpd: " | ||
29 | start-stop-daemon --stop -p /var/run/ntp.pid | ||
30 | echo "done" | ||
31 | } | ||
32 | |||
33 | case "$1" in | ||
34 | start) | ||
35 | settick | ||
36 | startdaemon -g | ||
37 | ;; | ||
38 | stop) | ||
39 | stopdaemon | ||
40 | ;; | ||
41 | force-reload) | ||
42 | stopdaemon | ||
43 | settick | ||
44 | startdaemon -g | ||
45 | ;; | ||
46 | restart) | ||
47 | # Don't reset the tick here | ||
48 | stopdaemon | ||
49 | startdaemon -g | ||
50 | ;; | ||
51 | reload) | ||
52 | # Must do this by hand, but don't do -g | ||
53 | stopdaemon | ||
54 | startdaemon | ||
55 | ;; | ||
56 | *) | ||
57 | echo "Usage: ntpd { start | stop | restart | reload }" >&2 | ||
58 | exit 1 | ||
59 | ;; | ||
60 | esac | ||
61 | |||
62 | exit 0 | ||
diff --git a/meta/recipes-support/ntp/files/ntpdate b/meta/recipes-support/ntp/files/ntpdate new file mode 100755 index 0000000000..ab0551c5a5 --- /dev/null +++ b/meta/recipes-support/ntp/files/ntpdate | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PATH=/sbin:/bin:/usr/bin | ||
4 | |||
5 | test -x /usr/bin/ntpdate || exit 0 | ||
6 | |||
7 | if test -f /etc/default/ntpdate ; then | ||
8 | . /etc/default/ntpdate | ||
9 | fi | ||
10 | |||
11 | if [ "$NTPSERVERS" = "" ] ; then | ||
12 | if [ "$METHOD" = "" -a "$1" != "silent" ] ; then | ||
13 | echo "Please set NTPSERVERS in /etc/default/ntpdate" | ||
14 | exit 1 | ||
15 | else | ||
16 | exit 0 | ||
17 | fi | ||
18 | fi | ||
19 | |||
20 | # This is a heuristic: The idea is that if a static interface is brought | ||
21 | # up, that is a major event, and we can put in some extra effort to fix | ||
22 | # the system time. Feel free to change this, especially if you regularly | ||
23 | # bring up new network interfaces. | ||
24 | if [ "$METHOD" = static ]; then | ||
25 | OPTS="-b" | ||
26 | fi | ||
27 | |||
28 | if [ "$METHOD" = loopback ]; then | ||
29 | exit 0 | ||
30 | fi | ||
31 | |||
32 | ( | ||
33 | |||
34 | LOCKFILE=/var/lock/ntpdate | ||
35 | |||
36 | # Avoid running more than one at a time | ||
37 | if [ -x /usr/bin/lockfile-create ]; then | ||
38 | lockfile-create $LOCKFILE | ||
39 | lockfile-touch $LOCKFILE & | ||
40 | LOCKTOUCHPID="$!" | ||
41 | fi | ||
42 | |||
43 | if /usr/bin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then | ||
44 | if [ "$UPDATE_HWCLOCK" = "yes" ]; then | ||
45 | hwclock --systohc || : | ||
46 | fi | ||
47 | fi | ||
48 | |||
49 | if [ -x /usr/bin/lockfile-create ] ; then | ||
50 | kill $LOCKTOUCHPID | ||
51 | lockfile-remove $LOCKFILE | ||
52 | fi | ||
53 | |||
54 | ) & | ||
diff --git a/meta/recipes-support/ntp/files/ntpdate.default b/meta/recipes-support/ntp/files/ntpdate.default new file mode 100644 index 0000000000..486b6e07d3 --- /dev/null +++ b/meta/recipes-support/ntp/files/ntpdate.default | |||
@@ -0,0 +1,7 @@ | |||
1 | # Configuration script used by ntpdate-sync script | ||
2 | |||
3 | NTPSERVERS="" | ||
4 | |||
5 | # Set to "yes" to write time to hardware clock on success | ||
6 | UPDATE_HWCLOCK="no" | ||
7 | |||
diff --git a/meta/recipes-support/ntp/files/openssl-check.patch b/meta/recipes-support/ntp/files/openssl-check.patch new file mode 100644 index 0000000000..8b4a6733cd --- /dev/null +++ b/meta/recipes-support/ntp/files/openssl-check.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | Hack OpenSSL check to work when libssl and libcrypto aren't in same dir | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | --- | ||
7 | configure | 4 ++-- | ||
8 | m4/ntp_openssl.m4 | 4 ++-- | ||
9 | sntp/configure | 4 ++-- | ||
10 | 3 files changed, 6 insertions(+), 6 deletions(-) | ||
11 | |||
12 | diff --git a/configure b/configure | ||
13 | index aae2c01..6a3c15e 100755 | ||
14 | --- a/configure | ||
15 | +++ b/configure | ||
16 | @@ -22868,8 +22868,8 @@ case "$ans" in | ||
17 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
18 | ;; | ||
19 | *) | ||
20 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
21 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
22 | + test -f $i/libssl.so && break | ||
23 | + test -f $i/libssl.a && break | ||
24 | ;; | ||
25 | esac | ||
26 | done | ||
27 | diff --git a/m4/ntp_openssl.m4 b/m4/ntp_openssl.m4 | ||
28 | index 7d9f477..67bdd55 100644 | ||
29 | --- a/m4/ntp_openssl.m4 | ||
30 | +++ b/m4/ntp_openssl.m4 | ||
31 | @@ -41,8 +41,8 @@ case "$ans" in | ||
32 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
33 | ;; | ||
34 | *) | ||
35 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
36 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
37 | + test -f $i/libssl.so && break | ||
38 | + test -f $i/libssl.a && break | ||
39 | ;; | ||
40 | esac | ||
41 | done | ||
42 | diff --git a/sntp/configure b/sntp/configure | ||
43 | index 7782c29..55e82d9 100755 | ||
44 | --- a/sntp/configure | ||
45 | +++ b/sntp/configure | ||
46 | @@ -14810,8 +14810,8 @@ case "$ans" in | ||
47 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
48 | ;; | ||
49 | *) | ||
50 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
51 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
52 | + test -f $i/libssl.so && break | ||
53 | + test -f $i/libssl.a && break | ||
54 | ;; | ||
55 | esac | ||
56 | done | ||
57 | -- | ||
58 | 1.7.1 | ||
59 | |||
diff --git a/meta/recipes-support/ntp/files/tickadj.c.patch b/meta/recipes-support/ntp/files/tickadj.c.patch new file mode 100644 index 0000000000..9ef9de9e1f --- /dev/null +++ b/meta/recipes-support/ntp/files/tickadj.c.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Index: ntp-4.2.2p3-r0/ntp-4.2.2p3/util/tickadj.c | ||
2 | =================================================================== | ||
3 | --- ntp-4.2.2p3/util/tickadj.c 2004-02-25 06:58:33.000000000 +0100 | ||
4 | +++ ntp-4.2.2p3/util/tickadj.c 2007-07-07 01:00:54.000000000 +0200 | ||
5 | @@ -21,7 +21,8 @@ | ||
6 | # include <unistd.h> | ||
7 | #endif /* HAVE_UNISTD_H */ | ||
8 | |||
9 | -#ifdef HAVE___ADJTIMEX /* Linux */ | ||
10 | +/* proper handling here has been moved to upstream ntp bugzilla */ | ||
11 | +#ifdef linux | ||
12 | |||
13 | #include <sys/timex.h> | ||
14 | struct timex txc; | ||
15 | @@ -91,7 +92,7 @@ | ||
16 | } | ||
17 | |||
18 | if (!errflg) { | ||
19 | - if (__adjtimex(&txc) < 0) | ||
20 | + if (adjtimex(&txc) < 0) | ||
21 | perror("adjtimex"); | ||
22 | else if (!quiet) | ||
23 | printf("tick = %ld\ntick_adj = %d\n", | ||
24 | @@ -146,7 +147,7 @@ | ||
25 | #endif | ||
26 | } | ||
27 | |||
28 | - if (__adjtimex(&txc) < 0) | ||
29 | + if (adjtimex(&txc) < 0) | ||
30 | { | ||
31 | perror("adjtimex"); | ||
32 | } | ||