Skip to content

Check for kernel SHA1 to match also signed tags'

Darryl Green requested to merge github/fork/balsini/master_b into master

Created by: balsini

Since a signed tag has a SHA1 that differs from the one associated with the commit to which it is referring, this was causing false negatives when verifying the correspondence between the current kernel version of the device and of the local repository.

This patch, when there is no correspondence between the current SHA1 of the repository and the kernel of the device, verifies if there is a tag pointing to the same SHA1 and performs the comparison with it.

It also inverts the substirng checking: it checks if the SHA1 of the kernel is contained in the SHA1 of the repo, since this last should be longer. In order to do this, the following steps are followed:

  • take the kernel release (uname -a), e.g. "4.4.88-g0e6b355-00003-g36e8d7f";
  • take the last element, considering '-' as separator, e.g. "g36e8d7f";
  • remove the first character, e.g. "36e8d7f";
  • check if this SHA1 is contained in the SHA1 of the current repository.

Merge request reports