Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 60513 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), 1.41 KB, created by
Stefano Varesi
on 2005-06-03 04:08:50 UTC
(
hide
)
Description:
Init script
Filename:
MIME Type:
Creator:
Stefano Varesi
Created:
2005-06-03 04:08:50 UTC
Size:
1.41 KB
patch
obsolete
>#!/sbin/runscript > >depend() { > need localmount > before logger >} > >start() { > ebegin "Setting sysfs values" > > # if configuration files doesn't exist, exit showing an error message > 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 > > # if the two arrays have different length, exit showing an error message > if [ ${#SYSFS_FILES[*]} != ${#SYSFS_VALUES[*]} ] ; then > eerror " Arrays SYSFS_FILES and SYSFS_VALUES are of different length, check /etc/conf.d/sysfs!" > eend -1 "Failed to set syfs values" > return -1 > fi > > # if the two arrays are empty, it has nothing to do > if [ ${#SYSFS_FILES[*]} == 0 ] ; then > ewarn " Nothing to do!" > eend 0 > return -1 > fi > > # set new sysfs values > for i in `seq 1 ${#SYSFS_FILES[*]}` ; do > # if the file to be modified isn't a sysfs file, exit showing an error message > if [[ `echo ${SYSFS_FILES[$i-1]} | cut -d"/" -f2 ` != "sys" ]] ; then > eend -1 " Cannot modify files not in the /sys tree!" > else > # if the file doesn't exist in /sys, exit showing an error message > if ! [ -f ${SYSFS_FILES[$i-1]} ] ; then > eend -1 " File ${SYSFS_FILES[$i-1]} not found in sysfs!" > else > ebegin " Setting ${SYSFS_VALUES[$i-1]} in ${SYSFS_FILES[$i-1]}" > echo -n "${SYSFS_VALUES[$i-1]}" > ${SYSFS_FILES[$i-1]} > eend $? > fi > fi > 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