summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-06-30 19:12:13 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-07-07 18:22:48 +0000
commit5fcc9a62210d9bc005114f49bb47ff3255831c54 (patch)
treeee1a3d4954e25946f899223d1ebd52dfb3a9befd /meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc
parentf3b2aec86747e1ea57089ba475f54bed4c280aaa (diff)
Add driver control checksum
Port of https://git.automotivelinux.org/AGL/meta-renesas-rcar-gen3/commit/?id=9e58bd97144ab56a7858c6cd2206d3bd793bb09e Original commit message: * As the driver files come from out of git repository, we need to check driver file integrity. FormerChange-Id: I46f2a281f8da1ae606e8ae1ee55324fd5fd9b772 Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh> Bug-AGL: SPEC-3443 Change-Id: If8cb040cae4ca227b883f4cdf250e3afec503976 Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/24909 Reviewed-by: Stéphane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc')
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc25
1 files changed, 25 insertions, 0 deletions
diff --git a/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc
new file mode 100644
index 000000000..3e2bf8f1c
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc
@@ -0,0 +1,25 @@
+require 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