# before changing this file. You risk serious clock
# misbehaviour otherwise.
-FIRST=no # debian/rules sets this to 'yes' when creating hwclockfirst.sh
-
-[ "X$FIRST" = "Xyes" ] && AGAIN="" || AGAIN=" again"
-
# Set this to any options you might need to give to hwclock, such
# as machine hardware clock type for Alphas.
HWCLOCKPARS=
case "$UTC" in
no|"") GMT="--localtime"
UTC=""
- if [ "X$FIRST" = "Xyes" ] && [ ! -r /etc/localtime ]; then
- if [ -z "$TZ" ]; then
- log_action_msg "System clock was not updated at this time"
- return 1
- fi
- fi
;;
yes) GMT="--utc"
UTC="--utc"
echo "0.0 0 0.0" > /etc/adjtime
fi
- if [ "$FIRST" != yes ]; then
- # Uncomment the hwclock --adjust line below if you want
- # hwclock to try to correct systematic drift errors in the
- # Hardware Clock.
- #
- # WARNING: If you uncomment this option, you must either make
- # sure *nothing* changes the Hardware Clock other than
- # hwclock --systohc, or you must delete /etc/adjtime
- # every time someone else modifies the Hardware Clock.
- #
- # Common "vilains" are: ntp, MS Windows, the BIOS Setup
- # program.
- #
- # WARNING: You must remember to invalidate (delete)
- # /etc/adjtime if you ever need to set the system clock
- # to a very different value and hwclock --adjust is being
- # used.
- #
- # Please read /usr/share/doc/util-linux/README.Debian.hwclock
- # before enablig hwclock --adjust.
+ # Uncomment the hwclock --adjust line below if you want
+ # hwclock to try to correct systematic drift errors in the
+ # Hardware Clock.
+ #
+ # WARNING: If you uncomment this option, you must either make
+ # sure *nothing* changes the Hardware Clock other than
+ # hwclock --systohc, or you must delete /etc/adjtime
+ # every time someone else modifies the Hardware Clock.
+ #
+ # Common "vilains" are: ntp, MS Windows, the BIOS Setup
+ # program.
+ #
+ # WARNING: You must remember to invalidate (delete)
+ # /etc/adjtime if you ever need to set the system clock
+ # to a very different value and hwclock --adjust is being
+ # used.
+ #
+ # Please read /usr/share/doc/util-linux/README.Debian.hwclock
+ # before enablig hwclock --adjust.
- #hwclock --adjust $GMT $BADYEAR
- :
- fi
+ #hwclock --adjust $GMT $BADYEAR
+ :
if [ "$HWCLOCKACCESS" != no ]; then
- log_daemon_msg "Setting the system clock$AGAIN"
+ [ "$VERBOSE" = no ] || log_daemon_msg "Setting the system clock"
# Copies Hardware Clock time to System Clock using the correct
# timezone for hardware clocks in local time, and sets kernel
# timezone. DO NOT REMOVE.
/sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR
- if [ "$FIRST" = yes ]; then
- # Copies Hardware Clock time to System Clock using the correct
- # timezone for hardware clocks in local time, and sets kernel
- # timezone. DO NOT REMOVE.
- if [ -z "$TZ" ]; then
- /sbin/hwclock --noadjfile --hctosys $GMT $HWCLOCKPARS $BADYEAR
- else
- TZ="$TZ" /sbin/hwclock --noadjfile --hctosys $GMT $HWCLOCKPARS $BADYEAR
- fi
-
- if /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR 2>&1 > /dev/null |
- grep -q '^The Hardware Clock registers contain values that are either invalid'; then
- echo "Invalid system date -- setting to 1/1/2002"
- /sbin/hwclock --set --date '1/1/2002 00:00:00' $GMT $HWCLOCKPARS $BADYEAR
- fi
+ if /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR 2>&1 > /dev/null |
+ grep -q '^The Hardware Clock registers contain values that are either invalid'; then
+ echo "Invalid system date -- setting to 1/1/2002"
+ /sbin/hwclock --set --date '1/1/2002 00:00:00' $GMT $HWCLOCKPARS $BADYEAR
fi
# Announce the local time.
else
verbose_log_action_msg "Not setting System Clock"
fi
- log_end_msg 0
+ [ $VERBOSE = no ] || log_end_msg 0
;;
stop|restart|reload|force-reload)
- if [ "X$FIRST" = "Xyes" ]; then
- return 0
- fi
#
# Updates the Hardware Clock with the System Clock time.
# This will *override* any changes made to the Hardware Clock.
esac
}
-hwclocksh "$@"
+hwclocksh "$@" &
find . -name '*.orig' -print0 | xargs -0r rm
find . -name '*.rej' -print0 | xargs -0r rm
rm -rf debian/tmp* debian/files* debian/substvars po/messages
- rm -f debian/hwclockfirst.sh
rm -rf $(CFDISK_PO_DIR)
# Architecture independant stuff
ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
ifneq ($(arch),$(nohwclock))
-INITFILES = debian/hwclock.sh debian/hwclockfirst.sh
+INITFILES = debian/hwclock.sh
SBINFILES += hwclock/hwclock
endif
BINFILES += sys-utils/dmesg
install:
-debian/hwclockfirst.sh: debian/hwclock.sh
- sed '/^FIRST/s/no/yes/; s/hwclock\.sh/hwclockfirst.sh/g' debian/hwclock.sh > debian/hwclockfirst.sh
-
binary-indep: checkroot build binary-arch
$(checkdir)
# This assumes non-native, and only one hyphen in the version number.