I am trying to compile RPi kernel on Kali Linux. I have downloaded GIT & the tools-master from git. Can anyone help me in resolving this issue & understand why this error comes?

Below is the environment variable setup.

$ export CCPREFIX=arm-linux-gnueabihf-
$ export PATH=/media/6605-F597/toolchain/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/:$PATH
$ make ARCH=arm CROSS_COMPILE=$CCPREFIX bcmrpi_defconfig

While running last command I get following error.

HOSTCC  scripts/basic/fixdep
/bin/sh: 1: scripts/basic/fixdep: Permission denied
make[1]: *** [scripts/basic/fixdep] Error 126
make: *** [scripts_basic] Error 2

I tried goggling it but could not resolve this issue. I have this code in my vfat partition.

/dev/sda3 on /media/6605-F597 type vfat (rw,nosuid,nodev,relatime,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks)
  • You sir need root permissions to run fixdep whatever your last command was, do $sudo command
    – j0h
    Commented Aug 10, 2014 at 1:12
  • I tried running as root also but it din't help. Then I moved my code to my home directory along with the toolchain & this this error was gone. But I can't understand this logic.
    – 0x07FC
    Commented Aug 10, 2014 at 16:02
  • I am now facing some other error with my code & toolchain in my home directory. error is :- make: execvp: arm-bcm2708-linux-gnueabi-gcc: Permission denied
    – 0x07FC
    Commented Aug 10, 2014 at 16:03
  • Man, when ever you see permission denied, on anything in mean you need root privilege. sudo that. (Super User DO...sudo)
    – j0h
    Commented Aug 10, 2014 at 16:33
  • I did use root permission & could not solve this issue, so i posted this question.
    – 0x07FC
    Commented Aug 10, 2014 at 16:48

1 Answer 1


showexec is problematic:

    If set, the execute permission bits of the file will be allowed only if      
    the extension part of the name is .EXE, .COM, or .BAT. Not set by default.

use umask=000 (requires to umount and mount, remount doesn't help):

umount /dev/sdb1
mount -o umask=000 -t vfat /dev/sdb1 /media/sdb1

BTW I'd wouldn't clone / compile kernel on vfat (or other non-native fs).

Source: section "Mount options for fat" in mount(8), wiki.linuxquestions.org.

  • 1
    A second reason never to compile on FAT filesystems is the time stamps are only two-second granularity, which breaks the working of make. Randomly. The MS-Windows make tool is aware of that. The Linux build of the tools is not.
    – Janka
    Commented Oct 5, 2018 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.