From 21bdf79af8ce3c89940b548a3d19bf739795dd14 Mon Sep 17 00:00:00 2001 From: hasufell Date: Thu, 25 Jun 2015 23:10:54 +0200 Subject: [PATCH] saving uncommitted changes in /etc prior to emerge run --- acpi/events/power | 0 hprofile/profiles/disk/._cfg0000_post-start | 17 ++++++++++ .../profiles/disk/scripts/._cfg0000_adp.start | 13 ++++++++ .../profiles/disk/scripts/._cfg0000_bat.start | 13 ++++++++ .../profiles/disk/scripts/._cfg0000_dyn.start | 13 ++++++++ .../disk/scripts/._cfg0000_quiet.start | 13 ++++++++ hprofile/profiles/vga/._cfg0000_post-start | 10 ++++++ .../vga/scripts/._cfg0000_fglrx.start | 13 ++++++++ .../profiles/vga/scripts/._cfg0000_fglrx.stop | 13 ++++++++ .../vga/scripts/._cfg0000_nouveau.stop | 25 ++++++++++++++ .../vga/scripts/._cfg0000_nvidia.start | 12 +++++++ .../vga/scripts/._cfg0000_nvidia.stop | 10 ++++++ .../vga/scripts/._cfg0000_radeon.start | 20 +++++++++++ .../vga/scripts/._cfg0000_radeon.stop | 25 ++++++++++++++ init.d/._cfg0001_hprofile | 33 +++++++++++++++++++ 15 files changed, 230 insertions(+) mode change 100755 => 100644 acpi/events/power create mode 100644 hprofile/profiles/disk/._cfg0000_post-start create mode 100644 hprofile/profiles/disk/scripts/._cfg0000_adp.start create mode 100644 hprofile/profiles/disk/scripts/._cfg0000_bat.start create mode 100644 hprofile/profiles/disk/scripts/._cfg0000_dyn.start create mode 100644 hprofile/profiles/disk/scripts/._cfg0000_quiet.start create mode 100644 hprofile/profiles/vga/._cfg0000_post-start create mode 100644 hprofile/profiles/vga/scripts/._cfg0000_fglrx.start create mode 100644 hprofile/profiles/vga/scripts/._cfg0000_fglrx.stop create mode 100644 hprofile/profiles/vga/scripts/._cfg0000_nouveau.stop create mode 100644 hprofile/profiles/vga/scripts/._cfg0000_nvidia.start create mode 100644 hprofile/profiles/vga/scripts/._cfg0000_nvidia.stop create mode 100644 hprofile/profiles/vga/scripts/._cfg0000_radeon.start create mode 100644 hprofile/profiles/vga/scripts/._cfg0000_radeon.stop create mode 100755 init.d/._cfg0001_hprofile diff --git a/acpi/events/power b/acpi/events/power old mode 100755 new mode 100644 diff --git a/hprofile/profiles/disk/._cfg0000_post-start b/hprofile/profiles/disk/._cfg0000_post-start new file mode 100644 index 0000000..783375b --- /dev/null +++ b/hprofile/profiles/disk/._cfg0000_post-start @@ -0,0 +1,17 @@ +# +# 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: +# diff --git a/hprofile/profiles/disk/scripts/._cfg0000_adp.start b/hprofile/profiles/disk/scripts/._cfg0000_adp.start new file mode 100644 index 0000000..84fa506 --- /dev/null +++ b/hprofile/profiles/disk/scripts/._cfg0000_adp.start @@ -0,0 +1,13 @@ +# +# 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: +# diff --git a/hprofile/profiles/disk/scripts/._cfg0000_bat.start b/hprofile/profiles/disk/scripts/._cfg0000_bat.start new file mode 100644 index 0000000..ff87c9d --- /dev/null +++ b/hprofile/profiles/disk/scripts/._cfg0000_bat.start @@ -0,0 +1,13 @@ +# +# 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: +# diff --git a/hprofile/profiles/disk/scripts/._cfg0000_dyn.start b/hprofile/profiles/disk/scripts/._cfg0000_dyn.start new file mode 100644 index 0000000..2c8891a --- /dev/null +++ b/hprofile/profiles/disk/scripts/._cfg0000_dyn.start @@ -0,0 +1,13 @@ +# +# 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: +# diff --git a/hprofile/profiles/disk/scripts/._cfg0000_quiet.start b/hprofile/profiles/disk/scripts/._cfg0000_quiet.start new file mode 100644 index 0000000..a7c516f --- /dev/null +++ b/hprofile/profiles/disk/scripts/._cfg0000_quiet.start @@ -0,0 +1,13 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/._cfg0000_post-start b/hprofile/profiles/vga/._cfg0000_post-start new file mode 100644 index 0000000..ee91081 --- /dev/null +++ b/hprofile/profiles/vga/._cfg0000_post-start @@ -0,0 +1,10 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/scripts/._cfg0000_fglrx.start b/hprofile/profiles/vga/scripts/._cfg0000_fglrx.start new file mode 100644 index 0000000..ed16893 --- /dev/null +++ b/hprofile/profiles/vga/scripts/._cfg0000_fglrx.start @@ -0,0 +1,13 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/scripts/._cfg0000_fglrx.stop b/hprofile/profiles/vga/scripts/._cfg0000_fglrx.stop new file mode 100644 index 0000000..ff0284e --- /dev/null +++ b/hprofile/profiles/vga/scripts/._cfg0000_fglrx.stop @@ -0,0 +1,13 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/scripts/._cfg0000_nouveau.stop b/hprofile/profiles/vga/scripts/._cfg0000_nouveau.stop new file mode 100644 index 0000000..ebf010e --- /dev/null +++ b/hprofile/profiles/vga/scripts/._cfg0000_nouveau.stop @@ -0,0 +1,25 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/scripts/._cfg0000_nvidia.start b/hprofile/profiles/vga/scripts/._cfg0000_nvidia.start new file mode 100644 index 0000000..db162ac --- /dev/null +++ b/hprofile/profiles/vga/scripts/._cfg0000_nvidia.start @@ -0,0 +1,12 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/scripts/._cfg0000_nvidia.stop b/hprofile/profiles/vga/scripts/._cfg0000_nvidia.stop new file mode 100644 index 0000000..89be080 --- /dev/null +++ b/hprofile/profiles/vga/scripts/._cfg0000_nvidia.stop @@ -0,0 +1,10 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/scripts/._cfg0000_radeon.start b/hprofile/profiles/vga/scripts/._cfg0000_radeon.start new file mode 100644 index 0000000..2c00a3b --- /dev/null +++ b/hprofile/profiles/vga/scripts/._cfg0000_radeon.start @@ -0,0 +1,20 @@ +# +# 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: +# diff --git a/hprofile/profiles/vga/scripts/._cfg0000_radeon.stop b/hprofile/profiles/vga/scripts/._cfg0000_radeon.stop new file mode 100644 index 0000000..e48a0cc --- /dev/null +++ b/hprofile/profiles/vga/scripts/._cfg0000_radeon.stop @@ -0,0 +1,25 @@ +# +# 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: +# diff --git a/init.d/._cfg0001_hprofile b/init.d/._cfg0001_hprofile new file mode 100755 index 0000000..2035540 --- /dev/null +++ b/init.d/._cfg0001_hprofile @@ -0,0 +1,33 @@ +#!/sbin/runscript +# Copyright 2014 tclover +# Distributed under the terms of the GPL-2 license +# $Header: hprofile.initd,v 1.4 2014/10/10 13:05:23 -tclover Exp $ + +description="initialize hprofile boot profiles" + +depend() +{ + after modules +} + +start() +{ + for profile in $PROFILES; do + hprofile -f $profile + eend "$?" "Failed to start $profile profile" + done + return 0 +} + +stop() +{ + for profile in $PROFILES; do + hprofile -s $profile + eend "$?" "Failed to stop $profile profile" + done + return 0 +} + +# +# vim:fenc=utf-8:ft=gentoo-init-d:ci:pi:sts=0:sw=4:ts=4: +#