Recompile Linux kernel under Mac

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.