Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 280851 Details for
Bug 376249
sys-apps/openrc: add sanetime for boards without an rtc
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
/etc/init.d/sanetime
sanetime (text/plain), 878 bytes, created by
Christopher Friedt
on 2011-07-24 18:10:33 UTC
(
hide
)
Description:
/etc/init.d/sanetime
Filename:
MIME Type:
Creator:
Christopher Friedt
Created:
2011-07-24 18:10:33 UTC
Size:
878 bytes
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2011 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 > ># get this number with 'date +%s' - it's just a fallback sanetime ># but really anything is better than the epoch >SANETIME="1310410279" >SANETIME_FILE=/etc/sanetime > >depend() { > need localmount >} > >write_sanetime() { > mkdir -p $(dirname $SANETIME_FILE) > echo "$1" > $SANETIME_FILE >} > >dofunc() { > local Now Then > Now="$(date +%s 2>&1)" > if [ -e $SANETIME_FILE ]; then > Then="$(cat $SANETIME_FILE)" > else > Then=$SANETIME > fi > if [ $Now -gt $Then ]; then > write_sanetime $Now > else > write_sanetime $Then > date -s @$Then >/dev/null 2>&1 > fi >} > >start() { > ebegin "Initializing sanetime" > ( > dofunc start > ) > eend $? "Error initializing sanetime" >} > >stop() { > ebegin "Saving sanetime" > ( > dofunc stop > ) > eend $? "Failed to save sanetime" >} > > ># 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 376249
:
280847
|
280849
| 280851