Search code examples
stm32embedded-linuxyocto

Unable to export ${SOURCE_DATE_EPOCH} Yocto Project


Setup:

VirtualBox 7.0
Image Ubuntu 22.04.1

Goal:

build Linux image for STM32MP157 in yocto project according Digi-Key Tutorial

Issue:

Fault during menuconfig creation.

root@Ubuntu:/home/vboxuser/Projects/yocto/build-mp1# bitbake -c menuconfig virtual/kernel

Loading cache: 100% |##################################################################################################| Time: 0:00:04

Loaded 4037 entries from dependency cache.

NOTE: Resolving any missing task queue dependencies



Build Configuration:

BB_VERSION           = "2.4.0"

BUILD_SYS            = "x86_64-linux"

NATIVELSBSTRING      = "universal"

TARGET_SYS           = "arm-poky-linux-gnueabi"

MACHINE              = "stm32mp1"

DISTRO               = "poky"

DISTRO_VERSION       = "4.2.3"

TUNE_FEATURES        = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"

TARGET_FPU           = "hard"

meta                 

meta-poky            

meta-yocto-bsp       = "mickledore:2f5d4fa3495bea5ed0a4232b14cdeba39f27b75e"

meta-oe              

meta-python          = "mickledore:b0ba472191c2b7709ef04ae9c5a23bea040518f9"

meta-st-stm32mp      = "mickledore:931b3f5be2c00f55d114c8f9122082a9d229b776"



Initialising tasks: 100% |#############################################################################################| Time: 0:00:02

Sstate summary: Wanted 131 Local 0 Mirrors 0 Missed 131 Current 0 (0% match, 0% complete)

NOTE: Executing Tasks

WARNING: /home/vboxuser/Projects/yocto/poky/meta/recipes-devtools/quilt/quilt-native_0.67.bb: Unable to export ${SOURCE_DATE_EPOCH}: Failure expanding variable SOURCE_DATE_EPOCH, expression was ${@get_source_date_epoch_value(d)} which triggered exception PermissionError: [Errno 13] Permission denied: '/home/vboxuser/Projects/yocto/build-mp1/tmp/work/x86_64-linux/quilt-native/0.67-r0/source-date-epoch/__source_date_epoch.txt'

The variable dependency chain for the failure is: SOURCE_DATE_EPOCH

ERROR: Build of do_unpack failed

ERROR: Traceback (most recent call last):

  File "/home/vboxuser/Projects/yocto/poky/bitbake/lib/bb/build.py", line 783, in exec_task

  File "/home/vboxuser/Projects/yocto/poky/bitbake/lib/bb/build.py", line 630, in _exec_task

  File "/home/vboxuser/Projects/yocto/poky/bitbake/lib/bb/utils.py", line 767, in mkdirhier

  File "/home/vboxuser/Projects/yocto/poky/bitbake/lib/bb/utils.py", line 764, in mkdirhier

  File "/usr/lib/python3.10/os.py", line 215, in makedirs

    makedirs(head, exist_ok=exist_ok)

  File "/usr/lib/python3.10/os.py", line 215, in makedirs

    makedirs(head, exist_ok=exist_ok)

  File "/usr/lib/python3.10/os.py", line 215, in makedirs

    makedirs(head, exist_ok=exist_ok)

  [Previous line repeated 5 more times]

  File "/usr/lib/python3.10/os.py", line 225, in makedirs

    mkdir(name, mode)

PermissionError: [Errno 13] Permission denied: '/home/vboxuser/Projects'

Looks like main problem is related to SOURCE_DATE_EPOCH. I found that this variable is not determined, so i exported SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) but nothing has changed.
Before this obstacle, such issue happened but has been resolved like in solution.


Solution

  • As @skandigraun noticed in the comments, there was a problem with the access level for /home/vboxuser/Projects directory.

    I elevated permissions for the mentioned directory by command:
    chmod 775 ./Projects

    Listed directory has now such settings:
    drwxrwxr-x 3 vboxuser vboxuser 4096 wrz 4 06:39 Projects

    After this, I was able to overcome the current stage of the compilation.