Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <bristot@kernel.org>
|
|
#
|
|
# Generator for runtime verification monitor container
|
|
|
|
from . import generator
|
|
|
|
|
|
class Container(generator.RVGenerator):
|
|
template_dir = "container"
|
|
|
|
def __init__(self, extra_params={}):
|
|
super().__init__(extra_params)
|
|
self.name = extra_params.get("model_name")
|
|
self.main_h = self._read_template_file("main.h")
|
|
|
|
def fill_model_h(self):
|
|
main_h = self.main_h
|
|
main_h = main_h.replace("%%MODEL_NAME%%", self.name)
|
|
return main_h
|
|
|
|
def fill_kconfig_tooltip(self):
|
|
"""Override to produce a marker for this container in the Kconfig"""
|
|
container_marker = self._kconfig_marker(self.name) + "\n"
|
|
result = super().fill_kconfig_tooltip()
|
|
if self.auto_patch:
|
|
self._patch_file("Kconfig",
|
|
self._kconfig_marker(), container_marker)
|
|
return result
|
|
return result + container_marker
|