linux-surface/README.md

128 lines
4.2 KiB
Markdown
Raw Normal View History

# Linux Surface
2018-10-23 13:41:02 +00:00
Linux running on the Surface Book, Surface Book 2, Surface Go, Surface Pro 3, Surface Pro 4, Surface Pro 2017, Surface Pro 6, Surface Laptop and Surface Laptop 2. Follow the instructions below to install the latest kernel and config files.
### What's Working
2018-12-30 14:10:29 +00:00
* Keyboard (and backlight)
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
* Volume Buttons
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
2018-04-19 01:04:30 +00:00
* Surface Docks
* DisplayPort
2018-04-19 01:04:30 +00:00
* USB-C (including for HDMI Out)
* 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)
2018-04-19 01:04:30 +00:00
### Disclaimer
* 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
2018-04-19 01:04:30 +00:00
You will need to download the image, headers and libc-dev deb files for the version you want to install.
### Instructions
0. (Prep) Install Dependencies:
2018-03-24 19:40:27 +00:00
```
sudo apt install git curl wget sed
2018-03-24 19:40:27 +00:00
```
2018-04-29 23:36:59 +00:00
1. Clone the linux-surface repo:
2018-03-24 19:40:27 +00:00
```
git clone --depth 1 https://github.com/jakeday/linux-surface.git ~/linux-surface
2018-03-24 19:40:27 +00:00
```
2018-04-29 23:36:59 +00:00
2. Change directory to linux-surface repo:
2018-03-24 19:40:27 +00:00
```
2018-04-29 23:36:59 +00:00
cd ~/linux-surface
2018-03-24 19:40:27 +00:00
```
2018-04-29 23:36:59 +00:00
3. Run setup script:
2018-03-24 19:40:27 +00:00
```
2018-04-29 23:36:59 +00:00
sudo sh setup.sh
2018-03-24 19:40:27 +00:00
```
4. Reboot on installed kernel.
The setup script will handle installing the latest kernel for you. You can also choose to download any version you want and install yourself:
Install the headers, kernel and libc-dev (make sure you cd to your download location first):
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
```
### Compiling the Kernel from Source
2019-01-02 16:43:27 +00:00
#### For Debian-Based Systems
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
```
2018-07-14 13:28:56 +00:00
sudo apt install build-essential binutils-dev libncurses5-dev libssl-dev ccache bison flex libelf-dev
2018-03-24 19:40:27 +00:00
```
1. 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 ~/linux-stable
2018-03-24 19:40:27 +00:00
```
2. Go into the linux-stable directory:
2018-03-24 19:40:27 +00:00
```
cd ~/linux-stable
2018-03-24 19:40:27 +00:00
```
3. 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
```
4. Apply the kernel patches from the linux-surface repo (this one, and assuming you cloned it to ~/linux-surface):
2018-03-24 19:40:27 +00:00
```
for i in ~/linux-surface/patches/[VERSION]/*.patch; do patch -p1 < $i; done
```
2018-12-31 00:30:51 +00:00
5. Use config for kernel series (may need to manually change for your distro):
2018-03-24 19:40:27 +00:00
```
2018-12-31 00:30:51 +00:00
cp ~/linux-surface/configs/[VERSION]/config .config
2018-03-24 19:40:27 +00:00
```
6. Compile the kernel and headers (for ubuntu, refer to the build guide for your distro):
2018-03-24 19:40:27 +00:00
```
2018-07-14 13:28:56 +00:00
make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-linux-surface
2018-03-24 19:40:27 +00:00
```
7. Install the headers, kernel and libc-dev:
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
```
2019-01-02 16:43:27 +00:00
#### For Arch-Based Systems
Have a look at [this](https://github.com/dmhacker/arch-linux-surface) repository.
2018-09-01 12:28:40 +00:00
### Signing the kernel for Secure Boot
Please consult the [SIGNING.md](SIGNING.md).
2018-09-01 12:28:40 +00:00
2018-04-19 01:04:30 +00:00
### NOTES
* 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).
2018-06-07 02:16:03 +00:00
* Do not install TLP! It can cause slowdowns, laggy performance, and occasional hangs! You have been warned.
2018-04-19 01:04:30 +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