Copy Yocto Project to other PC by tar - linux

Due to the Internet connect is poor on customer side, I copied the tar file of my Yocto Project to customer.
However, customer met an issue while untar the Yocto Project and run the bitbake command to build project on their PC.
Customer got the following build code error:
s32v#s32v-vm:~/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release$ bitbake fsl-image-s32v2xx
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Error, TMPDIR has changed location. You need to either move it back to /media/2T_HDD_for_SDK/Amingo/S32V/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp or rebuild
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
I edited /build_s32v234evb_release/tmp/saved_tmpdir file to re-position the tmp directory, this error has pass.
However, I got another error while building Kernel, it seems the directory parameter is still wrong... (There is no error while building U-Boot only.)
s32v#s32v-vm:~/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release$ bitbake fsl-image-s32v2xx
Loading cache: 100% |########################################################################################################################################################################| ETA: 00:00:00
Loaded 2462 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.26.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "aarch64-fsl-linux"
MACHINE = "s32v234evb"
DISTRO = "fsl-networking"
DISTRO_VERSION = "1.8"
TUNE_FEATURES = "aarch64"
TARGET_FPU = ""
meta
meta-yocto
meta-yocto-bsp = "(nobranch):03b0fbcf6b3b5cd16ae16738fbaabd1c6bf98536"
meta-fsl-arm = "(nobranch):c9f259a4bf8472dfa3ff75f1c3fcbe5e0ded7aaf"
meta-fsl-networking = "(nobranch):b8ff02a8d508464a16c84e1d13c155f45aa98cbe"
meta-fsl-toolchain = "(nobranch):0a235c4bcd4057608ee60b8c898eec9509632b95"
meta-virtualization = "(nobranch):0277cbcb47db4239d0a4aa3b37c5c6a705070951"
meta-fsl-s32v = "<unknown>:<unknown>"
meta-oe
meta-networking
meta-python
meta-webserver
meta-filesystems = "(nobranch):c841231b9f327d2d06d19d2ba1324dd86b83617c"
meta-linaro
meta-aarch64
meta-linaro-toolchain = "(nobranch):5075a82bd510d19617803fb16da2375605225cbb"
NOTE: Preparing RunQueue
WARNING: /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/meta-fsl-s32v/recipes-kernel/linux/linux-s32v2xx_4.1.26.bb.do_compile is tainted from a forced run
WARNING: /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/meta-fsl-s32v/recipes-bsp/u-boot/u-boot-s32v2xx_2016.01.bb.do_compile is tainted from a forced run
WARNING: /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/meta-fsl-s32v/recipes-bsp/u-boot/u-boot-s32v2xx_2016.01.bb.do_deploy is tainted from a forced run
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_compile (log file is located at /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work/s32v234evb-fsl-linux/linux-s32v2xx/4.1.26-r0/temp/log.do_compile.17853)
ERROR: Logfile of failure stored in: /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work/s32v234evb-fsl-linux/linux-s32v2xx/4.1.26-r0/temp/log.do_compile.17853
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 Image CC=aarch64-fsl-linux-gcc --sysroot=/home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/sysroots/s32v234evb LD=aarch64-fsl-linux-ld.bfd --sysroot=/home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/sysroots/s32v234evb
| make: *** /media/2T_HDD_for_SDK/Amingo/S32V/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work-shared/s32v234evb/kernel-source: No such file or directory. Stop.
| make: *** [__sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work/s32v234evb-fsl-linux/linux-s32v2xx/4.1.26-r0/temp/log.do_compile.17853)
ERROR: Task 76 (/home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/meta-fsl-s32v/recipes-kernel/linux/linux-s32v2xx_4.1.26.bb, do_compile) failed with exit code '1'
ERROR: Function failed: do_compile (log file is located at /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work/x86_64-linux/qemu-native/2.2.0-r1/temp/log.do_compile.17854)
ERROR: Logfile of failure stored in: /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work/x86_64-linux/qemu-native/2.2.0-r1/temp/log.do_compile.17854
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4
| LINK tests/qemu-iotests/socket_scm_helper
| GEN qemu-doc.html
| GEN qemu.1
| CC qga/commands.o
| cc1: warning: /media/2T_HDD_for_SDK/Amingo/S32V/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/sysroots/x86_64-linux/usr/include/pixman-1: No such file or directory [enabled by default]
| cc1: warning: /media/2T_HDD_for_SDK/Amingo/S32V/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/sysroots/x86_64-linux/usr/include/glib-2.0: No such file or directory [enabled by default]
| cc1: warning: /media/2T_HDD_for_SDK/Amingo/S32V/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/sysroots/x86_64-linux/usr/lib/glib-2.0/include: No such file or directory [enabled by default]
| /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work/x86_64-linux/qemu-native/2.2.0-r1/qemu-2.2.0/qga/commands.c:13:18: fatal error: glib.h: No such file or directory
| #include <glib.h>
| ^
| compilation terminated.
| make: *** [qga/commands.o] Error 1
| make: *** Waiting for unfinished jobs....
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/build_s32v234evb_release/tmp/work/x86_64-linux/qemu-native/2.2.0-r1/temp/log.do_compile.17854)
ERROR: Task 2849 (virtual:native:/home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/poky/meta/recipes-devtools/qemu/qemu_2.2.0.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1504 tasks of which 1502 didn't need to be rerun and 2 failed.
Waiting for 0 running tasks to finish:
Summary: 2 tasks failed:
/home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/meta-fsl-s32v/recipes-kernel/linux/linux-s32v2xx_4.1.26.bb, do_compile
virtual:native:/home/s32v/s32v_15.0/yocto_auto_linux_bsp15.0/poky/meta/recipes-devtools/qemu/qemu_2.2.0.bb, do_compile
Summary: There were 3 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
My question is:
Is it possible to copy the Yocot Project to another PC by tar file?
What configuration / initial files I need to edit except saved_tmpdir file?
Which file does Yocto Project define the "kernel-source" directory?
Best Regards,
Wayne Kuo

when you copy tar project to another PC, two files will be modified:
build/conf/bblayers.conf
build/tmp/saved_tmpdir

If it's only a matter of internet connection, I suggest you create a download folder mirror.
On your side, you add BB_GENERATE_MIRROR_TARBALLS and build.
Then copy entire DL_DIR folder at customer side, and use BB_NO_NETWORK there.
You can look here and here for usage example.
You can then make a new build at customer side without internet connection. to speed up process, you can also copy your sstate-cache folder to customer side and add a sstate mirror with SSTATE_MIRRORS.
No, you will need a fresh build folder
You need to create a new Yocto environment at customer side
It's bitbake variable STAGING_KERNEL_DIR

Error, TMPDIR has changed location. You need to either move it back to...
I built all yocto stuff with the user jamie. Due to disk space running out, I copied the whole $HOME directory of jamie to another disk /dev/sdb1, which had a larger storage.
When I tried to run bitbake command to make a test, I got the same error. Here is a simple solution which worked for me:
mount /dev/sdb1 /mnt/sdb1/
mount --bind /mnt/sdb1/home_jamie/ /home/jamie/
What I want was to restore the exact original filesystem layout which the bitbake commands were once run with.
To make the above changes permanent, write above mounting as entries of /etc/fstab.

Related

Unable to compile X11 with bitbake

I've added
DISTRO_FEATURES_append = " x11"
to my local.conf as I will need access to Xrandr (which depends on X11). As soon as I add x11 to the DISTRO_FEATURES, I keep getting the following when invoking bitbake:
| checking for GLAMOR... yes
| checking for GBM... no
| configure: error: Glamor for Xorg requires gbm >= 10.2.0
| NOTE: The following config.log files may provide further information.
| NOTE: /home/yocto/rzg_vlp_v3.0.0/build/tmp/work/aarch64-poky-linux/xserver-xorg/2_1.20.8-r0/build/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/yocto/rzg_vlp_v3.0.0/build/tmp/work/aarch64-poky-linux/xserver-xorg/2_1.20.8-r0/temp/run.do_configure.143696' failed with exit code 1
ERROR: Task (/home/yocto/rzg_vlp_v3.0.0/build/../poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.20.8.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4840 tasks of which 4796 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/yocto/rzg_vlp_v3.0.0/build/../poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.20.8.bb:do_configure
libgbm on openembedded.org appears to be at version 10.0 only: https://layers.openembedded.org/layerindex/recipe/131409/
How can I get this resolved?
One way to fix it is to change the xserver-xorg's PACKAGECONFIG and remove the need for GBM.
Looking at the poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc, GBM is only mentioned in this line:
PACKAGECONFIG[glamor] = "--enable-glamor,--disable-glamor,libepoxy virtual/libgbm,libegl"
Sadly, just removing the virtual/libgbm is not enough and you also need to disable glamor completely while keeping the libepoxy package.
So I suggest you create a xserver-xorg_1.20.8.bbappend file which the following content:
PACKAGECONFIG[glamor] = "--disable-glamor,--disable-glamor,libepoxy,libegl"
I know it is a hack. But it fixes your issue

Error when building Automotive Grade Linux

I'm trying to build automotive grade linux, but I keep getting the same errors.
I tried building on different machines with different linux distributions, but I keep getting the error nevertheless.
I also tried building for different machines without success.
This is the full log of the last time I tried to build automotive grade linux for a raspberry pi 2:
Pt 1: https://pastebin.com/0pqKDdv5
Pt 2: https://pastebin.com/dmRCtTLe
This is my build configuration:
BB_VERSION = "1.32.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Debian-9.3"
TARGET_SYS = "arm-agl-linux-gnueabi"
MACHINE = "raspberrypi2"
DISTRO = "poky-agl"
DISTRO_VERSION = "4.0.2"
TUNE_FEATURES = "arm armv7ve vfp thumb neon vfpv4 callconvention-hard"
TARGET_FPU = "hard"
meta-raspberrypi = "HEAD:28d4404f89eb59d406b4976c0e3f5ca19137ba74"
meta-netboot = "HEAD:a5f69d3d31e7d75351f0e2abfc36d35ba39ce304"
meta-security-smack
meta-security-framework = "HEAD:20bbb97f6d5400b126ae96ef446c3e60c7e16285"
meta-app-framework = "HEAD:a5f69d3d31e7d75351f0e2abfc36d35ba39ce304"
meta-qt5 = "HEAD:5f837b47f5c3e462f24cd5abf58ff6ef1dd04932"
meta-agl-demo = "HEAD:65619655cb3f373a1b15da7a4d91191a2867464b"
meta-oe
meta-multimedia
meta-efl
meta-networking
meta-python
meta-filesystems = "HEAD:fe5c83312de11e80b85680ef237f8acb04b4b26e"
meta-ivi-common
meta-agl
meta-agl-distro
meta-agl-bsp = "HEAD:a5f69d3d31e7d75351f0e2abfc36d35ba39ce304"
meta
meta-poky = "HEAD:60402978fe3648bf560b3386c6e9dd661cdf2083"
This is the first error I get:
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/openbios-ppc' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/openbios-sparc32' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/openbios-sparc64' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/s390-ccw.img' from qemu-native was already stripped, this will prevent future debugging!
WARNING: qemu-native-2.7.0-r1 do_populate_sysroot: File '/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/u-boot.e500' from qemu-native was already stripped, this will prevent future debugging!
ERROR: qemu-native-2.7.0-r1 do_populate_sysroot: runstrip: ''strip' --remove-section=.comment --remove-section=.note '/.../build/tmp/work/x86_64-linux/qemu-native/2.7.0-r1/sysroot-destdir/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/palcode-clipper'' strip command failed with 1 (b"strip: Unable to recognise the format of the input file `/.../build/tmp/work/x86_64-linux/qemu-native/2.7.0-r1/sysroot-destdir/.../build/tmp/sysroots/x86_64-linux/usr/share/qemu/palcode-clipper'\n")
This is the second error, which I think is caused by the first one.
ERROR: gcc-runtime-6.2.0-r0 do_compile: oe_runmake failed
ERROR: gcc-runtime-6.2.0-r0 do_compile: Function failed: do_compile (log file is located at /.../build/tmp/work/armv7vehf-neon-vfpv4-agl-linux-gnueabi/gcc-runtime/6.2.0-r0/temp/log.do_compile.30447)
ERROR: Logfile of failure stored in: /.../build/tmp/work/armv7vehf-neon-vfpv4-agl-linux-gnueabi/gcc-runtime/6.2.0-r0/temp/log.do_compile.30447
NOTE: recipe gcc-runtime-6.2.0-r0: task do_compile: Failed
ERROR: Task (/.../poky/meta/recipes-devtools/gcc/gcc-runtime_6.2.bb:do_compile) failed with exit code '1'
I found this thread of someone having the same issue, but there is no fix there, so I thought I'd ask it again, because this issue still persist.
I can see that there is a problem with the stripping of files, but I can't find where to fix this in the recipes.
I'm not sure if this error is caused by the used host system or if it's dependant on the recipes.
I hope someone knows a fix to this issue.
Thanks in advance
Laurens Wuyts
EDIT:
Here is the log file of the gcc error: https://www.dropbox.com/s/4hd5kzgbadhdc9p/log.do_compile.30447?dl=0
Here is the specific error message on pastebin:
https://pastebin.com/H8M3sY6a

Yocto build error for python and qt5

I'm getting below yocto build error and I'm not sure what is the problem.
I am trying to build yocto for my warpx board. Able to build headless image but not headfull.
Can you please anyone point out any issue ?
I have used yocto krogoth version with freescal platform bsp.
These are the commands I followed.
repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b krogoth
repo sync
cd sources
git clone https://github.com/Kynetics/meta-warpx.git
cd meta-warpx
git checkout krogoth
cd ..
git clone https://github.com/meta-qt5/meta-qt5.git
cd meta-qt5
git checkout krogoth
cd ..
git clone https://github.com/sbabic/meta-swupdate.git
cd meta-swupdate
git checkout krogoth
cd ../../
cp -rf sources/meta-warpx/first-setup/setup-warpx-warp .
source setup-warpx-warp
ACCEPT the terms here (say 'y')
Now we are in "~/yocto/build-warpx-warp" location.
cp -rf ../sources/meta-warpx/first-setup/local.conf.sample conf/local.conf
cp -rf ../sources/meta-warpx/first-setup/bblayers.conf conf/
bitbake warpx-headfull-image-sdk
titus#titusPC:~/workdir/Titus/yocto/build-warpx-warp$ bitbake warpx-headfull-image
WARNING: Host distribution "Ubuntu-16.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |################################################################| ETA: 00:00:00
Loaded 2562 entries from dependency cache.
Parsing recipes: 100% |##############################################################| Time: 00:00:00
Parsing of 1997 .bb files complete (1996 cached, 1 parsed). 2562 targets, 192 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.30.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "warp"
DISTRO = "poky"
DISTRO_VERSION = "2.1.3"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard cortexa9"
TARGET_FPU = "hard"
meta
meta-poky = "HEAD:3565a9697f53ba975a1b7235b802f659418746c3"
meta-oe
meta-multimedia
meta-networking
meta-python = "krogoth:55c8a76da5dc099a7bc3838495c672140cedb78e"
meta-fsl-arm = "HEAD:e2254e7b2ded0c2b66b1226f879b3a6d52037b2d"
meta-fsl-arm-extra = "HEAD:2c28e636ec15c2cfd49bc9cebe0bbbcfde95bc7b"
meta-qt5 = "krogoth:1100037b9becaaa5749602bca9d63693119c4585"
meta-warpx = "krogoth:b2110ade3cd53f3b98a8f057d508c075b4d691e2"
meta-swupdate = "krogoth:712d4aee92ea3a23952a3e7fb812e5c4df7492ec"
NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: python-pyqt-5.3.1-r1 do_generate: Error calling sip on QtCore
ERROR: python-pyqt-5.3.1-r1 do_generate: Function failed: do_generate (log file is located at /home/titus/workdir/Titus/yocto/build-warpx-warp/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/python-pyqt/5.3.1-r1/temp/log.do_generate.2080)
ERROR: Logfile of failure stored in: /home/titus/workdir/Titus/yocto/build-warpx-warp/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/python-pyqt/5.3.1-r1/temp/log.do_generate.2080
Log data follows:
| DEBUG: Executing shell function do_generate
| NOTE: using modules 'QtCore QtGui QtQml QtQuick QtSvg QtWebKit QtWidgets QtOpenGL QtXmlPatterns' and tags '-tWS_X11 -tQt_5_3_1 -xVendorID -xPyQt_Accessibility -xPyQt_Desktop_OpenGL -xPyQt_SessionManager'
| calling 'sip4 -I sip -I /home/titus/workdir/Titus/yocto/build-warpx-warp/tmp/sysroots/x86_64-linux/usr/share/sip -tWS_X11 -tQt_5_3_1 -xVendorID -xPyQt_Accessibility -xPyQt_Desktop_OpenGL -xPyQt_SessionManager -c QtCore -b QtCore/QtCore.pro.in sip/QtCore/QtCoremod.sip'
| /home/titus/workdir/Titus/yocto/build-warpx-warp/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/python-pyqt/5.3.1-r1/temp/run.do_generate.2080: 137: /home/titus/workdir/Titus/yocto/build-warpx-warp/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/python-pyqt/5.3.1-r1/temp/run.do_generate.2080: sip4: not found
| WARNING: exit code 1 from a shell command.
| ERROR: Error calling sip on QtCore
| ERROR: Function failed: do_generate (log file is located at /home/titus/workdir/Titus/yocto/build-warpx-warp/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/python-pyqt/5.3.1-r1/temp/log.do_generate.2080)
ERROR: Task 3512 (/home/titus/workdir/Titus/yocto/sources/meta-warpx/recipes-devtools/python/python-pyqt_5.3.1.bb, do_generate) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3319 tasks of which 2678 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:
Summary: 1 task failed:
/home/titus/workdir/Titus/yocto/sources/meta-warpx/recipes-devtools/python/python-pyqt_5.3.1.bb, do_generate
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
titus#titusPC:~/workdir/Titus/yocto/build-warpx-warp$
Its seems to doesn't have the sip recipe in your yocto source.
python-pyqt depends on sip add the sip recipe and compile again.

Linux Kernel out of tree Driver Compilation failed with BUILD_BUG_ON_ZERO

On a Raspberry Pi 3, I am compiling a custom Linux Kernel and want to include an open source software PWM kernel driver.
I cloned the following repository for the Linux source:
https://github.com/raspberrypi/linux.git
I cloned the following repository for the Software PWM:
https://github.com/dagon666/rpi_SoftPwm
After successfully building the kernel, I compile the software PWM driver per the README like this:
pi#raspberrypi:~/Desktop/rpi_SoftPwm $ make M=/home/pi/Desktop/rpi_SoftPwm -C /home/pi/linux/ modules
The compilation fails with the error below:
make: Entering directory '/home/pi/linux'
CC [M] /home/pi/Desktop/rpi_SoftPwm/pwm.o
In file included from ./include/linux/thread_info.h:11:0,
from ./include/asm-generic/preempt.h:4,
from ./arch/arm/include/generated/asm/preempt.h:1,
from ./include/linux/preempt.h:59,
from ./include/linux/spinlock.h:50,
from ./include/linux/seqlock.h:35,
from ./include/linux/time.h:5,
from ./include/linux/stat.h:18,
from ./include/linux/module.h:10,
from /home/pi/Desktop/rpi_SoftPwm/pwm.c:2:
./include/linux/bug.h:37:45: error: negative width in bit-field ‘<anonymous>’
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
^
./include/linux/kernel.h:854:3: note: in expansion of macro ‘BUILD_BUG_ON_ZERO’
BUILD_BUG_ON_ZERO((perms) & 2) + \
^
./include/linux/sysfs.h:102:12: note: in expansion of macro ‘VERIFY_OCTAL_PERMISSIONS’
.mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
^
/home/pi/Desktop/rpi_SoftPwm/pwm.c:155:2: note: in expansion of macro ‘__ATTR’
__ATTR(export, 0222, NULL, export_store),
^
./include/linux/bug.h:37:45: error: negative width in bit-field ‘<anonymous>’
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
^
./include/linux/kernel.h:854:3: note: in expansion of macro ‘BUILD_BUG_ON_ZERO’
BUILD_BUG_ON_ZERO((perms) & 2) + \
^
./include/linux/sysfs.h:102:12: note: in expansion of macro ‘VERIFY_OCTAL_PERMISSIONS’
.mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
^
/home/pi/Desktop/rpi_SoftPwm/pwm.c:156:2: note: in expansion of macro ‘__ATTR’
__ATTR(unexport, 0222, NULL, unexport_store),
^
scripts/Makefile.build:299: recipe for target '/home/pi/Desktop/rpi_SoftPwm/pwm.o' failed
make[1]: *** [/home/pi/Desktop/rpi_SoftPwm/pwm.o] Error 1
Makefile:1490: recipe for target '_module_/home/pi/Desktop/rpi_SoftPwm' failed
make: *** [_module_/home/pi/Desktop/rpi_SoftPwm] Error 2
make: Leaving directory '/home/pi/linux'
I've tried to research this on Google and have not seen a solution. The failure has to do with the __ATTR macro. This used to compile with the older Linux Kernel 3.19, however now Raspbian is up to Linux 4+.
How can I get this to compile? Thanks.
Linux kernel developers tend to create attributes (files under /sys) non-writable for non-root users. This is what macro VERIFY_OCTAL_PERMISSIONS checks: permissions shouldn't have flag S_IWOTH (second bit) set.
Replace permissions 0222 to 0220, so compilation will succeed.

linux, error building AM33 Yocto image, bitbake

I am following the steps here:http://variwiki.com/index.php?title=VAR-SOM-AM33_Yocto_FIDO_GS
I get the following error:
ERROR: Function failed: do_compile (log file is located at /home/philip/yocto_varsomam33/tisdk/build/arago-tmp-external-linaro-toolchain/work/cortexa8hf-vfp-neon-linux-gnueabi/input-utils/1.0-r0/temp/log.do_compile.3467)
ERROR: Logfile of failure stored in: /home/philip/yocto_varsomam33/tisdk/build/arago-tmp-external-linaro-toolchain/work/cortexa8hf-vfp-neon-linux-gnueabi/input-utils/1.0-r0/temp/log.do_compile.3467
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 6 DESTDIR=/home/philip/yocto_varsomam33/tisdk/build/arago-tmp-external-linaro-toolchain/work/cortexa8hf-vfp-neon-linux-gnueabi/input-utils/1.0-r0/image STRIP=
| Make.config:1: *** empty variable name. Stop.
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/philip/yocto_varsomam33/tisdk/build/arago-tmp-external-linaro-toolchain/work/cortexa8hf-vfp-neon-linux-gnueabi/input-utils/1.0-r0/temp/log.do_compile.3467)
ERROR: Task 1815 (/home/philip/yocto_varsomam33/tisdk/sources/meta-arago/meta-arago-extras/recipes-devtools/input-utils/input-utils_1.0.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3217 tasks of which 3211 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
Waiting for 0 running tasks to finish:
Summary: 1 task failed:
/home/philip/yocto_varsomam33/tisdk/sources/meta-arago/meta-arago-extras/recipes-devtools/input-utils/input-utils_1.0.bb, do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
If I look at the inputs-utils_1.0.bb file:
# set the DESTDIR and the STRIP variables used by the GNUmakefile.
# The STRIP variable is set to blank or else the variable setting from OE
# is picked up as <TC>-strip and the install step sees that as another
# file to install.
EXTRA_OEMAKE = "DESTDIR=${D} STRIP=''"
do_install () {
oe_runmake install
}
What to I do with the STRIP variable?
Thanks!
I rebuilt the VM with ubuntu 14.04 and now it works

Resources