File tree 7 files changed +156
-146
lines changed
7 files changed +156
-146
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -553,7 +553,7 @@ Which components to build. Default: qemu-buildroot
553
553
else :
554
554
git_version_tuple = tuple (
555
555
int (x ) for x in self .sh .check_output (['git' , '--version' ]) \
556
- .split (' ' )[- 1 ].split ('.' )
556
+ .decode (). split (' ' )[- 1 ].split ('.' )
557
557
)
558
558
if git_version_tuple >= (2 , 9 , 0 ):
559
559
# https://stackoverflow.com/questions/26957237/how-to-make-git-clone-faster-with-multiple-threads/52327638#52327638
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ from the README to example sources to GitHub rather than locally.
50
50
for link in self .sh .check_output ([
51
51
os .path .join (asciidoctor_dir , 'extract-link-targets' ),
52
52
self .env ['readme' ]
53
- ]).splitlines ():
53
+ ]).decode (). splitlines ():
54
54
if not external_link_re .match (link ):
55
55
if not os .path .lexists (os .path .join (self .env ['root_dir' ], link )):
56
56
self .log_error ('broken link to local file: ' + link )
@@ -63,7 +63,7 @@ from the README to example sources to GitHub rather than locally.
63
63
for header_id in self .sh .check_output ([
64
64
os .path .join (asciidoctor_dir , 'extract-header-ids' ),
65
65
self .env ['readme' ]
66
- ]).splitlines ():
66
+ ]).decode (). splitlines ():
67
67
header_ids .add (header_id )
68
68
for grep_line in self .sh .check_output (
69
69
[
@@ -74,7 +74,7 @@ from the README to example sources to GitHub rather than locally.
74
74
LF
75
75
],
76
76
cwd = self .env ['root_dir' ]
77
- ).splitlines ():
77
+ ).decode (). splitlines ():
78
78
url_index = grep_line .index (self .env ['homepage_url' ])
79
79
hash_start_index = url_index + len (self .env ['homepage_url' ])
80
80
if len (grep_line ) > hash_start_index :
Original file line number Diff line number Diff line change @@ -1090,7 +1090,7 @@ def get_elf_entry(self, elf_file_path):
1090
1090
self .get_toolchain_tool ('readelf' ),
1091
1091
'-h' ,
1092
1092
elf_file_path
1093
- ])
1093
+ ]). decode ()
1094
1094
for line in readelf_header .decode ().split ('\n ' ):
1095
1095
split = line .split ()
1096
1096
if line .startswith (' Entry point address:' ):
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ https://cirosantilli.com/linux-kernel-module-cheat#release-upload
23
23
'describe' ,
24
24
'--exact-match' ,
25
25
'--tags'
26
- ]).rstrip ()
26
+ ]).decode (). rstrip ()
27
27
upload_path = self .env ['release_zip_file' ]
28
28
29
29
# Check the release already exists.
Original file line number Diff line number Diff line change @@ -415,8 +415,18 @@ Extra options to append at the end of the emulator command line.
415
415
self .env ['baremetal' ] is None and
416
416
self .env ['userland' ] is None
417
417
):
418
- # This is to run gem5 from a prebuilt download.
419
- self .sh .run_cmd ([self .env ['extract_vmlinux' ], self .env ['linux_image' ]])
418
+ # This is an attempte to run gem5 from a prebuilt download
419
+ # but it is not working:
420
+ # https://github.com/cirosantilli/linux-kernel-module-cheat/issues/79
421
+ self .sh .check_output (
422
+ [
423
+ self .env ['extract_vmlinux' ],
424
+ self .env ['linux_image' ]
425
+ ],
426
+ out_file = self .env ['image' ],
427
+ show_cmd = True ,
428
+ show_stdout = False
429
+ )
420
430
else :
421
431
raise_image_not_found ()
422
432
else :
Original file line number Diff line number Diff line change @@ -78,13 +78,20 @@ def base64_decode(self, string):
78
78
return base64 .b64decode (string .encode ()).decode ()
79
79
80
80
def check_output (self , * args , ** kwargs ):
81
+ '''
82
+ Analogous to subprocess.check_output: get the stdout / stderr
83
+ of a program back as a byte array.
84
+ '''
81
85
out_str = []
86
+ actual_kwargs = {
87
+ 'show_stdout' : False ,
88
+ 'show_cmd' : False
89
+ }
90
+ actual_kwargs .update (kwargs )
82
91
self .run_cmd (
83
92
* args ,
84
93
out_str = out_str ,
85
- show_stdout = False ,
86
- show_cmd = False ,
87
- ** kwargs
94
+ ** actual_kwargs
88
95
)
89
96
return out_str [0 ]
90
97
@@ -380,7 +387,7 @@ def run_cmd(
380
387
if out_file is not None :
381
388
logfile .close ()
382
389
if out_str is not None :
383
- out_str .append ((b'' .join (logfile_str )). decode () )
390
+ out_str .append ((b'' .join (logfile_str )))
384
391
if threading .current_thread () == threading .main_thread ():
385
392
signal .signal (signal .SIGINT , sigint_old )
386
393
#signal.signal(signal.SIGPIPE, sigpipe_old)
@@ -392,7 +399,7 @@ def run_cmd(
392
399
return returncode
393
400
else :
394
401
if not out_str is None :
395
- out_str .append ('' )
402
+ out_str .append (b '' )
396
403
return 0
397
404
398
405
def shlex_split (self , string ):
You can’t perform that action at this time.
0 commit comments