diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-laptop/i8kutils/files | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-laptop/i8kutils/files')
-rw-r--r-- | app-laptop/i8kutils/files/i8k.conf | 31 | ||||
-rw-r--r-- | app-laptop/i8kutils/files/i8k.init-r1 | 50 | ||||
-rw-r--r-- | app-laptop/i8kutils/files/i8kmon.service | 9 | ||||
-rw-r--r-- | app-laptop/i8kutils/files/i8kutils-1.42-Makefile.patch | 34 | ||||
-rw-r--r-- | app-laptop/i8kutils/files/i8kutils-gcc5.patch | 28 |
5 files changed, 152 insertions, 0 deletions
diff --git a/app-laptop/i8kutils/files/i8k.conf b/app-laptop/i8kutils/files/i8k.conf new file mode 100644 index 000000000000..c5bd389b294a --- /dev/null +++ b/app-laptop/i8kutils/files/i8k.conf @@ -0,0 +1,31 @@ +# Config file for /etc/init.d/i8k + +# Parameters: +# +# i8kbuttons Parameters +# ===================== +# VOLUME_UP : command for i8kbuttons to run on volume up key +# VOLUME_DOWN : command for i8kbuttons to run on volume down key +# VOLUME_MUTE : command for i8kbuttons to run on mute key +# BUTTON_REPEAT : repeat rate, in milliseconds, for i8kbuttons keypresses +# +# If VOLUME_* commands are not defined, i8kbuttons will not be started +# +# i8kmon Parameters +# ================= +# NOMON : if set, i8kmon will not be started +# NOAUTO : if set, i8kmon will not control the fans +# TIMEOUT : timeout, in seconds, at which i8kmon will check/update status +# (default is 2) + +# for ALSA +MIXER="/usr/bin/amixer -q set Master" +VOLUME_UP="$MIXER 1+" +VOLUME_DOWN="$MIXER 1-" +VOLUME_MUTE="$MIXER toggle" + +# for aumix (no mute support) +#VOLUME_UP="aumix -v +4" +#VOLUME_DOWN="aumix -v -4" + +BUTTON_REPEAT=100 diff --git a/app-laptop/i8kutils/files/i8k.init-r1 b/app-laptop/i8kutils/files/i8k.init-r1 new file mode 100644 index 000000000000..1e1cb7ca0c94 --- /dev/null +++ b/app-laptop/i8kutils/files/i8k.init-r1 @@ -0,0 +1,50 @@ +#!/sbin/openrc-run + +depend() { + after alsasound + after modules +} + +checkconfig() { + if [ ! -e /proc/i8k ] ; then + eerror "The i8k driver is not installed" + return 1 + fi +} + +start() { + checkconfig || return 1 + if [ -n "$VOLUME_UP$VOLUME_DOWN$VOLUME_MUTE" ] ; then + ebegin "Starting i8kbuttons" + start-stop-daemon --start --quiet --pidfile /var/run/i8kbuttons.pid \ + --make-pidfile --exec /usr/bin/i8kbuttons --background \ + -- ${VOLUME_UP:+-u "${VOLUME_UP}"} \ + ${VOLUME_DOWN:+-d "$VOLUME_DOWN"} \ + ${VOLUME_MUTE:+-m "$VOLUME_MUTE"} \ + ${BUTTON_REPEAT:+-r "$BUTTON_REPEAT"} + eend $? + fi + if [ ! -n "$NOMON" ]; then + ebegin "Starting i8kmon" + start-stop-daemon --start -b --quiet \ + --pidfile /var/run/i8kmon.pid \ + --make-pidfile \ + --exec /usr/bin/i8kmon --background \ + --name "tclsh /usr/bin/i8kmon" \ + -- -d ${NOAUTO:+-na} ${TIMEOUT:+-t $TIMEOUT} + eend $? + fi +} + +stop() { + if [ -n "$VOLUME_UP$VOLUME_DOWN$VOLUME_MUTE" ] ; then + ebegin "Stopping i8kbuttons" + start-stop-daemon --stop --quiet --pidfile /var/run/i8kbuttons.pid + eend $? + fi + if [ ! -n "$NOMON" ]; then + ebegin "Stopping i8kmon" + start-stop-daemon --stop --quiet --pidfile /var/run/i8kmon.pid + eend $? + fi +} diff --git a/app-laptop/i8kutils/files/i8kmon.service b/app-laptop/i8kutils/files/i8kmon.service new file mode 100644 index 000000000000..3b80f46334af --- /dev/null +++ b/app-laptop/i8kutils/files/i8kmon.service @@ -0,0 +1,9 @@ +[Unit] +Description=Dell laptop thermal monitoring +ConditionPathExists=/proc/i8k + +[Service] +ExecStart=/usr/bin/i8kmon -d + +[Install] +WantedBy=multi-user.target diff --git a/app-laptop/i8kutils/files/i8kutils-1.42-Makefile.patch b/app-laptop/i8kutils/files/i8kutils-1.42-Makefile.patch new file mode 100644 index 000000000000..7dc56d91aa3e --- /dev/null +++ b/app-laptop/i8kutils/files/i8kutils-1.42-Makefile.patch @@ -0,0 +1,34 @@ +Fix a race condition causing parallel builds to sometimes fail. + +Both probe_i8k_calls_time and i8kctl contain a main() function, though +i8kctl's is omitted when built with -DLIB so they can link without a +conflict. i8kctl is also a standalone exe so it is built twice, with +and without -DLIB. When building in parallel you can get into a +situation where the object file created by the probe_i8k_calls_time +target gets overwritten with the one from i8kctl and bad things happen. +Nothing actually uses the i8kctl.o that has main() so we can just not +build it. + +Also move CFLAGS, CC, LDFLAGS respect out of the ebuild. + +--- a/Makefile ++++ b/Makefile +@@ -17,13 +17,13 @@ ccflags-y = -Wall + + all: i8kctl probe_i8k_calls_time + +-i8kctl: i8kctl.c i8kctl.o +- gcc -Wall i8kctl.c -o i8kctl ++i8kctl: i8kctl.c ++ $(CC) -Wall ${CFLAGS} -o i8kctl i8kctl.c + + probe_i8k_calls_time: probe_i8k_calls_time.c +- gcc -Wall -c -g -DLIB i8kctl.c +- gcc -Wall -c -g -DLIB probe_i8k_calls_time.c +- gcc -o probe_i8k_calls_time i8kctl.o probe_i8k_calls_time.o ++ $(CC) -Wall ${CFLAGS} -c -DLIB i8kctl.c ++ $(CC) -Wall ${CFLAGS} -c -DLIB probe_i8k_calls_time.c ++ $(CC) -Wall ${CFLAGS} ${LDFLAGS} -o probe_i8k_calls_time i8kctl.o probe_i8k_calls_time.o + + i8k: + make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules diff --git a/app-laptop/i8kutils/files/i8kutils-gcc5.patch b/app-laptop/i8kutils/files/i8kutils-gcc5.patch new file mode 100644 index 000000000000..258b95f595f6 --- /dev/null +++ b/app-laptop/i8kutils/files/i8kutils-gcc5.patch @@ -0,0 +1,28 @@ +Fix build with GCC 5. + +x86_64-pc-linux-gnu-gcc -O2 -march=native -g -pipe -c -o i8kctl.o i8kctl.c +gcc -Wall -c -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -DLIB i8kctl.c +gcc -Wall -c -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -DLIB probe_i8k_calls_time.c +gcc -o probe_i8k_calls_time i8kctl.o probe_i8k_calls_time.o +probe_i8k_calls_time.o: In function `main': +probe_i8k_calls_time.c:(.text+0x62): undefined reference to `timestamp' +probe_i8k_calls_time.c:(.text+0x82): undefined reference to `timestamp' +probe_i8k_calls_time.c:(.text+0xa2): undefined reference to `timestamp' +probe_i8k_calls_time.c:(.text+0xbf): undefined reference to `timestamp' +probe_i8k_calls_time.c:(.text+0xdc): undefined reference to `timestamp' +probe_i8k_calls_time.o:probe_i8k_calls_time.c:(.text+0xf9): more undefined references to `timestamp' follow +collect2: error: ld returned 1 exit status +Makefile:24: recipe for target 'probe_i8k_calls_time' failed + + +--- a/probe_i8k_calls_time.c ++++ b/probe_i8k_calls_time.c +@@ -13,7 +13,7 @@ double t; + + struct timespec tmst; + +-inline double timestamp() ++double timestamp() + { + clock_gettime(CLOCK_REALTIME, &tmst); + t = tmst.tv_nsec; |