Skip to content

Instantly share code, notes, and snippets.

@mikesart
Last active November 29, 2018 04:45
Show Gist options
  • Save mikesart/6e4f5c6e0b00e46f4da9119dce7aa535 to your computer and use it in GitHub Desktop.
Save mikesart/6e4f5c6e0b00e46f4da9119dce7aa535 to your computer and use it in GitHub Desktop.
Clear Linux custom kernel

Get Clear Linux kernel patch files

git clone https://github.com/clearlinux-pkgs/linux.git clearlinux-pkgs-linux.git
cd clearlinux-pkgs-linux.git
git checkout -b 4.19.4-664 4.19.4-664

Get kernel source

cd ..
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
git checkout -b v4.19.5 v4.19.5

Apply Clear patches

git apply ../clearlinux-pkgs-linux.git/*.patch

Copy current kernel config file

cp /usr/lib/kernel/config-4.19.5-665.native .config

Enable i915 kernel debug options

vi .config
CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=y
CONFIG_DRM_I915_DEBUG_VBLANK_EVADE=y

make olddefconfig

Copy firmware files

# for .config: CONFIG_EXTRA_FIRMWARE="i915/kbl_huc_ver02_00_1810.bin i915/kbl_dmc_ver1_04.bin"
sudo cp /usr/lib/firmware/i915/kbl_huc_ver02_00_1810.bin firmware/i915
sudo cp /usr/lib/firmware/i915/kbl_dmc_ver1_04.bin firmware/i915
sudo chown mikesart:mikesart firmware/i915/kbl*.bin

Build kernel + modules + install modules

make -j $(nproc) LOCALVERSION=-custom bzImage
make -j $(nproc) LOCALVERSION=-custom modules
make -j $(nproc) LOCALVERSION=-custom modules_install

Copy kernel image

cp arch/x86/boot/bzImage /boot/EFI/org.clearlinux/mls-4.19.5-custom

Add boot entry...

vi /boot/loader/entries/mls-4.19.5-custom.conf

TODO: use uname -r, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment