Skip to content

Commit 7b0ac77

Browse files
committed
relase: get failed extract-vmlinux automation back working
Only the command is back in business, but it does not work: cirosantilli#79
1 parent 4c71ac5 commit 7b0ac77

File tree

7 files changed

+156
-146
lines changed

7 files changed

+156
-146
lines changed

Diff for: README.adoc

+126-133
Large diffs are not rendered by default.

Diff for: build

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ Which components to build. Default: qemu-buildroot
553553
else:
554554
git_version_tuple = tuple(
555555
int(x) for x in self.sh.check_output(['git', '--version']) \
556-
.split(' ')[-1].split('.')
556+
.decode().split(' ')[-1].split('.')
557557
)
558558
if git_version_tuple >= (2, 9, 0):
559559
# https://stackoverflow.com/questions/26957237/how-to-make-git-clone-faster-with-multiple-threads/52327638#52327638

Diff for: build-doc

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ from the README to example sources to GitHub rather than locally.
5050
for link in self.sh.check_output([
5151
os.path.join(asciidoctor_dir, 'extract-link-targets'),
5252
self.env['readme']
53-
]).splitlines():
53+
]).decode().splitlines():
5454
if not external_link_re.match(link):
5555
if not os.path.lexists(os.path.join(self.env['root_dir'], link)):
5656
self.log_error('broken link to local file: ' + link)
@@ -63,7 +63,7 @@ from the README to example sources to GitHub rather than locally.
6363
for header_id in self.sh.check_output([
6464
os.path.join(asciidoctor_dir, 'extract-header-ids'),
6565
self.env['readme']
66-
]).splitlines():
66+
]).decode().splitlines():
6767
header_ids.add(header_id)
6868
for grep_line in self.sh.check_output(
6969
[
@@ -74,7 +74,7 @@ from the README to example sources to GitHub rather than locally.
7474
LF
7575
],
7676
cwd=self.env['root_dir']
77-
).splitlines():
77+
).decode().splitlines():
7878
url_index = grep_line.index(self.env['homepage_url'])
7979
hash_start_index = url_index + len(self.env['homepage_url'])
8080
if len(grep_line) > hash_start_index:

Diff for: common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ def get_elf_entry(self, elf_file_path):
10901090
self.get_toolchain_tool('readelf'),
10911091
'-h',
10921092
elf_file_path
1093-
])
1093+
]).decode()
10941094
for line in readelf_header.decode().split('\n'):
10951095
split = line.split()
10961096
if line.startswith(' Entry point address:'):

Diff for: release-upload

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ https://cirosantilli.com/linux-kernel-module-cheat#release-upload
2323
'describe',
2424
'--exact-match',
2525
'--tags'
26-
]).rstrip()
26+
]).decode().rstrip()
2727
upload_path = self.env['release_zip_file']
2828

2929
# Check the release already exists.

Diff for: run

+12-2
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,18 @@ Extra options to append at the end of the emulator command line.
415415
self.env['baremetal'] is None and
416416
self.env['userland'] is None
417417
):
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+
)
420430
else:
421431
raise_image_not_found()
422432
else:

Diff for: shell_helpers.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,20 @@ def base64_decode(self, string):
7878
return base64.b64decode(string.encode()).decode()
7979

8080
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+
'''
8185
out_str = []
86+
actual_kwargs = {
87+
'show_stdout': False,
88+
'show_cmd': False
89+
}
90+
actual_kwargs.update(kwargs)
8291
self.run_cmd(
8392
*args,
8493
out_str=out_str,
85-
show_stdout=False,
86-
show_cmd=False,
87-
**kwargs
94+
**actual_kwargs
8895
)
8996
return out_str[0]
9097

@@ -380,7 +387,7 @@ def run_cmd(
380387
if out_file is not None:
381388
logfile.close()
382389
if out_str is not None:
383-
out_str.append((b''.join(logfile_str)).decode())
390+
out_str.append((b''.join(logfile_str)))
384391
if threading.current_thread() == threading.main_thread():
385392
signal.signal(signal.SIGINT, sigint_old)
386393
#signal.signal(signal.SIGPIPE, sigpipe_old)
@@ -392,7 +399,7 @@ def run_cmd(
392399
return returncode
393400
else:
394401
if not out_str is None:
395-
out_str.append('')
402+
out_str.append(b'')
396403
return 0
397404

398405
def shlex_split(self, string):

0 commit comments

Comments
 (0)