Fix Popen for python3.6
- Fix Popen for python3.6 - Fix allmodconfig when SHA1 signing of modules is not available Resolves: rhbz#2062829 Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
		
							parent
							
								
									2a84938dd6
								
							
						
					
					
						commit
						6d294447e9
					
				
							
								
								
									
										53
									
								
								rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,53 @@ | |||||||
|  | From cb8b42e3328f9a06b5a18dda64969f16196b9190 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: John Kacur <jkacur@redhat.com> | ||||||
|  | Date: Tue, 18 Jan 2022 15:03:36 -0500 | ||||||
|  | Subject: [PATCH 1/2] rteval: Fix Popen for python3.6 where text=True is not | ||||||
|  |  available | ||||||
|  | 
 | ||||||
|  | Fix using text=True in Popen for python-3.6 by using | ||||||
|  | encoding='utf-8' instead | ||||||
|  | 
 | ||||||
|  | Signed-off-by: John Kacur <jkacur@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  rteval/sysinfo/services.py | 8 ++++---- | ||||||
|  |  1 file changed, 4 insertions(+), 4 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/rteval/sysinfo/services.py b/rteval/sysinfo/services.py
 | ||||||
|  | index e5de22efc342..c85980e19165 100644
 | ||||||
|  | --- a/rteval/sysinfo/services.py
 | ||||||
|  | +++ b/rteval/sysinfo/services.py
 | ||||||
|  | @@ -62,11 +62,11 @@ class SystemServices:
 | ||||||
|  |              if not [1 for p in reject if fnmatch.fnmatch(servicename, p)] \ | ||||||
|  |                      and os.access(service, os.X_OK): | ||||||
|  |                  cmd = '%s -qs "\(^\|\W\)status)" %s' % (getcmdpath('grep'), service) | ||||||
|  | -                c = subprocess.Popen(cmd, shell=True, text=True)
 | ||||||
|  | +                c = subprocess.Popen(cmd, shell=True, encoding='utf-8')
 | ||||||
|  |                  c.wait() | ||||||
|  |                  if c.returncode == 0: | ||||||
|  |                      cmd = ['env', '-i', 'LANG="%s"' % os.environ['LANG'], 'PATH="%s"' % os.environ['PATH'], 'TERM="%s"' % os.environ['TERM'], service, 'status'] | ||||||
|  | -                    c = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
 | ||||||
|  | +                    c = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8')
 | ||||||
|  |                      c.wait() | ||||||
|  |                      if c.returncode == 0 and (c.stdout.read() or c.stderr.read()): | ||||||
|  |                          ret_services[servicename] = 'running' | ||||||
|  | @@ -81,7 +81,7 @@ class SystemServices:
 | ||||||
|  |          ret_services = {} | ||||||
|  |          cmd = '%s list-unit-files -t service --no-legend' % getcmdpath('systemctl') | ||||||
|  |          self.__log(Log.DEBUG, "cmd: %s" % cmd) | ||||||
|  | -        c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
 | ||||||
|  | +        c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8')
 | ||||||
|  |          for p in c.stdout: | ||||||
|  |              # p are lines like b'servicename.service status' | ||||||
|  |              v = p.strip().split() | ||||||
|  | @@ -91,7 +91,7 @@ class SystemServices:
 | ||||||
|  |   | ||||||
|  |      def services_get(self): | ||||||
|  |          cmd = [getcmdpath('ps'), '-ocomm=', '1'] | ||||||
|  | -        c = subprocess.Popen(cmd, stdout=subprocess.PIPE, text=True)
 | ||||||
|  | +        c = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf-8')
 | ||||||
|  |          self.__init = c.stdout.read().strip() | ||||||
|  |          if self.__init == 'systemd': | ||||||
|  |              self.__log(Log.DEBUG, "Using systemd to get services status") | ||||||
|  | -- 
 | ||||||
|  | 2.35.1 | ||||||
|  | 
 | ||||||
							
								
								
									
										31
									
								
								rteval-Fix-allmodconfig-build-on-machines-that-don-t.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								rteval-Fix-allmodconfig-build-on-machines-that-don-t.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,31 @@ | |||||||
|  | From 5931ace285305edbf8c86508f89869c5f3be0bf0 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: John Kacur <jkacur@redhat.com> | ||||||
|  | Date: Wed, 9 Mar 2022 14:03:10 -0500 | ||||||
|  | Subject: [PATCH 2/2] rteval: Fix allmodconfig build on machines that don't | ||||||
|  |  allow sha1 signing | ||||||
|  | 
 | ||||||
|  | rteval compiles the kernel using allmodconfig as a load. | ||||||
|  | This can be a problem if sha1 signing of modules is disabled. | ||||||
|  | Fix this by signing with sha512 | ||||||
|  | 
 | ||||||
