[poky] [PATCH 1/1] FetchData: add SRC_URI checksum

Yu Ke ke.yu at intel.com
Thu Dec 16 01:16:09 PST 2010


On Dec 15, 09:12, Richard Purdie wrote:
> Hi Ke,
> 
> This patch looks good in general, just a couple of minor things:
> 
> On Tue, 2010-12-14 at 15:55 +0800, Yu Ke wrote:
> >  
> > +def verify_checksum(d, ud):
> > +    """
> > +    verify the MD5 and SHA256 checksum for downloaded src
> > +    return True if matched, False if not
> > +    """
> 
> This should be more explicit about the missing checksums case.

thanks for the review. and yes, will do that.

> 
> > +    md5data = bb.utils.md5_file(ud.localpath)
> > +    sha256data = bb.utils.sha256_file(ud.localpath)
> > +
> > +    if (ud.md5_expected == None or ud.sha256_expected == None):
> > +        bb.warn("Missing SRC_URI checksum for %s, consider to add\n" \
> > +                "SRC_URI[%s] = \"%s\"\nSRC_URI[%s] = \"%s\"" \
> > +                % (ud.localpath, ud.md5_name, md5data, ud.sha256_name, sha256data))
> > +        # TODO: change to "return False" once all recpies has checksum entry
> > +        return True
> 
> We can't just redefine "policy" like this in bitbake. I think missing
> checksums will always be warnings and we might just make warnings
> optionally fatal for bitbake.

for the "make warnings optionally fatal in bitbake", do you mean add a variable like "BB_STRICT_CHECKSUM" in config file, and if for example "BB_STRICT_CHECKSUMS" = "1", then fatal, otherwise, just warning?

> 
> What does this do for file:// urls or SCM urls?

Good catch. It should only verify for "http/https/ftp/ftps" protocol, other protocol like local file and SCM url should just return.

Regards
Ke

> 
> Otherwise I'm good with the patch and if you tweak these things I'll
> merge it.
> 
> Cheers,
> 
> Richard
> 
> 
> _______________________________________________
> poky mailing list
> poky at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky



More information about the poky mailing list