Blah
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
#
|
||||
# disk/post-start
|
||||
#
|
||||
|
||||
for dev in $(ata.bash); do
|
||||
echo cfq >$dev/queue/scheduler
|
||||
echo 0 >$dev/queue/iosched/slice_idle
|
||||
echo 64 >$dev/queue/iosched/quantum
|
||||
# more opitmizations with ncq
|
||||
echo 1024 >$dev/queue/nr_requests
|
||||
echo 2 >$dev/device/queue_depth
|
||||
done
|
||||
unset dev
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -2,11 +2,7 @@
|
||||
# disk/post-start
|
||||
#
|
||||
|
||||
function _ata {
|
||||
source "$ata_bash"
|
||||
}
|
||||
|
||||
for dev in $(_ata); do
|
||||
for dev in $(ata.bash); do
|
||||
echo cfq >$dev/queue/scheduler
|
||||
echo 0 >$dev/queue/iosched/slice_idle
|
||||
echo 64 >$dev/queue/iosched/quantum
|
||||
@@ -14,8 +10,7 @@ for dev in $(_ata); do
|
||||
echo 1024 >$dev/queue/nr_requests
|
||||
echo 2 >$dev/device/queue_depth
|
||||
done
|
||||
|
||||
unset _ata dev
|
||||
unset dev
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# disk/scripts/adp.start
|
||||
#
|
||||
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S120 -B230 -M254 $ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# disk/scripts/bat.start
|
||||
#
|
||||
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S120 -B210 -M230 $ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# disk/scripts/dyn.start
|
||||
#
|
||||
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S180 -B254 -M254 $ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# disk/scripts/quiet.start
|
||||
#
|
||||
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S120 -B200 -M200 $ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -2,19 +2,11 @@
|
||||
# disk/scripts/adp.start
|
||||
#
|
||||
|
||||
function _usb {
|
||||
source "$usb_bash"
|
||||
}
|
||||
_usb
|
||||
|
||||
function _ata {
|
||||
source "$ata_bash"
|
||||
}
|
||||
ata=$(_ata)
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S120 -B230 -M254 $ata
|
||||
|
||||
unset _ata _usb ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -2,19 +2,11 @@
|
||||
# disk/scripts/bat.start
|
||||
#
|
||||
|
||||
function _usb {
|
||||
source "$usb_bash"
|
||||
}
|
||||
_usb
|
||||
|
||||
function _ata {
|
||||
source "$ata_bash"
|
||||
}
|
||||
ata=$(_ata)
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S120 -B210 -M230 $ata
|
||||
|
||||
unset _ata _usb ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -2,19 +2,11 @@
|
||||
# disk/scripts/dyn.start
|
||||
#
|
||||
|
||||
function _usb {
|
||||
source "$usb_bash"
|
||||
}
|
||||
_usb
|
||||
|
||||
function _ata {
|
||||
source "$ata_bash"
|
||||
}
|
||||
ata=$(_ata)
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S180 -B254 -M254 $ata
|
||||
|
||||
unset _ata _usb ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -2,19 +2,11 @@
|
||||
# disk/scripts/quiet.start
|
||||
#
|
||||
|
||||
function _usb {
|
||||
source "$usb_bash"
|
||||
}
|
||||
_usb
|
||||
|
||||
function _ata {
|
||||
source "$ata_bash"
|
||||
}
|
||||
ata=$(_ata)
|
||||
usb.bash
|
||||
|
||||
ata="$(ata.bash)"
|
||||
[[ "$ata" ]] && hdparm -q -S120 -B200 -M200 $ata
|
||||
|
||||
unset _ata _usb ata
|
||||
unset ata
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
adp
|
||||
@@ -1,5 +0,0 @@
|
||||
adp
|
||||
bat
|
||||
dyn
|
||||
med
|
||||
quiet
|
||||
@@ -1,17 +0,0 @@
|
||||
#
|
||||
# power/ptest
|
||||
#
|
||||
|
||||
local state="$(echo /sys/class/power_supply/A*)"
|
||||
|
||||
if test -n "$state" -a -r "$state"; then
|
||||
state=$(< "$state")
|
||||
case "$state" in
|
||||
(1) echo "adp";;
|
||||
(0) echo "bat";;
|
||||
esac
|
||||
fi
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1 +1 @@
|
||||
AC
|
||||
adp
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
AC
|
||||
Medium
|
||||
Battery
|
||||
Dynamic
|
||||
adp
|
||||
bat
|
||||
dyn
|
||||
med
|
||||
quiet
|
||||
|
||||
29
hprofile/profiles/power/ptest
Executable file → Normal file
29
hprofile/profiles/power/ptest
Executable file → Normal file
@@ -1,22 +1,17 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# power/ptest
|
||||
#
|
||||
|
||||
# This script should echo only the name of the profile that should be used
|
||||
# It should assume it is called before any other scripts. In particular, it
|
||||
# cannot rely on environment variables set in /etc/profile or elsewhere. The
|
||||
# script may assume it will be run as root.
|
||||
local state="$(echo /sys/class/power_supply/A*)"
|
||||
|
||||
profile="AC"
|
||||
|
||||
if test -f /proc/acpi/ac_adapter/AC0/state ; then
|
||||
status="$(cat /proc/acpi/ac_adapter/AC0/state)"
|
||||
case "${status}" in
|
||||
*on-line)
|
||||
profile="AC"
|
||||
;;
|
||||
*off-line)
|
||||
profile="Battery"
|
||||
;;
|
||||
if test -n "$state" -a -r "$state"; then
|
||||
state=$(< "$state")
|
||||
case "$state" in
|
||||
(1) echo "adp";;
|
||||
(0) echo "bat";;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "${profile}"
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#
|
||||
# vga/post-start
|
||||
#
|
||||
|
||||
[[ -x /etc/init.d/consolefont ]] &&
|
||||
/etc/init.d/consolefont restart
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -2,6 +2,7 @@
|
||||
# vga/post-start
|
||||
#
|
||||
|
||||
[[ -x /etc/init.d/consolefont ]] &&
|
||||
/etc/init.d/consolefont restart
|
||||
|
||||
#
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# vga/scripts/fglrx.start
|
||||
#
|
||||
|
||||
modprobe uvesafb > /dev/null 2>&1
|
||||
modprobe ${1} || die "Failed to insert ${1} kernel module"
|
||||
|
||||
[[ $(eselect opengl show) != ati ]] && eselect opengl set ati
|
||||
[[ $(eselect xvmc show) != ati ]] && eselect xvmc set ati
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# vga/scripts/fglrx.stop
|
||||
#
|
||||
|
||||
rmmod ${1} || die "Failed to remove ${1} module"
|
||||
#
|
||||
# FIXME: Is this necessary? Comment out if necessary.
|
||||
#
|
||||
rmmod uvesafb > /dev/null 2>&1
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,25 +0,0 @@
|
||||
#
|
||||
# vga/scripts/nouveau.stop
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# FIXME: Comment out & edit if necessary to unload
|
||||
# nouveau/drm/kms/ttm i.e. to be able to load nVidia.
|
||||
#
|
||||
if [[ ! -e sys/kernel/debug/vgaswitcheroo/switch ]]; then
|
||||
echo 0 >/sys/class/vtconsole/vtcon1/bind
|
||||
if ! rmmod nouveau; then
|
||||
die "Failed to remove ${1} kernel module"
|
||||
else
|
||||
[[ -x /etc/init.d/consolefont ]] &&
|
||||
/etc/init.d/consolefont restart
|
||||
rmmod ttm
|
||||
rmmod drm_kms_helper
|
||||
rmmod dri
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,12 +0,0 @@
|
||||
#
|
||||
# vga/scripts/nvidia.start
|
||||
#
|
||||
|
||||
modprobe uvesafb > /dev/null 2>&1
|
||||
modprobe ${1} || die "Failed to insert ${1} kernel module"
|
||||
|
||||
[[ $(eselect opengl show) != ${1} ]] && eselect opengl set ${1}
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,10 +0,0 @@
|
||||
#
|
||||
# vga/scripts/nvidia.stop
|
||||
#
|
||||
|
||||
rmmod ${1} || die "Failed to remove ${1} kernel module"
|
||||
rmmod uvesafb > /dev/null 2>&1
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,20 +0,0 @@
|
||||
#
|
||||
# vga/scripts/radeon.start
|
||||
#
|
||||
|
||||
modprobe ${1} || die "Failed to insert ${1} kernel module"
|
||||
|
||||
if [[ -e /sys/kernel/debug/vgaswitcheroo/switch ]]; then
|
||||
echo DIS >/sys/kernel/debug/vgaswitcheroo/switch
|
||||
# echo OFF >/sys/kernel/debug/vgaswitcheroo/switch
|
||||
fi
|
||||
|
||||
echo low >/sys/class/drm/card0/device/power_profile
|
||||
[[ $(eselect opengl show) != xorg-x11 ]] && eselect opengl set xorg-x11
|
||||
[[ $(eselect xvmc show) != xorg-x11 ]] && eselect xvmc set xorg-x11
|
||||
echo profile >/sys/class/drm/card0/power_method # or 'dynpm'
|
||||
echo auto >/sys/class/drm/card0/power_profile # or 'low|mid'
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -1,25 +0,0 @@
|
||||
#
|
||||
# vga/scripts/radeon.stop
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# FIXME: Comment in & edit if necessary to unload
|
||||
# radeon/drm/kms/ttm i.e. to be able to load Fglrx.
|
||||
#
|
||||
if [[ ! -e sys/kernel/debug/vgaswitcheroo/switch ]]; then
|
||||
# echo 0 >/sys/class/vtconsole/vtcon1/bind
|
||||
if ! rmmod radeon; then
|
||||
echo "Failed to remove ${1} module"
|
||||
else
|
||||
[[ -x /etc/init.d/consolefont ]] &&
|
||||
/etc/init.d/consolefont restart
|
||||
# rmmod ttm
|
||||
# rmmod drm_kms_helper
|
||||
# rmmod dri
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
#
|
||||
@@ -2,6 +2,7 @@
|
||||
# vga/scripts/fglrx.start
|
||||
#
|
||||
|
||||
modprobe uvesafb > /dev/null 2>&1
|
||||
modprobe ${1} || die "Failed to insert ${1} kernel module"
|
||||
|
||||
[[ $(eselect opengl show) != ati ]] && eselect opengl set ati
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
# vga/scripts/fglrx.stop
|
||||
#
|
||||
|
||||
rmmod ${1} || die "failed to remove ${1} module"
|
||||
rmmod ${1} || die "Failed to remove ${1} module"
|
||||
#
|
||||
# FIXME: Is this necessary? Comment out if necessary.
|
||||
#
|
||||
rmmod uvesafb > /dev/null 2>&1
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -3,13 +3,16 @@
|
||||
#
|
||||
|
||||
|
||||
# Uncomment the following line and last one if one need
|
||||
# to force remove nouveau/kms driver for e.g. nvidia
|
||||
#
|
||||
# FIXME: Comment out & edit if necessary to unload
|
||||
# nouveau/drm/kms/ttm i.e. to be able to load nVidia.
|
||||
#
|
||||
if [[ ! -e sys/kernel/debug/vgaswitcheroo/switch ]]; then
|
||||
echo 0 >/sys/class/vtconsole/vtcon1/bind
|
||||
if ! rmmod nouveau; then
|
||||
die "Failed to remove nouveau kernel module"
|
||||
die "Failed to remove ${1} kernel module"
|
||||
else
|
||||
[[ -x /etc/init.d/consolefont ]] &&
|
||||
/etc/init.d/consolefont restart
|
||||
rmmod ttm
|
||||
rmmod drm_kms_helper
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# vga/scripts/nvidia.start
|
||||
#
|
||||
|
||||
modprobe uvesafb > /dev/null 2>&1
|
||||
modprobe ${1} || die "Failed to insert ${1} kernel module"
|
||||
|
||||
[[ $(eselect opengl show) != ${1} ]] && eselect opengl set ${1}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
rmmod ${1} || die "Failed to remove ${1} kernel module"
|
||||
rmmod uvesafb > /dev/null 2>&1
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -12,8 +12,8 @@ fi
|
||||
echo low >/sys/class/drm/card0/device/power_profile
|
||||
[[ $(eselect opengl show) != xorg-x11 ]] && eselect opengl set xorg-x11
|
||||
[[ $(eselect xvmc show) != xorg-x11 ]] && eselect xvmc set xorg-x11
|
||||
echo profile >/sys/class/drm/card0/device/power_method # or 'dynpm'
|
||||
echo auto >/sys/class/drm/card0/device/power_profile # or 'low|mid'
|
||||
echo profile >/sys/class/drm/card0/power_method # or 'dynpm'
|
||||
echo auto >/sys/class/drm/card0/power_profile # or 'low|mid'
|
||||
|
||||
#
|
||||
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
#
|
||||
|
||||
|
||||
# Comment the following line and uncomment the other lines
|
||||
# to force remove nouveau/kms driver for e.g. fglrx
|
||||
#
|
||||
# FIXME: Comment in & edit if necessary to unload
|
||||
# radeon/drm/kms/ttm i.e. to be able to load Fglrx.
|
||||
#
|
||||
if [[ ! -e sys/kernel/debug/vgaswitcheroo/switch ]]; then
|
||||
# echo 0 >/sys/class/vtconsole/vtcon1/bind
|
||||
if ! rmmod nouveau; then
|
||||
echo "failed to remove fglrx module"
|
||||
if ! rmmod radeon; then
|
||||
echo "Failed to remove ${1} module"
|
||||
else
|
||||
[[ -x /etc/init.d/consolefont ]] &&
|
||||
/etc/init.d/consolefont restart
|
||||
|
||||
Reference in New Issue
Block a user