I'm getting the following error when I run "make": INSTALL include/linux/iio (2 files) INSTALL include/linux/isdn (1 file) INSTALL include/linux/mmc (1 file) INSTALL include/linux/netfilter (88 files) INSTALL include/linux/netfilter_arp (2 files) INSTALL include/linux/netfilter_bridge (17 files) INSTALL include/linux/netfilter_ipv4 (9 files) INSTALL include/linux/netfilter/ipset (4 files) INSTALL include/linux/netfilter_ipv6 (13 files) INSTALL include/linux/nfsd (5 files) INSTALL include/linux/raid (2 files) INSTALL include/linux/sched (1 file) INSTALL include/linux/spi (1 file) INSTALL include/linux/sunrpc (1 file) INSTALL include/linux/tc_act (15 files) INSTALL include/linux/tc_ematch (5 files) INSTALL include/linux/usb (13 files) INSTALL include/linux/wimax (1 file) INSTALL include/asm (38 files) make[1]: Leaving directory '/home/ceremcem/sync/curr-projects/scada-gateway/os/disk-images/rpi-buildroot/output/build/linux-headers-4.19.38' if ! support/scripts/check-kernel-headers.sh /home/ceremcem/sync/curr-projects/scada-gateway/os/disk-images/rpi-buildroot/output/host/arm-buildroot-linux-uclibcgnueabihf/sysroot 4.19; then exit 1; fi support/scripts/check-kernel-headers.sh: 38: support/scripts/check-kernel-headers.sh: /tmp/check-headers.rQZuHv: Permission denied make: *** [package/pkg-generic.mk:283: /home/ceremcem/sync/curr-projects/scada-gateway/os/disk-images/rpi-buildroot/output/build/linux-headers-4.19.38/.stamp_staging_installed] Error 1 ----------------- I'm using a git clone: cd8ab1853d (HEAD -> latest-release, tag: 2019.08-rc3) Update for 2019.08-rc3 Host is: Linux cca-erik 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux
I'm afraid this does not look like a Buildroot issue, but a system configuration issue on your machine: /tmp is not writable by the user with which you're doing the Buildroot build. Could you try to just run "touch /tmp/foobar" ? I guess you'll get the same Permission denied issue. If it's the case, then you have to fix your system /tmp permissions.
"touch /tmp/foobar" works correctly: ceremcem@cca-erik:~$ touch /tmp/foobar ceremcem@cca-erik:~$ ls -l /tmp/foobar -rw-r--r-- 1 ceremcem ceremcem 0 Sep 20 03:04 /tmp/foobar FYI: I've been using this installation for more than 2 years without any issue.
(In reply to Cerem Cem ASLAN from comment #2) Is your /tmp mounted with "noexec" option? What's the output of the command mount | grep -F /tmp
Exactly: ceremcem@cca-erik:~$ mount | grep -F /tmp tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime,size=524288k) I remounted with "exec": sudo mount -o remount,exec /tmp Then compilation continued. Would you consider adding that checking into makefile? (I may provide a patch for that)
(In reply to Carlos Santos from comment #3) Good finding Carlos! Is mounting /tmp with noexec a common thing? From a quick Google search seems like a number of people are recommending to do this. Not sure if this is good advice. But, for this specific case, Buildroot generally puts all its generated contents in $(O), even temporary things. Perhaps we should do the same for this check-headers script?
(In reply to Thomas Petazzoni from comment #5) Some people recommend mounting /tmp with nodev, noexec and nosuid options for security reasons. It is pretty common on FreeBSD but it's not default on Linux distros. I will send a patch for check-kernel-headers.sh to fix this.
Fixed by https://git.buildroot.org/buildroot/commit/?id=6136765b23abd9faba610dd54ed276a777811575. Thanks Carlos for the investigation and fix!