Acpi call

From Hybridgraphics

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by 207.156.62.237 (talk) to last revision by 124.169.174.222)
(Rocio)
Line 1: Line 1:
-
https://github.com/mkottman/acpi_call
+
Great, thanks! Although, I'm hainvg some weird behaviour with that module. It seems to redo some of the earlier key presses when trying to do something else (e.g. after adjusting volume, trying to adjust screen brightness messes with the volume first). This just as a piece of information for anyone else trying to use the module, I know that you're not the one to complain about bugsAnd btw, great idea with the blog! I just got a new laptop (Asus X73), and had to google solutions for a lot of problems that I had solved already some time ago. Now I'm making those local files for everything I do, but this is a way better solution. Keep up the good work!
-
 
+
-
acpi_call lets you send ACPI commands to turn your optimus nvidia card on or off (the actual commands to send will vary based on your laptop).
+
-
 
+
-
If you get and build the code from the link above, you can build and insert (insmod) the acpi_call module, but you will need to re-insert it after every reboot. In Ubuntu 11.04, you can try using dkms to make this module permanently available.
+
-
 
+
-
1. Install dkms and some useful packages:
+
-
 
+
-
  sudo apt-get install dkms git build-essential
+
-
sudo apt-get install linux-headers-$(uname -r)
+
-
 
+
-
 
+
-
2. Clone the acpi_call repository from git and copy it to where dkms will look for it. We'll call it version 0.0.1 for now:
+
-
 
+
-
git clone http://github.com/mkottman/acpi_call.git
+
-
mkdir /usr/src/acpi_call-0.0.1
+
-
cp -rp acpi_call/* /usr/src/acpi_call-0.0.1
+
-
 
+
-
 
+
-
3. Create a file dkms.conf for it:
+
-
 
+
-
sudo gedit /usr/src/acpi_call-0.0.1/dkms.conf
+
-
 
+
-
and paste this into it and save it:
+
-
 
+
-
PACKAGE_NAME="acpi_call"
+
-
PACKAGE_VERSION="0.0.1"
+
-
CLEAN="make clean"
+
-
BUILT_MODULE_NAME[0]="acpi_call"
+
-
DEST_MODULE_NAME[0]="acpi_call"
+
-
MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir PWD=$dkms_tree/acpi_call/0.0.1/build"
+
-
DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
+
-
AUTOINSTALL="yes"
+
-
 
+
-
 
+
-
4. Edit the Makefile:
+
-
 
+
-
sudo gedit /usr/src/acpi_call-0.0.1/Makefile
+
-
 
+
-
and paste this into it and save it:
+
-
 
+
-
obj-m := acpi_call.o
+
-
+
-
default:
+
-
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+
-
+
-
clean:
+
-
rm acpi_call.mod.o acpi_call.o acpi_call.ko
+
-
 
+
-
 
+
-
5. Add the module to dkms and build and install it:
+
-
 
+
-
sudo dkms add -m acpi_call -v 0.0.1
+
-
sudo dkms build -m acpi_call -v 0.0.1
+
-
sudo dkms install -m acpi_call -v 0.0.1
+
-
 
+
-
If all went well, you should now be able to load the module with:
+
-
 
+
-
sudo modprobe acpi_call
+
-
 
+
-
and this will give some information about it:
+
-
 
+
-
modinfo acpi_call
+
-
 
+
-
 
+
-
Notes:
+
-
 
+
-
* The AUTOINSTALL="yes" line in dkms.conf is supposed to tell dkms to automatically build and install the module if you upgrade the kernel, but if it doesn't work you can manually execute the dkms build and install commands in the new kernel.
+
-
 
+
-
* If you want to remove the module (eg from all kernels), do:
+
-
 
+
-
sudo dkms remove -m acpi_call -v 0.0.1 --all
+

Revision as of 01:24, 7 June 2012

Great, thanks! Although, I'm hainvg some weird behaviour with that module. It seems to redo some of the earlier key presses when trying to do something else (e.g. after adjusting volume, trying to adjust screen brightness messes with the volume first). This just as a piece of information for anyone else trying to use the module, I know that you're not the one to complain about bugs. And btw, great idea with the blog! I just got a new laptop (Asus X73), and had to google solutions for a lot of problems that I had solved already some time ago. Now I'm making those local files for everything I do, but this is a way better solution. Keep up the good work!

Personal tools