Compile kernel as a normal user
I just heard this trick from my friend, rae.
It is quite easy:
- make a dir, cd into it
- cp /boot/config .config (suppose you use "make install" to install kernel, :-D)
- make -C /usr/src/linux O=$PWD oldconfig, (and optionally make menuconfig to tweak a little bit)
- make && sudo make modules_install && sudo make install
PS: However, there is a problem with this approach.
My original intention is to avoid touching the sources in /usr/src/linux and running as root.
But in fact, before you emerge kernel modules such as x11-drm, you still have to run 'make modules_prepare' in /usr/src/linux as root. Even I have used this command:
sudo env KBUILD_OUTPUT=/home/zhangle/build emerge x11-drmWhat's worse, the hints given in the output of the above command can't solve the problem:
* Found kernel source directory:
* Found kernel object directory:
* Found sources for kernel version:
* Please verify that your /usr/src/linux symlink is pointing
* to your current kernel sources, and that you did run:
* # make dep