Skip to Content


Table of Contents



Gitlab 仓库

philm提到了manjaro在gitlab上编译内核的仓库。 后面使用不同的linux版本号。



  • files ending with .patch should be clear. These are adjustments we think will fit for our distro best.
  • files starting with config are our modified settings on how we configure the kernel on our end.
  • files starting with linux are specific files to post configure the system. They are used either by pacman or mkinitcpio, which configures the initramfs image.
  • files ending with .hook are used by pacman to pre- or post-configure the kernel.




So here is a quick tutorial to compile your own kernel on Manjaro:

first you have to clone our package repo for linux417 via git clone

then change into that directory and execute makepkg -s. This will compile the kernel as I had configured it. You may want to stop the time.

If you however want to use our tools, you may install manjaro-tools-pkg and only change into the directory where you cloned the git-repo. No need to change into the linux417 folder. You simply may use then buildpkg -p linux417. This will create a new chroot on which the package gets compiled in a separate system to avoid any issues with other systems. Only used if you want to redistribute your package to somebody else.


  1. git clone对应的仓库
  2. 修改编译参数config.x86_64
  3. makepkg编译内核


为了避免编译器版本等造成的环境问题,manjaro还提供了manjaro-tool-pkg,在仓库所在的目录运行buildpkg -p linux56会新安装一个新的环境然后chroot使用独立的环境构建。


[optional] give your kernel a different name so it can be easily installed alongside existing ones. For that, you have to replace every instance of -MANJARO with a name of your choice, this in every file, not only in PKGBUILD! You could use a simple ‘find and replace’ in your text editor, or use the sed command, e.g. sed -i -e “s|-MANJARO|-CUSTOM|” PKGBUILD. You also have to edit various other names, like


zcat /proc/config.gz > .config 导出当前内核的配置。


  • make localmodconfig 获取当前的内核参数,这种方法能够得到一个非常精简的内核,但没有加载过的内核模块都不会被编译。(在我的笔记本上内核大小成了之前的25%,但是睡眠出问题)
  • make nconfig: 新的命令行 ncurses 界面
  • make xconfig: 用户友好的图形界面,需要安装 packagekit-qt4[断开的链接:package not found]。建议没有经验的用户使用此方法。
  • make gconfig: 和 xconfig 类似的图形界面,使用 gtk.