linux-surface/README.md

157 lines
5.8 KiB
Markdown
Raw Normal View History

# Linux Surface
Linux running on the Surface Book, Surface Book 2, Surface Pro 3, Surface Pro 4, Surface Pro 2017 and Surface Laptop. Follow the instructions below to install the latest kernel and config files.
### What's Working
* Keyboard (and backlight) (not yet working for Surface Laptop)
2017-08-20 23:33:32 +00:00
* Touchpad
* 2D/3D Acceleration
* Touchscreen
* Pen
2017-08-20 23:33:32 +00:00
* WiFi
* Bluetooth
* Speakers
* Power Button (not yet working for SB2/SP2017)
* Volume Buttons (not yet working for SB2/SP2017)
2017-08-20 23:33:32 +00:00
* SD Card Reader
2017-11-19 13:06:23 +00:00
* Cameras (partial support, disabled for now)
* Hibernate
2017-08-20 23:33:32 +00:00
* Sensors (accelerometer, gyroscope, ambient light sensor)
* Battery Readings (not yet working for SB2/SP2017)
2017-11-09 02:47:57 +00:00
* Docking/Undocking Tablet and Keyboard
* DisplayPort
* Dedicated Nvidia GPU (Surface Book 2)
### What's NOT Working
* Dedicated Nvidia GPU (if you have a performance base on a Surface Book 1, otherwise onboard works fine)
2017-08-20 23:33:32 +00:00
* Cameras (not fully supported yet)
* Suspend (uses Connected Standby which is not supported yet)
### Notes on What's Working
* For the most part, things are tested on a Surface Book. While most things are reportedly fully working on other devices, your mileage may vary. Please look at the issues list for possible exceptions.
2017-11-19 13:06:23 +00:00
2017-11-03 23:51:05 +00:00
### Download Pre-built Kernel and Headers
2018-03-17 23:37:35 +00:00
Downloads for ubuntu based distros (other distros will need to compile from source using the included patches):
2018-02-21 20:06:38 +00:00
https://github.com/jakeday/linux-surface/releases
2017-11-03 23:51:05 +00:00
You will need to download both the image and headers deb files for the version you want to install.
### Instructions
For the ipts_firmware files (series 4/5 devices only), please select the version for your device.
2017-11-13 02:24:26 +00:00
* v76 for the Surface Book
* v78 for the Surface Pro 4
* v79 for the Surface Laptop
* v101 for Surface Book 2 15"
2017-11-13 02:24:26 +00:00
* v102 for the Surface Pro 2017
* v137 for the Surface Book 2 13"
2017-11-09 02:47:57 +00:00
For the i915_firmware files (series 3/4/5 devices only), please select the version for your device.
2018-02-02 03:34:56 +00:00
* kbl for series 5 devices (Surface Book 2, Surface Pro 2017)
* skl for series 4 devices (Surface Book, Surface Pro 4, Surface Laptop)
* bxt for series 3 devices (Surface Pro 3)
2018-03-24 19:40:27 +00:00
2017-08-20 23:33:32 +00:00
1. Copy the files under root to where they belong:
2018-03-24 19:40:27 +00:00
```
sudo cp -R root/* /
```
2018-04-01 17:23:07 +00:00
2. Make /lib/systemd/system-sleep/hibernate as executable:
2018-03-24 19:40:27 +00:00
```
2018-04-01 17:23:07 +00:00
sudo chmod a+x /lib/systemd/system-sleep/hibernate
2018-03-24 19:40:27 +00:00
```
3. (Series 4/5 only) Extract ipts_firmware_[VERSION].zip to /lib/firmware/intel/ipts/
2018-03-24 19:40:27 +00:00
```
sudo mkdir -p /lib/firmware/intel/ipts
sudo unzip firmware/ipts_firmware_[VERSION].zip -d /lib/firmware/intel/ipts/
```
4. (Series 3/4/5 only) Extract i915_firmware_[VERSION].zip to /lib/firmware/i915/
2018-03-24 19:40:27 +00:00
```
sudo mkdir -p /lib/firmware/i915
sudo unzip firmware/i915_firmware_[VERSION].zip -d /lib/firmware/i915/
```
2018-04-18 23:02:35 +00:00
5. (Surface Book 2 only) Extract nvidia_firmware_gp108.zip to /lib/firmware/nvidia/gp108/
```
sudo mkdir -p /lib/firmware/nvidia/gp108
sudo unzip firmware/nvidia_firmware_gp108.zip -d /lib/firmware/nvidia/gp108/
```
6. (Ubuntu 17.10) Fix issue with Suspend to Disk:
2018-03-24 19:40:27 +00:00
```
sudo ln -s /lib/systemd/system/hibernate.target /etc/systemd/system/suspend.target && sudo ln -s /lib/systemd/system/systemd-hibernate.service /etc/systemd/system/systemd-suspend.service
```
2018-04-18 23:02:35 +00:00
7. (all other distros) Fix issue with Suspend to Disk:
2018-03-24 19:40:27 +00:00
```
sudo ln -s /usr/lib/systemd/system/hibernate.target /etc/systemd/system/suspend.target && sudo ln -s /usr/lib/systemd/system/systemd-hibernate.service /etc/systemd/system/systemd-suspend.service
```
2018-04-18 23:02:35 +00:00
8. Install the latest marvell firmware (if their repo is down, use my copy at https://github.com/jakeday/mwifiex-firmware):
2018-03-24 19:40:27 +00:00
```
git clone git://git.marvell.com/mwifiex-firmware.git
sudo mkdir -p /lib/firmware/mrvl/
sudo cp mwifiex-firmware/mrvl/* /lib/firmware/mrvl/
```
2018-04-18 23:02:35 +00:00
9. Install the custom kernel and headers (or follow the steps for compiling the kernel from source below):
2018-03-24 19:40:27 +00:00
```
2018-04-17 23:57:04 +00:00
sudo dpkg -i linux-headers-[VERSION].deb linux-image-[VERSION].deb linux-libc-dev-[VERSION].deb
2018-03-24 19:40:27 +00:00
```
2018-04-18 23:02:35 +00:00
10. Reboot on installed kernel.
2017-11-14 17:59:55 +00:00
### NOTES
2017-12-10 00:36:13 +00:00
* If you are getting stuck at boot when loading the ramdisk, you need to install the Processor Microcode Firmware for Intel CPUs (usually found under Additional Drivers in Software and Updates).
* If you are having issues with the position of the cursor matching the pen/stylus, you'll need to update your libwacom as mentioned here: https://github.com/jakeday/linux-surface/issues/46
2017-10-20 20:28:57 +00:00
### Compiling the Kernel from Source
If you don't want to use the pre-built kernel and headers, you can compile the kernel yourself following these steps:
2018-03-09 03:30:36 +00:00
0. (Prep) Install the required packages for compiling the kernel:
2018-03-24 19:40:27 +00:00
```
sudo apt-get install build-essential binutils-dev libncurses5-dev libssl-dev ccache bison flex
```
1. Assuming you cloned the linux-surface repo (this one) into ~/linux-surface, go to the parent directory:
2018-03-24 19:40:27 +00:00
```
cd ~
```
2. Clone the mainline stable kernel repo:
2018-03-24 19:40:27 +00:00
```
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
```
3. Go into the linux-stable directory:
2018-03-24 19:40:27 +00:00
```
cd linux-stable
```
4. Checkout the version of the kernel you wish to target (replacing with your target version):
2018-03-24 19:40:27 +00:00
```
git checkout v4.y.z
```
5. Apply the kernel patches from the linux-surface repo (this one):
2018-03-24 19:40:27 +00:00
```
for i in ~/linux-surface/patches/[VERSION]/*.patch; do patch -p1 < $i; done
```
2018-04-10 17:04:54 +00:00
6. Get current config file and patch it:
2018-03-24 19:40:27 +00:00
```
2018-04-10 17:04:54 +00:00
cat /boot/config-$(uname -r) > .config
patch -p1 < ~/linux-surface/patches/config.patch
2018-03-24 19:40:27 +00:00
```
7. Compile the kernel and headers (for ubuntu, refer to the build guild for your distro):
2018-03-24 19:40:27 +00:00
```
make -j \`getconf _NPROCESSORS_ONLN\` deb-pkg LOCALVERSION=-linux-surface
```
8. Install the kernel and headers:
2018-03-24 19:40:27 +00:00
```
2018-04-18 23:07:05 +00:00
sudo dpkg -i linux-headers-[VERSION].deb linux-image-[VERSION].deb linux-libc-dev-[VERSION].deb
2018-03-24 19:40:27 +00:00
```
### Donations Appreciated!
2017-11-05 18:57:52 +00:00
PayPal: https://www.paypal.me/jakeday42
2017-08-20 23:33:32 +00:00
2017-12-10 00:36:29 +00:00
Bitcoin: 1AH7ByeJBjMoAwsgi9oeNvVLmZHvGoQg68