All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rteval: kcompile: Fix source tarball argument handling
@ 2022-05-03 11:01 Valentin Schneider
  2022-05-05 14:33 ` John Kacur
  0 siblings, 1 reply; 2+ messages in thread
From: Valentin Schneider @ 2022-05-03 11:01 UTC (permalink / raw)
  To: linux-rt-users; +Cc: John Kacur, Clark Williams

Kcompile._WorkloadSetup() looks for a "tarball" and "tarfile" entry in
the CfgSection, but I couldn't find a single setter for thoses. The
only way for a user to specify a file is via --kcompile-source, which
doesn't seem to be actually used by the module.

Make Kcompile actually use --kcompile-source.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
---
 rteval/modules/loads/kcompile.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
index 367f8dc..023b9d6 100644
--- a/rteval/modules/loads/kcompile.py
+++ b/rteval/modules/loads/kcompile.py
@@ -28,6 +28,7 @@ import sys
 import os
 import os.path
 import glob
+import re
 import subprocess
 from rteval.modules import rtevalRuntimeError
 from rteval.modules.loads import CommandLineLoad
@@ -35,7 +36,7 @@ from rteval.Log import Log
 from rteval.misc import expand_cpulist, compress_cpulist
 from rteval.systopology import SysTopology
 
-kernel_prefix = "linux-5.13"
+DEFAULT_KERNEL_PREFIX = "linux-5.13"
 
 class KBuildJob:
     '''Class to manage a build job bound to a particular node'''
@@ -163,17 +164,19 @@ class Kcompile(CommandLineLoad):
             return
 
         # find our source tarball
-        if 'tarball' in self._cfg:
-            tarfile = os.path.join(self.srcdir, self._cfg.tarfile)
+        if self._cfg.source:
+            tarfile = os.path.join(self.srcdir, self._cfg.source)
             if not os.path.exists(tarfile):
                 raise rtevalRuntimeError(self, " tarfile %s does not exist!" % tarfile)
             self.source = tarfile
+            kernel_prefix = re.search(r"linux-\d\.\d", self.source).group(0)
         else:
-            tarfiles = glob.glob(os.path.join(self.srcdir, "%s*" % kernel_prefix))
+            tarfiles = glob.glob(os.path.join(self.srcdir, "%s*" % DEFAULT_KERNEL_PREFIX))
             if tarfiles:
                 self.source = tarfiles[0]
             else:
                 raise rtevalRuntimeError(self, " no kernel tarballs found in %s" % self.srcdir)
+            kernel_prefix = DEFAULT_KERNEL_PREFIX
 
         # check for existing directory
         kdir = None
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rteval: kcompile: Fix source tarball argument handling
  2022-05-03 11:01 [PATCH] rteval: kcompile: Fix source tarball argument handling Valentin Schneider
@ 2022-05-05 14:33 ` John Kacur
  0 siblings, 0 replies; 2+ messages in thread
From: John Kacur @ 2022-05-05 14:33 UTC (permalink / raw)
  To: Valentin Schneider; +Cc: linux-rt-users, Clark Williams



On Tue, 3 May 2022, Valentin Schneider wrote:

> Kcompile._WorkloadSetup() looks for a "tarball" and "tarfile" entry in
> the CfgSection, but I couldn't find a single setter for thoses. The
> only way for a user to specify a file is via --kcompile-source, which
> doesn't seem to be actually used by the module.
> 
> Make Kcompile actually use --kcompile-source.
> 
> Signed-off-by: Valentin Schneider <vschneid@redhat.com>
> ---
>  rteval/modules/loads/kcompile.py | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
> index 367f8dc..023b9d6 100644
> --- a/rteval/modules/loads/kcompile.py
> +++ b/rteval/modules/loads/kcompile.py
> @@ -28,6 +28,7 @@ import sys
>  import os
>  import os.path
>  import glob
> +import re
>  import subprocess
>  from rteval.modules import rtevalRuntimeError
>  from rteval.modules.loads import CommandLineLoad
> @@ -35,7 +36,7 @@ from rteval.Log import Log
>  from rteval.misc import expand_cpulist, compress_cpulist
>  from rteval.systopology import SysTopology
>  
> -kernel_prefix = "linux-5.13"
> +DEFAULT_KERNEL_PREFIX = "linux-5.13"
>  
>  class KBuildJob:
>      '''Class to manage a build job bound to a particular node'''
> @@ -163,17 +164,19 @@ class Kcompile(CommandLineLoad):
>              return
>  
>          # find our source tarball
> -        if 'tarball' in self._cfg:
> -            tarfile = os.path.join(self.srcdir, self._cfg.tarfile)
> +        if self._cfg.source:
> +            tarfile = os.path.join(self.srcdir, self._cfg.source)
>              if not os.path.exists(tarfile):
>                  raise rtevalRuntimeError(self, " tarfile %s does not exist!" % tarfile)
>              self.source = tarfile
> +            kernel_prefix = re.search(r"linux-\d\.\d", self.source).group(0)
>          else:
> -            tarfiles = glob.glob(os.path.join(self.srcdir, "%s*" % kernel_prefix))
> +            tarfiles = glob.glob(os.path.join(self.srcdir, "%s*" % DEFAULT_KERNEL_PREFIX))
>              if tarfiles:
>                  self.source = tarfiles[0]
>              else:
>                  raise rtevalRuntimeError(self, " no kernel tarballs found in %s" % self.srcdir)
> +            kernel_prefix = DEFAULT_KERNEL_PREFIX
>  
>          # check for existing directory
>          kdir = None
> -- 
> 2.27.0
> 
> 

Signed-off-by: John Kacur <jkacur@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-05 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 11:01 [PATCH] rteval: kcompile: Fix source tarball argument handling Valentin Schneider
2022-05-05 14:33 ` John Kacur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.