@@ -60,15 +60,27 @@ def runTest(self):
60
60
self .skipTest ("Skip Gcov Setup as system already booted with Gcov Kernel" )
61
61
self .distro_name = self .util .distro_name ()
62
62
log .info ("OS: %s" % self .distro_name )
63
+ dep_packages = ["rpm-build" , "gcc*" , "perl*" ]
63
64
if self .distro_name == 'rhel' :
64
65
self .installer = "yum install"
66
+ dep_packages .extend (["yum-utils" , "tiny*" ])
65
67
elif self .distro_name == 'sles' :
66
68
self .installer = "zypper install"
67
- dep_packages = ["rpm-build" , "gcc*" , "perl*" , "tiny*" ]
69
+ dep_packages .extend (["hmaccalc" , "flex" , "libelf-devel" , "libopenssl-devel" , "pesign-obs-integration" , "dwarves" ])
70
+ log .info ("\n \n Need to enable Unsupported Modules for Sles....\n " )
71
+ log .info ("enabling Unsupported Modules for Sles....\n " )
72
+ file_path = '/lib/modprobe.d/10-unsupported-modules.conf'
73
+ cmd = f"sed -i 's/allow_unsupported_modules 0/allow_unsupported_modules 1/g' { file_path } "
74
+ self .cv_HOST .host_run_command (cmd )
75
+ out = self .cv_HOST .host_run_command (f"cat { file_path } | grep -i ^allow_unsupported_modules" )
76
+ for line in out :
77
+ if line .split (" " )[- 1 ] == '1' :
78
+ log .info ("Successfuly enabled Unsupported Modules for Sles." )
79
+ else :
80
+ log .info ("Failed to enabled Unsupported Modules for Sles." )
68
81
log .info (f"\n Installing following dependency packages\n { dep_packages } " )
69
82
for pkg in dep_packages :
70
83
if self .distro_name == 'rhel' :
71
- dep_packages .append ("yum-utils" )
72
84
self .cv_HOST .host_run_command (f"{ self .installer } { pkg } -y" )
73
85
elif self .distro_name == 'sles' :
74
86
self .cv_HOST .host_run_command (f"{ self .installer } -y { pkg } " )
@@ -119,6 +131,14 @@ def add_gcov_param(self, conf_file):
119
131
"""
120
132
k_config_params = ["CONFIG_GCOV_KERNEL=y" , "CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y" , "CONFIG_GCOV_PROFILE_ALL=y" , "CONFIG_GCOV_PROFILE_FTRACE=y" ]
121
133
err_param = []
134
+
135
+ # Adding the Gcov parameter to new building kernel
136
+ cmd = f"sed -i 's/CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=\" -Gcov\" /g' { conf_file } "
137
+ self .cv_HOST .host_run_command (cmd )
138
+ if self .distro_name == 'sles' :
139
+ cmd = f"sed -i 's/CONFIG_MODULE_SIG_KEY=.*/CONFIG_MODULE_SIG_KEY=\" \" /g' { conf_file } "
140
+ self .cv_HOST .host_run_command (cmd )
141
+
122
142
for param in k_config_params :
123
143
log .info ("\n working on param %s" % param )
124
144
unset_param = param
0 commit comments