Monday, September 1, 2014

Kali 1.09 x64 on Acer c720, Suspend and Touchpad Working!

I finally got both suspend and the touch pad working with kernel 3.14.5, which is in Kali 1.07, 1.08, and 1.09.  Long story short, I compiled a custom kernel to fix suspend.  I also added four patches for the touchpad.  The other patches that have been listed have already been added to the kernel, so they weren't necessary.  These are the steps that I took.  There may be typos.  I tried to capture everything that I did in order.

The kernel patch is here.  The four touchpad patches can be downloaded from: https://patchwork.kernel.org/patch/<patch_number>/raw.  Replace <patch_number> with the patch number.  The patches are:
After getting the five patches, fix the patch to chromeos_laptop.c in the 3074401 and 3074411.  Do a global find and replace for 'x86' and replace with 'chrome'.  Then, download and install linux-source, linux-headers-3.14-kali1-amd64, and kernel-package.

root@kali:~# apt-get install linux-source linux-headers-3.14-kali1-amd64 kernel-package

Unzip the source in /usr/src.
root@kali:/usr/src# tar xpf linux-source-3.14.tar.xz

Go to the source root director and patch the Kali patches.
root@kali:/usr/src/linux-source-3.14# xz -dc ../linux-patch-3.14-rt.patch.xz | patch -p1

Patch the five patches.  Replace <patch> with the path to the patch.  It is easiest if they are copied to the source root directory.
root@kali:/usr/src/linux-source-3.14# patch -p1 <patch> 
   
It's time to build.  This took around 3-4 hours on the chromebook.  Copy in the config from boot and Module.symvers from the linux-headers.  Then compile.  Here are the commands that I used.

root@kali:/usr/src/linux-source-3.14# cp /boot/config-3.14-kali1-amd64 .config
root@kali:/usr/src/linux-source-3.14# cp /usr/src/linux-headers-3.14-kali1-amd64/Module.symvers .
root@kali:/usr/src/linux-source-3.14# make-kpkg clean
root@kali:/usr/src/linux-source-3.14# fakeroot make-kpkg --initrd kernel_image

Wait 3-4 hours...  Once it is done, there will be a new .deb file in /usr/src.  This is the new kernel.  Install it using dpkg.
root@kali:/usr/src# dpkg -install linux-image-3.14.5-rt5_3.14.5-rt5-10.00.Custom_amd64.deb
root@kali:/usr/src/linux-source-3.14# reboot

Ok, now touchpad works, but suspend does not.  Fix grub to add a few commands.  Change /etc/default/grub so that GRUB_CMDLINE_LINUX_DEFAULT is this:

GRUB_CMDLINE_LINUX_DEFAULT="quite splash tpm_tis.force=1 tpm_tis.interrupts=0 modprobe.blacklist=ehci+hcd,ehci_pci nmi_watchdog=0"

Then, rebuild grub with the update-grub command.  Reboot.  Suspend works via power button, but not lid close.

root@kali:~# update-grub
root@kali:~# reboot

Next step is to tweak touchpad settings and try to figure out why lid close doesn't trigger suspend.  It locks the screen, so I know that the lid close event is registered.