1

I am trying to Build and install a Raspberry Pi RT Preempt Linux Kernel.

These are the steps that I had followed:

  1. I installed the pre-compiled kernel kernel-4.4.9-rt17.tgz

  2. I downloaded Raspberry Pi kernel sources and applied the Real Time patch-4.4.9-rt17.patch.gz.

  3. I configured my kernel for Raspberry Pi3, Model B using:

    export KERNEL=kernel7
    make bcm2709_defconfig
    
  4. I configured the kernel to support Fully Preemptible Kernel (RT) using

    make -j$(nproc) menuconfig
    
  5. I built the kernel using

    make -j$(nproc) zImage 
    

    but I received the error:

    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
    

Here is the kernel build output

Do you have any idea to solve this? I don't know what I am doing wrong. I have been stuck at this for some time now and would really appreciate any help.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
A.Chaalane
  • 21
  • 5
  • After the build fails, display the environment with the `printenv` command, which will probably reveal your mistake(s). Are you compiling on the RPi or some other host? BTW you should not be building as root. – sawdust May 27 '17 at 21:26
  • I am compiling on the RPi.So I didn't cross-compile the kernel – A.Chaalane May 28 '17 at 22:30
  • i am facing similar problems with kernel 4.6.y. Hope you get help or get it done ... – guenni_90 May 29 '17 at 08:21
  • printenv didn't help me to figure out what I am doing wrong. – A.Chaalane May 29 '17 at 10:28
  • Problem solved by installing a NON precompiled kernel (version 4.4.50). I used the corresponding 4.4.50-rt63 rt-patch. The errors happened because of a mismatch between the pre-compiled kernel and the rt-patch that I used. Thank you for your answers. – A.Chaalane Jun 29 '17 at 11:44

0 Answers0