First, install the required tools:
Code:
sudo apt-get install fakeroot build-essential
sudo apt-get install crash kexec-tools makedumpfile kernel-wedge
sudo apt-get build-dep linux
sudo apt-get install git-core libncurses5 libncurses5-dev
Then checkout the magicmouse git repository as well as the kernel sources:
Code:
git clone http://github.com/entrope/linux-magicmouse.git
cd linux-magicmouse
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-karmic.git linux-source
cd linux-source
After that, you have to switch to the current kernel release (currently 2.6.31-19.56, see debian.master/changelog):
Code:
git checkout Ubuntu-2.6.31-19.56
Now you are ready to apply the magicmouse patches:
Code:
patch -p1 < ../0001-Export-hid_register_report.patch
patch -p1 < ../0002-Add-a-hid_ll_driver.hid_set_report-function.patch
patch -p1 < ../0003-Add-a-device-driver-for-the-Apple-Magic-Mouse.patch
Create a magicmouse flavour, clean the build directory and regenerate the config file:
Code:
cp debian.master/config/i386/config.flavour.generic debian.master/config/i386/config.flavour.magicmouse
cp debian.master/config/amd64/config.flavour.generic debian.master/config/amd64/config.flavour.magicmouse
fakeroot debian/rules clean
debian.master/scripts/misc/kernelconfig oldconfig
Verify that the magicmouse driver is included in the config:
Code:
grep MAGICMOUSE debian.master/config/config.common.ubuntu
You should see the module name with an "m":
Code:
CONFIG_HID_MAGICMOUSE=m
After that you have to copy some abi files:
Code:
cp debian.master/abi/2.6.31-17.54/i386/generic debian.master/abi/2.6.31-17.54/i386/magicmouse
cp debian.master/abi/2.6.31-17.54/i386/generic.modules debian.master/abi/2.6.31-17.54/i386/magicmouse.modules
cp debian.master/abi/2.6.31-17.54/amd64/generic debian.master/abi/2.6.31-17.54/amd64/magicmouse
cp debian.master/abi/2.6.31-17.54/amd64/generic.modules debian.master/abi/2.6.31-17.54/amd64/magicmouse.modules
We have to add the new flavour to the build process, therefore open the file "debian.master/scripts/misc/getabis" in your favourite text editor and change the following lines
Code:
getall amd64 generic server
getall i386 generic generic-pae 386
to
Code:
getall amd64 generic server magicmouse
getall i386 generic generic-pae 386 magicmouse
Two more files to edit, open "debian.master/rules.d/i386.mk" and change
Code:
flavours = generic generic-pae 386
to
Code:
flavours = generic generic-pae 386 magicmouse
Than open "debian.master/rules.d/amd64.mk" and change
Code:
flavours = generic server
to
Code:
flavours = generic server magicmouse
Last step before you you can start the build, create a description for your flavour:
Code:
cp debian.master/control.d/vars.generic debian.master/control.d/vars.magicmouse
Open the file "debian.master/control.d/vars.magicmouse" and change the target line to something like this:
Code:
target="Modified for Apples Magic Mouse."
Finally you are ready to build your new kernel (this takes a while...):
Code:
fakeroot debian/rules clean
skipabi=true skipmodule=true fakeroot debian/rules binary-magicmouse
skipabi=true skipmodule=true fakeroot debian/rules binary-indep
If everything works fine, you should get some Debian packages in the parent directory. You have to install both header packages and the image itself:
Code:
cd ..
dpkg -i linux-headers*.deb linux-image*.deb
Now reboot and hopefully get your mouse working
Bookmarks