官术网_书友最值得收藏!

Preparing kernel headers

There will occasionally be times where we'll face the need to compile code which requires kernel headers. Kernel headers are the source code of the Linux kernel. In this first recipe, we'll explain the steps required to prepare kernel headers for later use.

Getting ready

An Internet connection is required to complete this recipe.

How to do it...

Let's begin the process of preparing kernel headers:

  1. We begin first by updating our distribution by executing the following command:
    apt-get update
    
  2. Next, we must use apt-get again to prepare the kernel headers. Execute the following command:
    apt-get install linux-headers - `uname –r`
    
  3. Copy the following directory and its entire contents:
    cd /usr/src/linux
    cp -rf include/generated/* include/linux/
    
  4. We're now ready to compile code that requires kernel headers.
主站蜘蛛池模板: 长武县| 博罗县| 察哈| 邮箱| 林州市| 自贡市| 疏附县| 文成县| 阿尔山市| 长兴县| 南安市| 阳原县| 霍山县| 方正县| 石阡县| 云和县| 芒康县| 那曲县| 陇南市| 平邑县| 镇宁| 姚安县| 达孜县| 浦北县| 肃南| 石阡县| 大化| 海阳市| 宜宾县| 博兴县| 丁青县| 德格县| 孟村| 鹤庆县| 沙坪坝区| 南部县| 瓮安县| 韩城市| 安岳县| 衡阳县| 嘉义县|