Raspberry Pi RT 抢占 Linux 内核构建错误

Raspberry Pi RT 抢占 Linux 内核构建错误

我正在尝试构建并安装 Raspberry Pi RT Preempt Linux 内核。

这些是我遵循的步骤:

  1. 我安装了预编译的内核kernel-4.4.9-rt17.tgz

  2. 我下载了Raspberry Pi内核源代码并应用了实时补丁-4.4.9-rt17.patch.gz。(我遵循这个链接用于安装)

  3. 我使用以下命令为 Raspberry Pi3、Model B 配置了内核:

    export KERNEL=kernel7
    
    make bcm2709_defconfig
    
  4. 我使用以下命令将内核配置为支持完全抢占式内核 (RT)

    make -j$(nproc) menuconfig
    
  5. 我使用构建内核

    make -j$(nproc) zImage 
    

    但我收到错误:

    In file included from arch/arm/kernel/asm-offsets.c:14:0:
    ./include/linux/sched.h:2040:32: error: expected identifier or ‘(’ before ‘&’ token
    define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) ^     ./include/linux/sched.h:3679:37: note: in expansion of macro ‘tsk_cpus_allowed’
    static inline const struct cpumask *tsk_cpus_allowed(struct task_struct *p) ^ In file included from arch/arm/kernel/asm-offsets.c:14:0:
    ./include/linux/sched.h:3687:19: error: redefinition of ‘tsk_nr_cpus_allowed’     static inline int tsk_nr_cpus_allowed(struct task_struct *p) ^ In file included from arch/arm/kernel/asm-offsets.c:14:0:  ./include/linux/sched.h:2042:19: note: previous definition of ‘tsk_nr_cpus_allowed’ was here
    

这是内核构建输出

你有什么办法解决这个问题吗?我不知道我做错了什么。我真的很感激任何帮助。

相关内容