Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 60584 Details for
Bug 94909
sys-process/procps: support setting sysfs values automatically at boot time using an initscript
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Init script
sysfs (text/plain), 2.55 KB, created by
Stefano Varesi
on 2005-06-04 07:13:15 UTC
(
hide
)
Description:
Init script
Filename:
MIME Type:
Creator:
Stefano Varesi
Created:
2005-06-04 07:13:15 UTC
Size:
2.55 KB
patch
obsolete
>#!/sbin/runscript > >depend() { > need localmount > before logger >} > >start() { > ebegin "Setting sysfs values" > > # check if configuration files exists > if ! [ -f /etc/conf.d/sysfs ] ; then > eerror " Configuration file /etc/conf.d/sysfs not found!" > eend -1 "Failed to set syfs values" > return -1 > fi > > # check if configuration file is empty > if [[ `cat /etc/conf.d/sysfs | grep -v "^#"` == "" ]]; then > eerror " Configuration file /etc/conf.d/sysfs empty!" > eend -1 "Failed to set syfs values" > return -1 > fi > > # check if the SYSFS array is empty > if [ ${#SYSFS[*]} == 0 ] ; then > ewarn " Nothing to do!" > eend 0 > return -1 > fi > > # set sysfs values > for i in `seq 1 ${#SYSFS[*]}` ; do > > # check if the string is empty > if [[ `echo ${SYSFS[$i-1]}` == "" ]] ; then > let p=$i-1 > eend -1 " Empty string at position $p in array SYSFS!" > continue > fi > > # check if the string is an assignment > if ! [[ `echo ${SYSFS[$i-1]} | grep =` ]] ; then > let p=$i-1 > eend -1 " String must be an assignment at position $p in array SYSFS!" > continue > fi > > FILE=`echo ${SYSFS[$i-1]} | cut -d'=' -f1` > VALUE=`echo ${SYSFS[$i-1]} | cut -d'=' -f2` > > # check if $FILE is an empty string > if [[ $FILE == "" ]] ; then > let p=$i-1 > eend -1 " Field <file> empty at position $p in array SYSFS!" > continue > fi > > # check if $FILE contains spaces > if [[ `echo $FILE | grep " "` ]] ; then > let p=$i-1 > eend -1 " Field <file> can't contain spaces at position $p in array SYSFS!" > continue > fi > > # check if $VALUE is an empty string > if [[ $VALUE == "" ]] ; then > let p=$i-1 > eend -1 " Field <value> empty at position $p in array SYSFS" > continue > fi > > # check if the file to be modified is in the /sys tree > if [[ `echo $FILE | cut -d"/" -f2` != "sys" ]] ; then > eend -1 " Cannot modify files not in the sysfs!" > continue > fi > > # check if the file exists in sysfs > if ! [ -f $FILE ] ; then > eend -1 " File $FILE not found in sysfs!" > continue > fi > > ebegin " Setting `echo $VALUE` in $FILE" > echo -n "$VALUE" > $FILE > eend $? > done >}
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 94909
:
60513
|
60514
|
60583
|
60584
|
60625