**NOTE: if you're using kernel 3.19 or higher, then you only need to apply the camera patch if you want the cameras working. DON'T apply the Type Cover 3 patch if you're on 3.19 or higher as the Type Cover 3 is supported out-of-the-box.
_First off: what's important here is that I've based it off of my experience on Antergos. Antergos uses sudo by default. Pure Arch doesn't use sudo by default so you have to change to the root user. That means that the commands I'm giving in this how-to need to be copy and pasted w/o the sudo part if you're not on Antergos or haven't set up sudo on pure Arch. Also, this howto is as generic as possible so that you can use it for the foreseeable future._
1 Downloading the kernel
First, start by getting the kernel sources. You can do so by downloading the appropriate kernel from the kernel.org website: https://www.kernel.org/
Always choose the newest stable one (or rc one if you're a tad more adventurous). You can also choose the newest longterm one as long as it has a version number higher than 3.16
Unpack the folder in the archive to a folder of your liking where you can easily reach it.
2 Patching it up
In the kernel source folder, create a new typecover3.patch file with the following content:
Now open up a terminal window and change to the kernel source directory using the cd command.
Now apply the Type Cover 3 patch using the following command:
patch -p1 --ignore-whitespace -i typecover3.patch
(on the 3.18 kernel, you might get a small error after doing that, you can ignore that)
3 The actual compiling
Now issue the following command to copy over the current kernel config to the one you're about to compile:
zcat /proc/config.gz > .config
Then:
make menuconfig
If you're not an advanced user like me, just leave everything as it is and save the file using the corresponding button, then use the exit button to exit out of this.
Now that we've done this, the actual compiling can begin. This can take up to an hour so be patient. Issue the command for this:
make -j3
Now that that's done, let's install the modules:
sudo make modules_install
When that's done, do:
make bzImage
followed by:
sudo make install
Now, everything should be in place. Check this by issuing:
cd /boot
followed by:
ls
Note the name of the kernel there. The name of the kernel is the name minus the vmlinuz part. So for example, if you've compiled the 3.18 rc5 kernel, you'll see vmlinuz-3.18.0-rc5-ARCH - _3.18.0-rc5-ARCH_ is the name of the kernel then.
4 Generating the RAM Disk image file
Don't question what it is, just do the following ;-)
In both places in the command, replace fullkernelname with the name you just noted from the /boot folder.
5 Finishing it up
To finish it up, issue the following command:
sudo update-initramfs
followed by the last command (to inform GRUB of the changes - if you use LILO as your bootloader (at least Antergos uses GRUB by default), you don't have to issue this command):
sudo grub-mkconfig -o /boot/grub/grub.cfg
Now reboot and you should be able to choose the kernel in your bootloader. It might take a couple of reboots after compiling before the Type Cover 3 starts working. I don't know why that is, seems like something kernel-related is a bit finicky.
In case the trackpad isn't working (correctly) after rebooting into the patched kernel, add the following to /etc/X11/xorg.conf:
**NOTE: if you're using kernel 3.19 or higher, then you only need to apply the camera patch if you want the cameras working. DON'T apply the Type Cover 3 patch if you're on 3.19 or higher as the Type Cover 3 is supported out-of-the-box.
_First off: what's important here is that I've based it off of my experience on Antergos. Antergos uses sudo by default. Pure Arch doesn't use sudo by default so you have to change to the root user. That means that the commands I'm giving in this how-to need to be copy and pasted w/o the sudo part if you're not on Antergos or haven't set up sudo on pure Arch. Also, this howto is as generic as possible so that you can use it for the foreseeable future._
1 Downloading the kernel First, start by getting the kernel sources. You can do so by downloading the appropriate kernel from the kernel.org website: https://www.kernel.org/ Always choose the newest stable one (or rc one if you're a tad more adventurous). You can also choose the newest longterm one as long as it has a version number higher than 3.16 Unpack the folder in the archive to a folder of your liking where you can easily reach it.
2 Patching it up In the kernel source folder, create a new typecover3.patch file with the following content:
Still in the kernel source folder, open up the following file to add in support for the Surface Pro 3 cameras (rear and front):
Somewhere in between the listed products, for example at line 2342, add the following:
Save the file.
Now open up a terminal window and change to the kernel source directory using the cd command.
Now apply the Type Cover 3 patch using the following command:
(on the 3.18 kernel, you might get a small error after doing that, you can ignore that)
3 The actual compiling
Now issue the following command to copy over the current kernel config to the one you're about to compile:
Then:
If you're not an advanced user like me, just leave everything as it is and save the file using the corresponding button, then use the exit button to exit out of this.
Now that we've done this, the actual compiling can begin. This can take up to an hour so be patient. Issue the command for this:
Now that that's done, let's install the modules:
When that's done, do:
followed by:
Now, everything should be in place. Check this by issuing:
followed by:
Note the name of the kernel there. The name of the kernel is the name minus the vmlinuz part. So for example, if you've compiled the 3.18 rc5 kernel, you'll see vmlinuz-3.18.0-rc5-ARCH - _3.18.0-rc5-ARCH_ is the name of the kernel then.
4 Generating the RAM Disk image file
Don't question what it is, just do the following ;-)
In both places in the command, replace fullkernelname with the name you just noted from the /boot folder.
5 Finishing it up To finish it up, issue the following command:
followed by the last command (to inform GRUB of the changes - if you use LILO as your bootloader (at least Antergos uses GRUB by default), you don't have to issue this command):
Now reboot and you should be able to choose the kernel in your bootloader. It might take a couple of reboots after compiling before the Type Cover 3 starts working. I don't know why that is, seems like something kernel-related is a bit finicky.
In case the trackpad isn't working (correctly) after rebooting into the patched kernel, add the following to /etc/X11/xorg.conf:
and reboot.