1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 11:58:55 +00:00

Gem5Device: Removed busybox dependency.

This commit is contained in:
Sascha Bischoff 2015-12-08 16:02:17 +00:00
parent a330a64340
commit 32cf5c0939
3 changed files with 21 additions and 20 deletions

View File

@ -276,9 +276,9 @@ class BaseGem5Device(object):
# Try and avoid line wrapping as much as possible. Don't check the error
# codes from these command because some of them WILL fail.
self.gem5_shell('stty columns 1024', check_exit_code=False)
self.gem5_shell('busybox stty columns 1024', check_exit_code=False)
self.gem5_shell('{} stty columns 1024'.format(self.busybox), check_exit_code=False)
self.gem5_shell('stty cols 1024', check_exit_code=False)
self.gem5_shell('busybox stty cols 1024', check_exit_code=False)
self.gem5_shell('{} stty cols 1024'.format(self.busybox), check_exit_code=False)
self.gem5_shell('reset', check_exit_code=False)
def get_properties(self, context): # pylint: disable=R0801
@ -323,7 +323,7 @@ class BaseGem5Device(object):
def get_pids_of(self, process_name):
""" Returns a list of PIDs of all processes with the specified name. """
result = self.gem5_shell('ps | busybox grep {}'.format(process_name),
result = self.gem5_shell('ps | {} grep {}'.format(self.busybox, process_name),
check_exit_code=False).strip()
if result and 'not found' not in result and len(result.split('\n')) > 2:
return [int(x.split()[1]) for x in result.split('\n')]
@ -384,8 +384,11 @@ class BaseGem5Device(object):
# Back to the gem5 world
self.gem5_shell("ls -al /mnt/obb/{}".format(filename))
self.gem5_shell("busybox cp /mnt/obb/{} {}".format(filename, dest))
self.gem5_shell("busybox sync")
if self.busybox:
self.gem5_shell("{} cp /mnt/obb/{} {}".format(self.busybox, filename, dest))
else:
self.gem5_shell("cat /mnt/obb/{} > {}".format(filename, dest))
self.gem5_shell("sync")
self.gem5_shell("ls -al {}".format(dest))
self.gem5_shell("ls -al /mnt/obb/")
self.logger.debug("Push complete.")
@ -417,8 +420,9 @@ class BaseGem5Device(object):
# We don't check the exit code here because it is non-zero if the source
# and destination are the same. The ls below will cause an error if the
# file was not where we expected it to be.
self.gem5_shell("busybox cp {} {}".format(source, filename), check_exit_code=False)
self.gem5_shell("busybox sync")
self.gem5_shell("{} cp {} {}".format(self.busybox, source, filename),
check_exit_code=False)
self.gem5_shell("sync")
self.gem5_shell("ls -la {}".format(filename))
self.logger.debug('Finished the copy in the simulator')
self.gem5_util("writefile {}".format(filename))
@ -641,10 +645,8 @@ class BaseGem5Device(object):
"""
self.logger.info("Mounting VirtIO device in simulated system")
self.gem5_shell('busybox mkdir -p /mnt/obb')
self.gem5_shell('mkdir -p /mnt/obb')
mount_command = "mount -t 9p -o trans=virtio,version=9p2000.L,aname={} gem5 /mnt/obb".format(self.temp_dir)
if self.platform == 'linux':
self.gem5_shell(mount_command)
else:
self.gem5_shell('busybox {}'.format(mount_command))
self.gem5_shell(mount_command)

View File

@ -71,8 +71,6 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
* m5 binary. Please make sure that the m5 binary is on the device and
can by found in the path.
* Busybox. Due to restrictions, we assume that busybox is installed in
the guest system, and can be found in the path.
"""
name = 'gem5_android'
@ -133,8 +131,8 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
self.push_file(filepath, on_device_path)
# We need to make sure that the folder permissions are set
# correctly, else the APK does not install correctly.
self.gem5_shell('busybox chmod 775 /data/local/tmp')
self.gem5_shell('busybox chmod 774 {}'.format(on_device_path))
self.gem5_shell('chmod 775 /data/local/tmp')
self.gem5_shell('chmod 774 {}'.format(on_device_path))
self.logger.debug("Actually installing the APK: {}".format(on_device_path))
return self.gem5_shell("pm install {}".format(on_device_path))
else:
@ -146,8 +144,11 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
on_device_file = self.path.join(self.working_directory, executable_name)
on_device_executable = self.path.join(self.binaries_directory, executable_name)
self.push_file(filepath, on_device_file)
self.execute('busybox cp {} {}'.format(on_device_file, on_device_executable))
self.execute('busybox chmod 0777 {}'.format(on_device_executable))
if self.busybox:
self.execute('{} cp {} {}'.format(self.busybox, on_device_file, on_device_executable))
else:
self.execute('cat {} > {}'.format(on_device_file, on_device_executable))
self.execute('chmod 0777 {}'.format(on_device_executable))
return on_device_executable
def uninstall(self, package):

View File

@ -68,8 +68,6 @@ class Gem5LinuxDevice(BaseGem5Device, LinuxDevice):
* m5 binary. Please make sure that the m5 binary is on the device and
can by found in the path.
* Busybox. Due to restrictions, we assume that busybox is installed in
the guest system, and can be found in the path.
"""
name = 'gem5_linux'