|  | Suggested-by: Juri Lelli <juri.lelli@redhat.com> | ||||||
|  | Signed-off-by: John Kacur <jkacur@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  rteval/modules/loads/kcompile.py | 1 + | ||||||
|  |  1 file changed, 1 insertion(+) | ||||||
|  | 
 | ||||||
|  | diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
 | ||||||
|  | index 8f97d38eca56..367f8dc1ca86 100644
 | ||||||
|  | --- a/rteval/modules/loads/kcompile.py
 | ||||||
|  | +++ b/rteval/modules/loads/kcompile.py
 | ||||||
|  | @@ -66,6 +66,7 @@ class KBuildJob:
 | ||||||
|  |   | ||||||
|  |          self.runcmd = f"make O={self.objdir} -C {self.kdir} -j{self.jobs}" | ||||||
|  |          self.cleancmd = f"make O={self.objdir} -C {self.kdir} clean allmodconfig" | ||||||
|  | +        self.cleancmd += f"&& pushd {self.objdir} && {self.kdir}/scripts/config -d CONFIG_MODULE_SIG_SHA1 -e CONFIG_MODULE_SIG_SHA512 && popd && make O={self.objdir} -C {self.kdir} olddefconfig"
 | ||||||
|  |          if self.binder: | ||||||
|  |              self.runcmd = self.binder + " " + self.runcmd | ||||||
|  |              self.cleancmd = self.binder + " " + self.cleancmd | ||||||
|  | -- 
 | ||||||
|  | 2.35.1 | ||||||
|  | 
 | ||||||
							
								
								
									
										11
									
								
								rteval.spec
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								rteval.spec
									
									
									
									
									
								
							| @ -1,6 +1,6 @@ | |||||||
| Name:		rteval | Name:		rteval | ||||||
| Version:	3.3 | Version:	3.3 | ||||||
| Release:	3%{?dist} | Release:	4%{?dist} | ||||||
| Summary:	Utility to evaluate system suitability for RT Linux | Summary:	Utility to evaluate system suitability for RT Linux | ||||||
| 
 | 
 | ||||||
| Group:		Development/Tools | Group:		Development/Tools | ||||||
| @ -33,6 +33,8 @@ Patch1: rteval-Fix-test-misses-threshold-assignment.patch | |||||||
| Patch2: rteval-Increase-default-buckets-from-2000-to-3500.patch | Patch2: rteval-Increase-default-buckets-from-2000-to-3500.patch | ||||||
| Patch3: rteval-Don-t-restrict-measurement-threads-to-inherit.patch | Patch3: rteval-Don-t-restrict-measurement-threads-to-inherit.patch | ||||||
| Patch4: rteval-If-the-user-doesn-t-specify-a-cpumask-use-the.patch | Patch4: rteval-If-the-user-doesn-t-specify-a-cpumask-use-the.patch | ||||||
|  | Patch5: rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch | ||||||
|  | Patch6: rteval-Fix-allmodconfig-build-on-machines-that-don-t.patch | ||||||
| 
 | 
 | ||||||
| %description | %description | ||||||
| The rteval script is a utility for measuring various aspects of | The rteval script is a utility for measuring various aspects of | ||||||
| @ -49,6 +51,8 @@ to the screen. | |||||||
| %patch2 -p1 | %patch2 -p1 | ||||||
| %patch3 -p1 | %patch3 -p1 | ||||||
| %patch4 -p1 | %patch4 -p1 | ||||||
|  | %patch5 -p1 | ||||||
|  | %patch6 -p1 | ||||||
| 
 | 
 | ||||||
| %build | %build | ||||||
| %{__python3} setup.py build | %{__python3} setup.py build | ||||||
| @ -75,6 +79,11 @@ rm -rf $RPM_BUILD_ROOT | |||||||
| %{python3_sitelib}/rteval/__pycache__/* | %{python3_sitelib}/rteval/__pycache__/* | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Thu Apr 14 2022 John Kacur <jkacur@redhat.com> - 3.3-4 | ||||||
|  | - Fix Popen for python3.6 | ||||||
|  | - Fix allmodconfig when SHA1 signing of modules is not available | ||||||
|  | Resolves: rhbz#2062829 | ||||||
|  | 
 | ||||||
| * Tue Feb 15 2022 John Kacur <jkacur@redhat.com> - 3.3-3 | * Tue Feb 15 2022 John Kacur <jkacur@redhat.com> - 3.3-3 | ||||||
| - Use inherited cpumask if user doesn't specify a cpumask | - Use inherited cpumask if user doesn't specify a cpumask | ||||||
| Resolves: rhbz#1983783 | Resolves: rhbz#1983783 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user