Recompile Linux kernel under Mac
Operating system experiments that require adding system calls and recompiling the kernel, documenting the process of compiling the kernel
0. Download VirtualBox
Bloggers have been using parallel desk, but because of the driver and other problems, after the re-compilation on the PD can not appear graphical interface, it is recommended to use a better insulation virtualbox to compile the kernel.
1. Download the kernel
From the Linux official website http://www.kernel.org download Kernel Code, note the version number, it is recommended to use a newer Ubuntu system to adopt the new kernel.
Here Bo Master encountered a pit, in 16.04 of Ubuntu compiled 3.11.4 kernel encountered error, because the system of the GCC version is 5, and the 3.11.4 kernel does not include gcc5.h, direct error.
2. Deploy kernel source
# 把内核解压到/usr/src目录下cd /usr/srctar#解压源码
3. Create a. config in the kernel code directory
If there is no big change, you can generate a new profile from the original configuration file.
cd linux-4.14.1cp /boot/config-`uname -r`#这里`uname -r`可以求出当前的内核版本sudo make oldconfig
After that there will be some column configuration options, all carriage returns can be
4. Compiling the kernel
sudo makesudo make modules_installsudo make install
There may be a lack of openssl,apt install at compile time, make is longer, halfway if the error is to compile again before you better sudo make clean
5. Testing
sudo#重启uname# 查看内核版本
The first reboot may be slow, and you can wait patiently.
Recompile Linux kernel under Mac