Skip to content

Instantly share code, notes, and snippets.

@vicente-gonzalez-ruiz
Last active February 5, 2023 19:37
Show Gist options
  • Save vicente-gonzalez-ruiz/fd6987d6e6334d0486e13dd544bb34ff to your computer and use it in GitHub Desktop.
Save vicente-gonzalez-ruiz/fd6987d6e6334d0486e13dd544bb34ff to your computer and use it in GitHub Desktop.
Adding new kernel in Manjaro

Installing a new kernel in Manjaro

There are several alternatives:

  1. Download a pre-compiled kernel from the Manjaro repos.
  2. Download a source kernel from the Manjaro repos and compile it. This should optimize the binaries for your chipset.
  3. Download a source kernel from https://www.kernel.org/ and compile it. Optimized, but harder to configure :-/

1. Using a pre-compiled kernel:

See https://wiki.manjaro.org/index.php/Manjaro_Kernels

$ sudo mhwd-kernel -i linux62

2. Using a Manjaro-tuned source kernel:

  1. Download a kernel (you can see the available kernes at https://gitlab.manjaro.org/packages/core). None of the following commands are run as root:
$ git clone https://gitlab.manjaro.org/packages/core/linux62
  1. Configure the kernel:
$ cd linux62
$ nano config  # Notice that there are two entries to modify

  ##########
  # Before #
  ##########

  CONFIG_PREEMPT_BUILD=y
  # CONFIG_PREEMPT_NONE is not set
  <--------- here
  # CONFIG_PREEMPT_VOLUNTARY is not set
  CONFIG_PREEMPT=y   <----------- here
  CONFIG_PREEMPT_COUNT=y
  CONFIG_PREEMPTION=y
  CONFIG_PREEMPT_DYNAMIC=y
  CONFIG_SCHED_CORE=y

  #########
  # After #
  #########
  
  CONFIG_PREEMPT_BUILD=y
  # CONFIG_PREEMPT_NONE is not set
  CONFIG_PREEMPT_VOLUNTARY=y
  # CONFIG_PREEMPT_VOLUNTARY is not set
  # CONFIG_PREEMPT=y
  CONFIG_PREEMPT_COUNT=y
  CONFIG_PREEMPTION=y
  CONFIG_PREEMPT_DYNAMIC=y
  CONFIG_SCHED_CORE=y
$ updpkgsums

3. Compile:

$ makepkg -s

4. Install everything (kernel and modules):

This also updates GRUB's configuration files.

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