Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 306299 Details for
Bug 318365
systemd - Replacement for sysvinit with extensive usage of parallelization
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
script for hwclock service file
hwclock-set.sh (text/plain), 3.12 KB, created by
erFelipe
on 2012-03-22 10:37:49 UTC
(
hide
)
Description:
script for hwclock service file
Filename:
MIME Type:
Creator:
erFelipe
Created:
2012-03-22 10:37:49 UTC
Size:
3.12 KB
patch
obsolete
>#!/bin/bash ># Adaptacion del script de inicio de OpenRC para funcionar ># con systemd. Es llamado desde hwclock.service con las ordenes ># start o stop > ># source application-specific settings >[ -f /etc/conf.d/hwclock ] && . /etc/conf.d/hwclock > >#setting some variables >if [ -n "$clock" ]; then > case $clock in > "local") > utc_cmd="--localtime" > utc="Local Time" > ;; > "UTC") > utc_cmd="--utc" > utc="UTC" > ;; > esac >fi > >### yesno function from gentoo's funcions.sh file >yesno() >{ > [ -z "$1" ] && return 1 > > case "$1" in > [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;; > [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;; > esac > > local value= > eval value=\$${1} > case "$value" in > [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;; > [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;; > *) logger "\$$1 is not set properly"; return 1;; > esac >} > >### setupopts function from gentoo's hwclock init script >setupopts() >{ > case "$(uname -m)" in > s390*) > utc="s390" > ;; > *) > if [ -e /proc/devices ] && \ > grep -q " cobd$" /proc/devices > then > utc="coLinux" > fi > ;; > esac > > case "$utc" in > UTC|Local" "Time);; > *) unset utc_cmd;; > esac >} > >### functions start/stop, adapted from gentoo's hwclock init script >start() >{ > local retval=0 errstr="" > setupopts > > if [ -z "$utc_cmd" ]; then > logger "Not setting clock for $utc system" > return 0 > fi > > logger "Setting system clock" > if [ -e /proc/modules ]; then > local rtc= > for rtc in /dev/rtc /dev/rtc[0-9]*; do > [ -e "$rtc" ] && break > done > if [ ! -e "${rtc}" ]; then > modprobe -vq rtc-cmos || modprobe -vq rtc || modprobe -vq genrtc > fi > fi > > if [ -e /etc/adjtime ] && yesno $clock_adjfile; then > hwclock --adjust $utc_cmd > : $(( retval += $? )) > fi > > # If setting UTC, don't bother to run hwclock when first booting as that's the default > if [ "$PREVLEVEL" != N -o "$utc_cmd" != --utc -o -n "$clock_args" ]; > then > if yesno $clock_hctosys; then > hwclock --hctosys $utc_cmd $clock_args > else > hwclock --systz $utc_cmd $clock_args > fi > : $(( retval += $? )) > fi > > return $retval >} > >stop() >{ > local retval=0 errstr="" > setupopts > > [ -z "$utc_cmd" ] && return 0 > > logger "Stopping hardware clock" > > if ! yesno $clock_adjfile; then > # Some implementations don't handle adjustments > if LC_ALL=C hwclock --help 2>&1 | grep -q "\-\-noadjfile"; then > utc_cmd="$utc_cmd --noadjfile" > fi > fi > > hwclock --systohc $utc_cmd $clock_args > > retval=$? > > return $retval >} > >case $1 in > "start") start ;; > "stop") stop ;; > *) echo "Opcion Incorrecta" ;; >esac
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 318365
:
230771
|
230773
|
230777
|
230779
|
230887
|
230889
|
231157
|
231305
|
238431
|
241097
|
241099
|
244953
|
244955
|
244957
|
244959
|
256198
|
256199
|
256201
|
256202
|
256203
|
256205
|
256209
|
256319
|
256349
|
256351
|
256352
|
256435
|
256437
|
256439
|
256446
|
256698
|
257917
|
257922
|
270185
|
270187
|
270189
|
270191
|
271583
|
277115
|
277117
|
306293
|
306295
|
306297
| 306299 |
306339
|
306341
|
306343
|
306345