mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 12:28:44 +00:00
Gem5Device: Removed busybox dependency.
This commit is contained in:
parent
a330a64340
commit
32cf5c0939
@ -276,9 +276,9 @@ class BaseGem5Device(object):
|
|||||||
# Try and avoid line wrapping as much as possible. Don't check the error
|
# Try and avoid line wrapping as much as possible. Don't check the error
|
||||||
# codes from these command because some of them WILL fail.
|
# codes from these command because some of them WILL fail.
|
||||||
self.gem5_shell('stty columns 1024', check_exit_code=False)
|
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('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)
|
self.gem5_shell('reset', check_exit_code=False)
|
||||||
|
|
||||||
def get_properties(self, context): # pylint: disable=R0801
|
def get_properties(self, context): # pylint: disable=R0801
|
||||||
@ -323,7 +323,7 @@ class BaseGem5Device(object):
|
|||||||
|
|
||||||
def get_pids_of(self, process_name):
|
def get_pids_of(self, process_name):
|
||||||
""" Returns a list of PIDs of all processes with the specified 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()
|
check_exit_code=False).strip()
|
||||||
if result and 'not found' not in result and len(result.split('\n')) > 2:
|
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')]
|
return [int(x.split()[1]) for x in result.split('\n')]
|
||||||
@ -384,8 +384,11 @@ class BaseGem5Device(object):
|
|||||||
|
|
||||||
# Back to the gem5 world
|
# Back to the gem5 world
|
||||||
self.gem5_shell("ls -al /mnt/obb/{}".format(filename))
|
self.gem5_shell("ls -al /mnt/obb/{}".format(filename))
|
||||||
self.gem5_shell("busybox cp /mnt/obb/{} {}".format(filename, dest))
|
if self.busybox:
|
||||||
self.gem5_shell("busybox sync")
|
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 {}".format(dest))
|
||||||
self.gem5_shell("ls -al /mnt/obb/")
|
self.gem5_shell("ls -al /mnt/obb/")
|
||||||
self.logger.debug("Push complete.")
|
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
|
# 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
|
# and destination are the same. The ls below will cause an error if the
|
||||||
# file was not where we expected it to be.
|
# file was not where we expected it to be.
|
||||||
self.gem5_shell("busybox cp {} {}".format(source, filename), check_exit_code=False)
|
self.gem5_shell("{} cp {} {}".format(self.busybox, source, filename),
|
||||||
self.gem5_shell("busybox sync")
|
check_exit_code=False)
|
||||||
|
self.gem5_shell("sync")
|
||||||
self.gem5_shell("ls -la {}".format(filename))
|
self.gem5_shell("ls -la {}".format(filename))
|
||||||
self.logger.debug('Finished the copy in the simulator')
|
self.logger.debug('Finished the copy in the simulator')
|
||||||
self.gem5_util("writefile {}".format(filename))
|
self.gem5_util("writefile {}".format(filename))
|
||||||
@ -641,10 +645,8 @@ class BaseGem5Device(object):
|
|||||||
"""
|
"""
|
||||||
self.logger.info("Mounting VirtIO device in simulated system")
|
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)
|
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)
|
||||||
self.gem5_shell(mount_command)
|
|
||||||
else:
|
|
||||||
self.gem5_shell('busybox {}'.format(mount_command))
|
|
||||||
|
@ -71,8 +71,6 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
|
|||||||
|
|
||||||
* m5 binary. Please make sure that the m5 binary is on the device and
|
* m5 binary. Please make sure that the m5 binary is on the device and
|
||||||
can by found in the path.
|
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'
|
name = 'gem5_android'
|
||||||
@ -133,8 +131,8 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
|
|||||||
self.push_file(filepath, on_device_path)
|
self.push_file(filepath, on_device_path)
|
||||||
# We need to make sure that the folder permissions are set
|
# We need to make sure that the folder permissions are set
|
||||||
# correctly, else the APK does not install correctly.
|
# correctly, else the APK does not install correctly.
|
||||||
self.gem5_shell('busybox chmod 775 /data/local/tmp')
|
self.gem5_shell('chmod 775 /data/local/tmp')
|
||||||
self.gem5_shell('busybox chmod 774 {}'.format(on_device_path))
|
self.gem5_shell('chmod 774 {}'.format(on_device_path))
|
||||||
self.logger.debug("Actually installing the APK: {}".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))
|
return self.gem5_shell("pm install {}".format(on_device_path))
|
||||||
else:
|
else:
|
||||||
@ -146,8 +144,11 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
|
|||||||
on_device_file = self.path.join(self.working_directory, executable_name)
|
on_device_file = self.path.join(self.working_directory, executable_name)
|
||||||
on_device_executable = self.path.join(self.binaries_directory, executable_name)
|
on_device_executable = self.path.join(self.binaries_directory, executable_name)
|
||||||
self.push_file(filepath, on_device_file)
|
self.push_file(filepath, on_device_file)
|
||||||
self.execute('busybox cp {} {}'.format(on_device_file, on_device_executable))
|
if self.busybox:
|
||||||
self.execute('busybox chmod 0777 {}'.format(on_device_executable))
|
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
|
return on_device_executable
|
||||||
|
|
||||||
def uninstall(self, package):
|
def uninstall(self, package):
|
||||||
|
@ -68,8 +68,6 @@ class Gem5LinuxDevice(BaseGem5Device, LinuxDevice):
|
|||||||
|
|
||||||
* m5 binary. Please make sure that the m5 binary is on the device and
|
* m5 binary. Please make sure that the m5 binary is on the device and
|
||||||
can by found in the path.
|
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'
|
name = 'gem5_linux'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user