Helmut, Thanks for this
On Tue, Nov 28, 2023 at 10:27:41AM +0100, Helmut Grohne wrote: > Package: initscripts > Version: 3.08-3~bpo12+1 > Severity: serious > User: debian...@lists.debian.org > Usertags: fileconflict > Control: affects -1 + util-linux > Tags: bookworm > > initscripts has an undeclared file conflict. This may result in an > unpack error from dpkg. > > The file /usr/lib/udev/hwclock-set is contained in the packages > * initscripts/3.08-3~bpo12+1 as present in bookworm-backports > * util-linux/2.36.1-8+deb11u1 as present in bullseye|bullseye-security Are the suites and versions reported here really the problematic ones? I agree there is a conflict, but I think it is between initscripts/3.08-3~bpo12+1 in bookworm-backports and util-linux-extra/2.38.1-5 in bookworm. My proposed fix is attached. It reverts the transition of the hwclock machinery to initscripts, since this is still present in bookworm src:util-linux. Or, have I misunderstood? Best wishes, Mark diff --git a/debian/control b/debian/control index 551b7abc..02bfe1b5 100644 --- a/debian/control +++ b/debian/control @@ -99,15 +99,12 @@ Multi-Arch: foreign Depends: sysvinit-utils (>= 3.05-1), sysv-rc | file-rc | openrc, - util-linux-extra, ${misc:Depends}, Recommends: e2fsprogs, psmisc, Breaks: udev (<< 254.3-1), - util-linux-extra (<< 2.39.2-2.1~) Replaces: udev (<< 254.3-1), - util-linux-extra (<< 2.39.2-2.1~) Description: scripts for initializing and shutting down the system The scripts in this package initialize a standard Debian system at boot time and shut it down at halt or reboot time. diff --git a/debian/initscripts.postinst b/debian/initscripts.postinst index 0074f2a3..eb126710 100755 --- a/debian/initscripts.postinst +++ b/debian/initscripts.postinst @@ -42,7 +42,7 @@ INITSCRIPTS="mountkernfs.sh mount-configfs brightness hostname.sh mountdevsubfs. checkroot-bootclean.sh checkfs.sh mountall.sh mountall-bootclean.sh \ mountnfs.sh mountnfs-bootclean.sh bootmisc.sh urandom halt reboot \ udev umountroot umountfs umountnfs.sh sendsigs killprocs single motd \ - bootlogs rc.local rmnologin hwclock.sh" + bootlogs rc.local rmnologin" for F in $INITSCRIPTS; do if [ -x /etc/init.d/$F ]; then diff --git a/debian/initscripts.postrm b/debian/initscripts.postrm index 25bbb932..e53672dc 100755 --- a/debian/initscripts.postrm +++ b/debian/initscripts.postrm @@ -9,7 +9,7 @@ INITSCRIPTS="mountkernfs.sh mount-configfs brightness hostname.sh mountdevsubfs. checkroot-bootclean.sh checkfs.sh mountall.sh mountall-bootclean.sh \ mountnfs.sh mountnfs-bootclean.sh bootmisc.sh urandom halt reboot \ udev umountroot umountfs umountnfs.sh sendsigs killprocs single motd \ - bootlogs rc.local rmnologin hwclock.sh" + bootlogs rc.local rmnologin" case "$1" in purge) diff --git a/debian/src/initscripts/Makefile b/debian/src/initscripts/Makefile index 5da80089..b13eafa3 100644 --- a/debian/src/initscripts/Makefile +++ b/debian/src/initscripts/Makefile @@ -34,9 +34,6 @@ install: $(INSTALL) -d $(DESTDIR)$(sbindir)/. $(INSTALL) sbin/fsck.nfs $(DESTDIR)$(sbindir)/fsck.nfs - $(INSTALL_DATA) -Dt $(DESTDIR)/usr/lib/udev/rules.d usr/lib/udev/rules.d/hwclock.rules - $(INSTALL) usr/lib/udev/hwclock-set $(DESTDIR)/usr/lib/udev/hwclock-set - $(INSTALL) -d $(DESTDIR)/usr/share/man/man8 $(INSTALL_DATA) man/fsck.nfs.8 \ $(DESTDIR)/usr/share/man/man8/fsck.nfs.8 diff --git a/debian/src/initscripts/etc/default/hwclock b/debian/src/initscripts/etc/default/hwclock deleted file mode 100644 index 44b04312..00000000 --- a/debian/src/initscripts/etc/default/hwclock +++ /dev/null @@ -1,2 +0,0 @@ -# Settings for the hwclock init script. -# See hwclock(5) for supported settings. diff --git a/debian/src/initscripts/etc/init.d/hwclock.sh b/debian/src/initscripts/etc/init.d/hwclock.sh deleted file mode 100644 index a9872b64..00000000 --- a/debian/src/initscripts/etc/init.d/hwclock.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: hwclock -# Required-Start: -# Required-Stop: mountdevsubfs -# Should-Stop: umountfs -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: Save system clock to hardware on shutdown. -### END INIT INFO - -# Note: this init script and related code is only useful if you -# run a sysvinit system, without NTP synchronization. - -if [ -e /run/systemd/system ] ; then - exit 0 -fi - -unset TZ - -hwclocksh() -{ - HCTOSYS_DEVICE=rtc0 - [ ! -x /sbin/hwclock ] && return 0 - [ ! -r /etc/default/rcS ] || . /etc/default/rcS - [ ! -r /etc/default/hwclock ] || . /etc/default/hwclock - - . /lib/lsb/init-functions - verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; } - - case "$1" in - start) - # start is handled by /usr/lib/udev/rules.d/85-hwclock.rules. - return 0 - ;; - stop|restart|reload|force-reload) - # Updates the Hardware Clock with the System Clock time. - # This will *override* any changes made to the Hardware Clock, - # for example by the Linux kernel when NTP is in use. - log_action_msg "Saving the system clock to /dev/$HCTOSYS_DEVICE" - if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc; then - verbose_log_action_msg "Hardware Clock updated to `date`" - fi - ;; - show) - /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show - ;; - *) - log_success_msg "Usage: hwclock.sh {stop|reload|force-reload|show}" - log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock" - return 1 - ;; - esac -} - -hwclocksh "$@" diff --git a/debian/src/initscripts/man/hwclock.5 b/debian/src/initscripts/man/hwclock.5 deleted file mode 100644 index 59d3d4a7..00000000 --- a/debian/src/initscripts/man/hwclock.5 +++ /dev/null @@ -1,34 +0,0 @@ -.TH HWCLOCK 5 "Dec 2020" "" "Debian Administrator's Manual" -.SH NAME -hwclock \- settings that affect the behaviour of the hwclock init script -.SH DESCRIPTION -The -.I /etc/default/hwclock -file contains settings in POSIX format: -.IP "" .5i -VAR=VAL -.PP -Only one assignment is allowed per line. -Comments (starting with '#') are also allowed. - -.SH SETTINGS -The following settings can be set. - -.IP \fBHCTOSYS_DEVICE\fP -The hardware clock device you want to use. Defaults to \fBrtc0\fP. -It should probably match the CONFIG_RTC_HCTOSYS_DEVICE kernel config -option. - -If you change this, you also need to install a custom udev rule, -mirroring \fB/usr/lib/udev/rules.d/85-hwclock.rules\fP. Otherwise, -the hardware clock device will be ignored during boot. - -On almost all systems, this should not be changed. - -.SH NOTES - -On systems using systemd as init, the hwclock init script is ignored. - -.SH SEE ALSO -.BR hwclock (8), -.BR systemd-timesyncd.service (8) diff --git a/debian/src/initscripts/usr/lib/udev/hwclock-set b/debian/src/initscripts/usr/lib/udev/hwclock-set deleted file mode 100755 index fec65edd..00000000 --- a/debian/src/initscripts/usr/lib/udev/hwclock-set +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Reset the System Clock to UTC if the hardware clock from which it -# was copied by the kernel was in localtime. - -dev=$1 - -if [ -e /run/systemd/system ] ; then - exit 0 -fi - -/sbin/hwclock --rtc=$dev --systz -/sbin/hwclock --rtc=$dev --hctosys diff --git a/debian/src/initscripts/usr/lib/udev/rules.d/hwclock.rules b/debian/src/initscripts/usr/lib/udev/rules.d/hwclock.rules deleted file mode 100644 index c4c0b174..00000000 --- a/debian/src/initscripts/usr/lib/udev/rules.d/hwclock.rules +++ /dev/null @@ -1,4 +0,0 @@ -# Set the System Time from the Hardware Clock and set the kernel's timezone -# value to the local timezone when the kernel clock module is loaded. - -KERNEL=="rtc0", RUN+="/usr/lib/udev/hwclock-set $root/$name"