diff -Nur -x '*.orig' -x '*.rej' e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/defaults/ntpd/SyncToHWClockSupported mezzanine_patched_e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/defaults/ntpd/SyncToHWClockSupported --- e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/defaults/ntpd/SyncToHWClockSupported 1969-12-31 17:00:00.000000000 -0700 +++ mezzanine_patched_e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/defaults/ntpd/SyncToHWClockSupported 2007-01-16 09:07:15.000000000 -0700 @@ -0,0 +1 @@ +yes diff -Nur -x '*.orig' -x '*.rej' e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/migrate/30NTPRunDisconnected mezzanine_patched_e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/migrate/30NTPRunDisconnected --- e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/migrate/30NTPRunDisconnected 1969-12-31 17:00:00.000000000 -0700 +++ mezzanine_patched_e-smith-ntp-1.16.0/root/etc/e-smith/db/configuration/migrate/30NTPRunDisconnected 2007-01-16 09:06:49.000000000 -0700 @@ -0,0 +1,7 @@ +{ + my $ntpd = $DB->get('ntpd'); + return unless $ntpd; + return if $ntpd->prop('SyncToHWClockSupported'); + + $ntpd->set_prop('status', 'enabled') unless ($ntpd->prop('status') || 'disabled') eq 'enabled'; +} diff -Nur -x '*.orig' -x '*.rej' e-smith-ntp-1.16.0/root/etc/e-smith/templates/etc/ntp.conf/00timeServer mezzanine_patched_e-smith-ntp-1.16.0/root/etc/e-smith/templates/etc/ntp.conf/00timeServer --- e-smith-ntp-1.16.0/root/etc/e-smith/templates/etc/ntp.conf/00timeServer 2004-10-19 04:51:14.000000000 -0600 +++ mezzanine_patched_e-smith-ntp-1.16.0/root/etc/e-smith/templates/etc/ntp.conf/00timeServer 2007-01-16 09:03:08.000000000 -0700 @@ -1,6 +1,7 @@ { # vim: ft=perl: - my $server = $ntpd{NTPServer}; + my $server = $ntpd{NTPServer} || ''; + return "# sync to hw clock" if $server =~ m#^\s*$#; if ($server =~ /pool.ntp.org/) { diff -Nur -x '*.orig' -x '*.rej' e-smith-ntp-1.16.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/datetime.pm mezzanine_patched_e-smith-ntp-1.16.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/datetime.pm --- e-smith-ntp-1.16.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/datetime.pm 2007-01-16 09:35:18.000000000 -0700 +++ mezzanine_patched_e-smith-ntp-1.16.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/datetime.pm 2007-01-16 09:35:01.000000000 -0700 @@ -166,7 +166,7 @@ if ($rec and $rec->prop('status') eq "enabled") { - $ntpEnabled = 1; + $ntpEnabled = 1 unless ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' and $oldNTPServer =~ m#^\s*$#; } @@ -345,8 +345,10 @@ my $ntpd = $conf->get('ntpd'); $conf->close(); + my $hwSync = $ntpd->prop('SyncToHWClockSupported') || 'yes'; + my $oldNtpServer = $ntpd->prop('NTPServer') || ''; - my $oldNtpStatus = $ntpd->prop('status') || 'disabled'; + my $oldNtpStatus = ($hwSync eq 'yes' and $oldNtpServer =~ m#^\s*$#) ? 'disabled' : ($ntpd->prop('status') || 'disabled'); my $newNtpServer = $q->param('ntpServer') || ''; my $newNtpStatus = $q->param('ntpStatus') || ''; @@ -687,13 +689,13 @@ my $rec = $conf->get('ntpd'); if ($rec) { - $rec->set_prop('status','disabled'); + $rec->set_prop('status', ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' ? 'enabled' : 'disabled'); $rec->set_prop('NTPServer',''); } else { $rec = $conf->new_record('ntpd', - {type=>'service', status=>'disabled', NTPServer=>''}); + {type=>'service', status=>'enabled', SyncToHWClockSupported => 'yes', NTPServer=>''}); } $conf->get('UnsavedChanges')->set_value($old); @@ -730,19 +732,16 @@ else { $rec = $conf->new_record('ntpd', - {type=>'service',status=>'enabled',NTPServer=>$ntpServer}); + {type=>'service',status=>'enabled',SyncToHWClockSupported => 'yes',NTPServer=>$ntpServer}); } $conf->get('UnsavedChanges')->set_value($old); - if ($ntpServer !~ /^\s*$/) - { - $msg = 'SETTINGS_CHANGED'; - } - else + $msg = 'SETTINGS_CHANGED'; + if ($ntpServer =~ /^\s*$/) { - $rec->set_prop('status', 'disabled'); + $rec->set_prop('status', ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' ? 'enabled' : 'disabled'); $rec->set_prop('NTPServer', ''); - $msg = 'INVALID_NTP_SERVER'; + $msg = 'INVALID_NTP_SERVER' if ($rec->prop('SyncToHWClockSupported') || 'yes') ne 'yes'; } }