Re: Improving hwclock support in Debian (testing wanted)

2012-02-21 Thread Ian Jackson
Marco d'Itri writes (Re: Improving hwclock support in Debian (testing 
wanted)):
 On Feb 18, Roger Leigh rle...@codelibre.net wrote:
  • There are currently two init scripts, hwclockfirst.sh and
hwclock.sh.  The reasons for these two originally existing
 Why do you still bother with init scripts? With very good approximation, 
 nowadays all systems which need hwclock (i.e. are not containers, 
 chroots, etc) use udev:

Please do not make udev mandatory.  There are still refuseniks out
there and I can see why they make that choice.

Ian.


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20291.42853.211058.58...@chiark.greenend.org.uk



Re: Improving hwclock support in Debian (testing wanted)

2012-02-21 Thread Marco d'Itri
On Feb 21, Ian Jackson ijack...@chiark.greenend.org.uk wrote:

 Please do not make udev mandatory.  There are still refuseniks out
 there and I can see why they make that choice.
Statistics show that they are not relevant.
Duplicating code paths has a cost, and it's big when one of them is
never tested.

-- 
ciao,
Marco


signature.asc
Description: Digital signature


Improving hwclock support in Debian (testing wanted)

2012-02-18 Thread Roger Leigh
Hi,

The attached patch against current util-linux cleans up hwclock
handling with the following changes:

• There are currently two init scripts, hwclockfirst.sh and
  hwclock.sh.  The reasons for these two originally existing
  (/etc/localtime not being present until after /usr was
  mounted AFAICT) no longer exist.  I've removed hwclockfirst
  and adjusted the hwclock init script to run before checkroot.

• Currently the setting for if the hardware clock is in UTC or
  local time is set with the UTC setting in /etc/default/rcS.
  However, this needlessly duplicates the /existing/ setting in
  hwclock's own configuration file (/etc/adjtime).  This means
  hwclock's behaviour is overridden and its configuration
  overwritten *every shutdown*.  This patch migrates the existing
  UTC= setting to UTC/LOCAL in /etc/adjtime.

• The hwclock init scripts use the --utc and --localtime options
  (based on the UTC setting).  This patch changes hwclock to use
  the value in /etc/adjtime.

• The udev hwclock-set script now runs unconditionally in all
  cases using --tzset.  (It's a no-op for UTC.)

• If the user runs hwclock --systohc (--utc|--localtime) this is
  now handled correctly.  The clock state is recorded in
  /etc/adjtime and correctly handled on restart.  This means the
  UTC setting in /etc/default/rcS doesn't screw things up by
  requiring two separate changes to do the same thing.

• systemd uses /etc/adjtime as for hwclock to store the hardware
  clock UTC/LOCAL configuration.  This change means there's a
  single place to store the hardware clock configuration for all
  init systems.

I've tested the patch on a powerpc system for a PST timezone using
UTC and LOCAL options both with and without udev support (commented
out the udev conditionals to test non-udev code).  It would be
great to have some testing on different hardware and setups with
UTC or local time to make sure this covers all possible
configurations without any regressions.

There's an additional patch for d-i clock-setup to make this work
for new installs as well (#660093).  I'll file a bug with this
patch against util-linux once this is properly tested.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800


util-linux-hwclock-decruft.patch.bz2
Description: Binary data


Re: Improving hwclock support in Debian (testing wanted)

2012-02-18 Thread Roger Leigh
On Sat, Feb 18, 2012 at 03:59:23PM +, Roger Leigh wrote:
 Hi,
 
 The attached patch against current util-linux cleans up hwclock
 handling with the following changes:

• Also adds /etc/default/hwclock and hwclock(5) which permit
  configuration without editing the initscript, and also
  documents all the undocumented knobs used by the scripts.

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120218163428.gg26...@codelibre.net



Re: Improving hwclock support in Debian (testing wanted)

2012-02-18 Thread Marco d'Itri
On Feb 18, Roger Leigh rle...@codelibre.net wrote:

 • There are currently two init scripts, hwclockfirst.sh and
   hwclock.sh.  The reasons for these two originally existing
Why do you still bother with init scripts? With very good approximation, 
nowadays all systems which need hwclock (i.e. are not containers, 
chroots, etc) use udev:

http://qa.debian.org/popcon-graph.php?packages=udev+module-init-toolsshow_installed=onwant_legend=onwant_ticks=onfrom_date=2012-02-01to_date=hlght_date=date_fmt=%25Y-%25mbeenhere=1

-- 
ciao,
Marco


signature.asc
Description: Digital signature


Re: Improving hwclock support in Debian (testing wanted)

2012-02-18 Thread Roger Leigh
On Sat, Feb 18, 2012 at 08:00:28PM +0100, Marco d'Itri wrote:
 On Feb 18, Roger Leigh rle...@codelibre.net wrote:
 
  • There are currently two init scripts, hwclockfirst.sh and
hwclock.sh.  The reasons for these two originally existing
 Why do you still bother with init scripts? With very good approximation, 
 nowadays all systems which need hwclock (i.e. are not containers, 
 chroots, etc) use udev:

This updates both the init script and the udev hwclock script.
Also, the init script is still needed to sync the clock on
shutdown; AFAIK udev only triggers the hwclock on startup when
the rtc device is registered.  In addition to that, this ensures
that it works uniformly on non-Linux- and non-udev-using systems.

The (previously undocumented) configuration variables for both
the init script and the udev script are now set in
/etc/default/hwclock.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120218194040.gj26...@codelibre.net