diff options
author | Ronan Le Martret <ronan.lemartret@iot.bzh> | 2018-08-30 12:16:20 +0000 |
---|---|---|
committer | Ronan Le Martret <ronan.lemartret@iot.bzh> | 2018-09-22 12:31:15 +0000 |
commit | e549f0c0e9d5c4d62394c7cef89a913eeb76f904 (patch) | |
tree | 21109582936ba7a63fb3ae4461906885c464813a /meta-rcar-gen3/include/checksum_control.inc | |
parent | b78b98ae25057d5afe4bff70581f37a0ff5e4a0e (diff) |
[AGL] Add driver control checksumguppy_6.99.2guppy_6.99.1guppy/6.99.2guppy/6.99.16.99.26.99.1
* As the driver files come from out of git repository,
we need to check driver file integrity.
Change-Id: I46f2a281f8da1ae606e8ae1ee55324fd5fd9b772
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
Diffstat (limited to 'meta-rcar-gen3/include/checksum_control.inc')
-rw-r--r-- | meta-rcar-gen3/include/checksum_control.inc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/meta-rcar-gen3/include/checksum_control.inc b/meta-rcar-gen3/include/checksum_control.inc new file mode 100644 index 0000000..e0decc7 --- /dev/null +++ b/meta-rcar-gen3/include/checksum_control.inc @@ -0,0 +1,25 @@ +require include/checksum_control_files.inc + +python do_checksum_control() { + to_check_dico = d.getVarFlags("CTL_CHECKSUM") + if to_check_dico is None: + return 0 + + src_uri = (d.getVar('SRC_URI') or "").split() + for s in src_uri: + c_source=os.path.basename(s) + bb.note("Check source: %s " % (c_source)) + if c_source in to_check_dico: + f_data = bb.fetch2.FetchData(s, d, True) + f_data.setup_localpath(d) + if os.path.exists(f_data.localpath): + mdr5_sum=bb.utils.md5_file(f_data.localpath) + mdr5_ctl=to_check_dico[c_source] + if mdr5_sum != mdr5_ctl: + bb.fatal( "File %s hash should be %s but %s find, please update your driver files." % (c_source, mdr5_ctl, mdr5_sum)) +} + +do_checksum_control[doc] = "Do a checksum of the archives source files" +do_checksum_control[vardeps] = "CTL_CHECKSUM" + +addtask do_checksum_control before do_unpack after do_fetch |