Blame tests/p_kernel/01_kernel_centos_keyring.sh

Athmane Madjoudj b84468
#!/bin/sh
Athmane Madjoudj b84468
# Author: Athmane Madjoudj <athmanem@gmail.com>
Athmane Madjoudj 0a4730
# Note: This was a known issue with CentOS 6.0 GA kernel
Athmane Madjoudj b84468
Athmane Madjoudj b84468
t_Log "Running $0 -  check CentOS' Kernel Module GPG key."
Athmane Madjoudj b84468
Johnny Hughes 97c696
uname_arch=$(uname -m)
8c2386
uname_kernel=$(uname -r)
8c2386
uname_kernel=${uname_kernel:0:6}
8c2386
Johnny Hughes 97c696
f6703e
if [ "$uname_arch" == "aarch64" ] || [ "$uname_arch" == "armv7l" ] || [ "$uname_arch" == "i686" ]; then
2b3708
  t_Log "*** Not testing on Arch: $uname_arch ***"
Johnny Hughes 97c696
  exit 0
Johnny Hughes 97c696
fi
Johnny Hughes 97c696
Pablo Greco 8d3da8
if [ "$centos_ver" -ge 7 ] ; then
Pablo Greco 8d3da8
  if [ "$centos_ver" -eq 7 ];then
8c2386
    if [ "$uname_arch" == "ppc64le" -a "$uname_kernel" == "4.18.0" ];then
8c2386
      # power9 with c8 kernel
8c2386
      ring=.builtin_trusted_keys
8c2386
    else
8c2386
      ring=.system_keyring
8c2386
    fi
Pablo Greco 8d3da8
  else
Pablo Greco 8d3da8
    ring=.builtin_trusted_keys
Pablo Greco 8d3da8
  fi
1ced04
  for id in kpatch "Driver update" kernel
0c76e1
  do
0c76e1
    t_Log "Verifying x.509 CentOS ${id}"
Pablo Greco 8d3da8
    keyctl list %:$ring | grep -i "CentOS Linux ${id} signing key" > /dev/null 2>&1
0c76e1
    t_CheckExitStatus $?
0c76e1
  done
0c76e1
else
0c76e1
  grep 'User ID: CentOS (Kernel Module GPG key)' /var/log/dmesg > /dev/null 2>&1
0c76e1
  t_CheckExitStatus $?
0c76e1
fi
Athmane Madjoudj b84468