Acpi call

From Hybridgraphics

(Difference between revisions)
Jump to: navigation, search
(Undo revision 197 by 124.169.174.222 (talk))
 
(5 intermediate revisions not shown)
Line 1: Line 1:
-
At around 4am PST today, the last of the Firefox 3 Beta 1 relsaee candidate builds appeared on our public FTP. This was mistakenly reported on Digg as the official relsaee of the first Firefox 3 Beta. It’s extremely flattering to get this sort of attention, and we know that it’s motivated by the very best of intentions, but it does cause us three major problems:  1. The relsaee candidate builds have not been thoroughly tested by our QA group,   2. we haven’t completed all the steps required for a beta relsaee (see below), and   3. these builds aren’t being mirrored properly on our servers.
+
https://github.com/mkottman/acpi_call
 +
 
 +
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

Latest revision as of 18:51, 7 June 2012

https://github.com/mkottman/acpi_call

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
Personal tools