in device_info_pkg/device_info_pkg/device_info_node.py [0:0]
def load_sb(self):
"""Function to load the secure boot varible based on the result of the od command executed.
"""
cmd = constants.SECURE_BOOT_CMD
try:
proc = subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True)
stdout = str(proc.communicate()[0]).split()
if len(stdout) >= 3:
if stdout[2].strip() == "1":
self.sb = "on"
else:
self.sb = "off"
self.get_logger().info(f"Loading secure boot information: {self.sb}")
else:
self.get_logger().error("od command did not return right values")
except Exception as ex:
self.get_logger().error(f"Failed to execute secure boot info cmd: {cmd} err:{ex}")