Fix auto detect cpufreq modules for usb-hdd.

2.2.20_rc1
Mike Hiretsky 13 years ago
parent c30cf962d1
commit 0b30ddfc31

@ -11,6 +11,13 @@ KERNEL_VERSION_CONF="modules_${KERNEL_VERSION_CONF//-/_}"
MODULES_PATH="/lib/modules/${KERNEL_VERSION}"
CONF_FILE="/etc/conf.d/modules"
variable_value()
{
local varname=$1
cl-install -v --filter $varname |
awk "{ if (\$1 == \"$varname\") print \$3 }"
}
get_cpufreq_modules(){
MODULES_STRING=""
for path in $(find $MODULES_PATH -name cpufreq)
@ -42,11 +49,15 @@ find_string_modules(){
}
add_autoload_modules(){
local roottype=`variable_value os_root_type`
if ! find_string_modules;
then
ebegin "Added rules for cpu frequency"
get_cpufreq_modules
echo ${KERNEL_VERSION_CONF}=\"${MODULES_STRING}\" >> ${CONF_FILE}
if [[ $roottype == "hdd" ]]
then
echo ${KERNEL_VERSION_CONF}=\"${MODULES_STRING}\" >> ${CONF_FILE}
fi
else
ebegin "Cpu frequency modules already detected"
fi
@ -58,7 +69,8 @@ start() {
}
stop() {
if rc-update show boot | grep -q calculate-builder
local roottype=`variable_value os_root_type`
if [[ $roottype == "hdd" ]] && rc-config list boot | grep -q calculate-builder
then
rc-update del calculate-builder boot
fi

Loading…
Cancel
Save