embedded-linuxyoctobitbakeyocto-recipe

Yocto adding local tarball path to recipe problem


I have such a problem while building yocto distribution for BeagleBone Black. I am trying to add Ninvaders game(a character-based space game for running on a terminal for practicing yocto.) from a local folder located on:

file:///home/user/Downloads/ninvaders-0.1.1.tar.gz

I added a folder and gave recipes on recipes-extended: ( I know it does not make sense to locate it here, but for educational purposes)

ninvaders.inc

DESCRIPTION = "ncurses-based clone of space invaders"

SRC_URI = "${file:///home/user/Downloads/${BP}.tar.gz"

LICENSE = ""

and ninvaders_0.1.1.bb

require ninvaders.inc

but when I try to run

bitbake ninvaders

it gives me this error:

Loading cache: 100% |####################################################################################| Time: 0:00:00
Loaded 1362 entries from dependency cache.
ERROR: ExpansionError during parsing /home/user/yocto-labs/poky/meta/recipes-extended/ninvaders/ninvaders_0.1.1.bb:00:00
Traceback (most recent call last):
  File "Var <do_fetch[file-checksums]>", line 1, in <module>
  File "/home/user/yocto-labs/poky/bitbake/lib/bb/fetch2/__init__.py", line 1224, in get_checksum_file_list(d=<bb.data_smart.DataSmart object at 0x7fc53dc5ae90>):
         """
    >    fetch = Fetch([], d, cache = False, localonly = True)
     
  File "/home/user/yocto-labs/poky/bitbake/lib/bb/fetch2/__init__.py", line 1682, in Fetch.__init__(urls=['${file:///home/user/Downloads/ninvaders-0.1.1.tar.gz'], d=<bb.data_smart.DataSmart object at 0x7fc53dc5ae90>, cache=False, localonly=True, connection_cache=None):
                     try:
    >                    self.ud[url] = FetchData(url, d, localonly)
                     except NonLocalMethod:
  File "/home/user/yocto-labs/poky/bitbake/lib/bb/fetch2/__init__.py", line 1309, in FetchData.__init__(url='${file:///home/user/Downloads/ninvaders-0.1.1.tar.gz', d=<bb.data_smart.DataSmart object at 0x7fc53dc5ae90>, localonly=True):
             if not self.method:
    >            raise NoMethodError(url)
     
bb.data_smart.ExpansionError: Failure expanding variable do_fetch[file-checksums], expression was ${@bb.fetch.get_checksum_file_list(d)}  ${@get_lic_checksum_file_list(d)} which triggered exception NoMethodError: Could not find a fetcher which supports the URL: '${file:///home/user/Downloads/ninvaders-0.1.1.tar.gz'
The variable dependency chain for the failure is: do_fetch[file-checksums]

ERROR: Parsing halted due to errors, see error messages above

Summary: There were 2 ERROR messages, returning a non-zero exit code.

I cannot find any solution to this case. Could you help me? thank you.


Solution

  • The error message is clear on what is wrong with your recipe:

    Could not find a fetcher which supports the URL: '${file:///home/user/Downloads/ninvaders-0.1.1.tar.gz'
    

    Please see the documentation for the fetcher:

    https://docs.yoctoproject.org/bitbake/2.6/bitbake-user-manual/bitbake-user-manual-fetching.html#local-file-fetcher-file

    The source URI must be in the format:

    SRC_URI = "file:///home/user/Downloads/${BP}.tar.gz"

    but you specified

    SRC_URI = "${file:///home/user/Downloads/${BP}.tar.gz"