Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 28189 Details for
Bug 15834
hwclock --systohc on halt is bad idea
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
modified clock initscript
clock (text/plain), 2.03 KB, created by
Jonathan Rogers
on 2004-03-27 21:33:31 UTC
(
hide
)
Description:
modified clock initscript
Filename:
MIME Type:
Creator:
Jonathan Rogers
Created:
2004-03-27 21:33:31 UTC
Size:
2.03 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2003 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License v2 ># $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/clock,v 1.14 2003/10/14 00:02:21 azarah Exp $ > > >opts="${opts} save" > >depend() { > need localmount >} > >start() { > local myopts="" > local TBLURB="" > local errstr="" > if [ ! -f /etc/adjtime ] > then > echo "0.0 0 0.0" > /etc/adjtime > fi > if [ "${CLOCK}" = "UTC" ] > then > myopts="--utc" > TBLURB="[UTC]" > else > myopts="--localtime" > TBLURB="[Local Time]" > fi > > if [ -n "$(grep 'UML' /proc/cpuinfo)" ] > then > ebegin "Setting system clock to hardware clock ${TBLURB}" > eend 0 "Detected UML Environment; ignoring" > return 0 > > elif [ -x /sbin/hwclock ] > then > ebegin "Setting system clock to hardware clock ${TBLURB}" > errstr="$(/sbin/hwclock --adjust ${myopts} 2>&1 >/dev/null)" > errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)" > #hwclock do not return a fail status > if [ -n "${errstr}" ] > then > eend 1 "Failed to set system clock to hardware clock" > return 1 > else > eend 0 > return 0 > fi > else > eend 1 "hwclock executable not found" > fi >} > >stop() { > local myopts="" > local TBLURB="" > local errstr="" > > # Don't tweak hw clock on LiveCD halt > [ -n "${CDBOOT}" ] && return 0 > > if [ "${CLOCK}" = "UTC" ] > then > myopts="--utc" > TBLURB="[UTC]" > else > myopts="--localtime" > TBLURB="[Local Time]" > fi > > if [ -n "$(grep 'UML' /proc/cpuinfo)" ] > then > ebegin "Syncing hardware clock to system clock ${TBLURB}" > eend 0 "Detected UML Environment; ignoring" > return 0 > > elif [ -z "${SYNC_HW}" ] > then > ebegin "We don't want to sync hardware to system clock; skipping" > eend 0 > return 0 > elif [ -x /sbin/hwclock ] > then > ebegin "Syncing hardware clock to system clock ${TBLURB}" > errstr="$(/sbin/hwclock --systohc ${myopts} 2>&1 >/dev/null)" > if [ -n "${errstr}" ] > then > eend 1 "Failed to set hardware clock to system clock" > return 1 > else > eend 0 > return 0 > fi > else > eend 1 "hwclock executable not found" > fi >} > >save() { > stop >} > > ># vim:ts=4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15834
:
28189
|
28190