[bitbake-devel] [PATCH 0/1] Make the fetcher expand checksums

Peter Kjellerstedt peter.kjellerstedt at axis.com
Tue Mar 8 23:59:44 UTC 2016


> -----Original Message-----
> From: bitbake-devel-bounces at lists.openembedded.org [mailto:bitbake-
> devel-bounces at lists.openembedded.org] On Behalf Of Peter Kjellerstedt
> Sent: den 9 mars 2016 00:54
> To: bitbake-devel at lists.openembedded.org
> Subject: [bitbake-devel] [PATCH 0/1] Make the fetcher expand checksums
> 
> We needed a way to override the checksums for a recipe from a
> configuration file, e.g., local.conf. I first tried the naive:
> 
>     SRC_URI_pn-myrecipe[md5sum] = "123abc..."
>     SRC_URI_pn-myrecipe[sha256sum] = "abcd1234..."
> 
> which of course did not work.

Btw, is there any way to do what I tried to do above, i.e., 
override variable flags from a configuration file? That would 
have been so much nicer than having to modify the recipe as I 
do below to be able to override the checksums.

> Then I modified the recipe as:
> 
>     SRC_URI = "http://.../${PN}-${PV}.tar.gz"
> 
>     MD5SUM = "123abc..."
>     SHA256SUM = "abcd1234..."
> 
>     SRC_URI[md5sum] = "${MD5SUM}"
>     SRC_URI[sha256sum] = "${SHA256SUM}"
> 
> which I had assumed would work, but it did not. Finally I tried:
> 
>     MD5SUM = "123abc..."
>     SHA256SUM = "abcd1234..."
> 
>     SRC_URI = "http://.../${PN}-
> ${PV}.tar.gz;md5sum=${MD5SUM};sha256sum=${SHA256SUM}"
> 
> which actually did work.
> 
> Looking into why the second solution above did not work it turned out
> that the fetcher code called d.getVarFlag("SRC_URI", ..., False),
> i.e., without expanding the checksum values. I cannot see any reason
> not to expand the values, so the following patch does that.
> 
> //Peter
> 
> The following changes since commit
> 5ac3dc76a5afc2ed35b1abfc8e330e0c580eadf0:
> 
>   image.bbclass: fix incomplete .rootfs customization (2016-03-07
> 22:10:54 +0000)
> 
> are available in the git repository at:
> 
>   git://git.yoctoproject.org/poky-contrib pkj/expand_checksums
>   http://git.yoctoproject.org/cgit.cgi/poky-
> contrib/log/?h=pkj/expand_checksums
> 
> Peter Kjellerstedt (1):
>   fetch2: Make SRC_URI[md5sum] and SRC_URI[sha256sum] expand their
>     values
> 
>  bitbake/lib/bb/fetch2/__init__.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --
> 2.1.0

//Peter




More information about the bitbake-devel mailing list