From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2.tohojo.dk (mail2.tohojo.dk [IPv6:2a01:4f8:200:3141::101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by huchra.bufferbloat.net (Postfix) with ESMTPS id 2727521F1EE for ; Mon, 24 Mar 2014 14:04:04 -0700 (PDT) X-Virus-Scanned: amavisd-new at example.com Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id F1C021C326; Mon, 24 Mar 2014 22:03:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toke.dk; s=201310; t=1395695030; bh=T5bYu4U5kF9PQXfLiQsReGzr121VTIAGbDGxJvk2oko=; h=From:To:Subject:References:Date:In-Reply-To; b=OlBZMXwJtIPcAyhQeuWWSrHzPW7+0SNxTlpI+OtYGvXGrqTMPEw/L6HlrAX5VFUsL msB03gjGk7FEPviTi6NetrTRvTtdV+GpaebK2ETwJV71brC/I5hYmmW+cineOQew/r AxI8r9YaV5RhkKxuGxqJ+Pvhwt+/0XRiowP6Mp68= From: =?utf-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: "cerowrt-devel\@lists.bufferbloat.net" References: <20140324191203.GA78098@redoubt.spodhuis.org> Date: Mon, 24 Mar 2014 22:03:47 +0100 In-Reply-To: <20140324191203.GA78098@redoubt.spodhuis.org> (Phil Pennock's message of "Mon, 24 Mar 2014 15:12:03 -0400") Message-ID: <878urzia18.fsf@alrua-x1.karlstad.toke.dk> Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Subject: Re: [Cerowrt-devel] DNSSEC & NTP Bootstrapping X-BeenThere: cerowrt-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development issues regarding the cerowrt test router project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 21:04:04 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Phil Pennock writes: > For context, I'm currently running OpenWRT; attached is the > /etc/init.d/ntpdate which I'm using. It relies upon having Python and > dig installed, as I haven't gotten around to building a small C > utility to do just this task, but perhaps the approach is useful > enough that someone else might do so? A functionality similar to this is already implemented in openwrt and runs as the first thing on boot. It finds the newest file in /etc and sets the system time to that: # cat /etc/init.d/sysfixtime=20 #!/bin/sh /etc/rc.common # Copyright (C) 2013-2014 OpenWrt.org START=3D00 boot() { local curtime=3D"$(date +%s)" local maxtime=3D"$(find /etc -type f -exec date +%s -r {} \; | sort -nr | = head -n1)" [ $curtime -lt $maxtime ] && \ date -s @$maxtime && \ logger -t sysfixtime -p daemon.notice "Time fixed" } This works well enough that I haven't had any time problems in recent memory. However I tend to build my images minutes before flashing them, so for someone downloading an image off somewhere, the ntp lookup is obviously needed. I do believe it would be feasible to include your script without the preseed part pretty much as-is? It adds a dependency on dig, but I guess that is not unreasonable (certainly not for cerowrt, but maybe for openwrt default). The ntpdate dependency can probably be gotten away with by substituting an appropriate ntpd -q command... =2DToke --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBCAAGBQJTMJ2zAAoJEENeEGz1+utPR2QH/jT5PMfDLWu5gFB4Cvtjm7Qa viKiv5qoRkHWeYgzVikYA1/+0jR4ympOeWMUNjpqTt36Q69NyTdbQiQr2yiQf45D /MQQ4EmXApq+QpRc6NysqmaixwhCaPPgmJlIHtH815lvtAkGu4jW2qN6brNb/eVZ cQwhQr20Y7mDfL3X1rx8mlTmpeAATd0u9+TP0DAU1UM4TaeotU2KNKL2Xl7WpBvX YKrJeX3IC8+U4j65deZr98xqdNONgRLckFQws6C9xO13+l3jzeqmMJAWR4MPqpVF PYdJTZmxmXiUd7WtnvDOzXmAHLP8ceN9Nncx91X9F/Yq7NikjnnG3/w8hxdeDtw= =k0JP -----END PGP SIGNATURE----- --=-=-=--