From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 9/9] NTP servers: Work around Debian's failure to honour preseed Date: Tue, 17 Feb 2015 17:50:31 +0000 Message-ID: <1424195431-1493-10-git-send-email-ian.jackson@eu.citrix.com> References: <1424195431-1493-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YNmVI-0005Cw-5y for xen-devel@lists.xenproject.org; Tue, 17 Feb 2015 18:04:12 +0000 In-Reply-To: <1424195431-1493-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Setting clock-setup/ntp-server is not sufficient: it only takes effect in the installer (!) I have reported this as Debian #778564. In the meantime we should work around it for current releases (including jessie, which is frozen). For later releases, the new ntp.conf editing code arranges to bomb out if we have an NTP server configured and find it hasn't been honoured during the install. Signed-off-by: Ian Jackson --- ts-host-install | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ts-host-install b/ts-host-install index ae1d228..9656079 100755 --- a/ts-host-install +++ b/ts-host-install @@ -119,6 +119,26 @@ END target_install_packages($ho, qw(ed)); + my $ntpserver = get_target_property($ho, 'NtpServer'); + if ($ntpserver) { + target_editfile_root($ho, '/etc/ntp.conf', sub { + my $done= 0; + while () { + if (m/^server\s/) { + if ($ho->{Suite} =~ m/lenny|squeeze|wheezy|jessie/) { + $_= $done ? "" : "server $ntpserver\n"; + } else { + m/^server \Q$ntpserver\E\s/ or + die "NTP server not honoured, Debian #778564 "; + } + $done= 1; + } + print EO or die $!; + } + $done or die; + }); + } + target_cmd_root($ho, "update-rc.d osstest-confirm-booted start 99 2 ."); logm('OK: install completed'); -- 1.7.10.4