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 <ian.jack...@eu.citrix.com>
---
 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 (<EI>) {
+               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


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to