=== modified file 'lava_dispatcher/actions/deploy.py'
@@ -97,7 +97,7 @@
parameters_schema = {
'type': 'object',
'properties': {
- 'type': {'type': 'string', 'enum':['ubuntu', 'oe', 'android']},
+ 'type': {'type': 'string', 'enum':['ubuntu', 'oe', 'android', 'fedora']},
},
'additionalProperties': False,
}
=== modified file 'lava_dispatcher/actions/lava_test_shell.py'
@@ -148,6 +148,11 @@
Target.oe_deployment_data['lava_test_dir'] = '/lava'
Target.oe_deployment_data['lava_test_results_part_attr'] = 'root_part'
+Target.fedora_deployment_data['distro'] = 'fedora'
+Target.fedora_deployment_data['lava_test_sh_cmd'] = '/bin/bash'
+Target.fedora_deployment_data['lava_test_dir'] = '/lava'
+Target.fedora_deployment_data['lava_test_results_part_attr'] = 'root_part'
+
# 755 file permissions
XMOD = stat.S_IRWXU | stat.S_IXGRP | stat.S_IRGRP | stat.S_IXOTH | stat.S_IROTH
=== modified file 'lava_dispatcher/device/master.py'
@@ -67,14 +67,17 @@
Target.android_deployment_data['boot_cmds'] = 'boot_cmds_android'
Target.ubuntu_deployment_data['boot_cmds'] = 'boot_cmds'
Target.oe_deployment_data['boot_cmds'] = 'boot_cmds_oe'
+ Target.fedora_deployment_data['boot_cmds'] = 'boot_cmds'
# used for tarballcache logic to get proper boot_cmds
Target.ubuntu_deployment_data['data_type'] = 'ubuntu'
Target.oe_deployment_data['data_type'] = 'oe'
+ Target.fedora_deployment_data['data_type'] = 'fedora'
self.target_map = {
'android': Target.android_deployment_data,
'oe': Target.oe_deployment_data,
'ubuntu': Target.ubuntu_deployment_data,
+ 'fedora': Target.fedora_deployment_data,
}
self.master_ip = None
=== modified file 'lava_dispatcher/device/target.py'
@@ -58,6 +58,11 @@
'TESTER_PS1_PATTERN': "linaro-test \[rc=(\d+)\]# ",
'TESTER_PS1_INCLUDES_RC': True,
}
+ fedora_deployment_data = {
+ 'TESTER_PS1': "linaro-test [rc=$(echo \$?)]# ",
+ 'TESTER_PS1_PATTERN': "linaro-test \[rc=(\d+)\]# ",
+ 'TESTER_PS1_INCLUDES_RC': True,
+ }
def __init__(self, context, device_config):
self.context = context
@@ -163,11 +168,29 @@
with open('%s/etc/hostname' % rootdir, 'w') as f:
f.write('%s\n' % self.config.hostname)
+ def _customize_fedora(self, rootdir):
+ self.deployment_data = Target.fedora_deployment_data
+ with open('%s/etc/profile' % rootdir, 'a') as f:
+ f.write('export PS1="%s"\n' % self.deployment_data['TESTER_PS1'])
+ with open('%s/etc/hostname' % rootdir, 'w') as f:
+ f.write('%s\n' % self.config.hostname)
+
def _customize_linux(self, image):
root_part = self.config.root_part
+ os_release_id = 'linux'
with image_partition_mounted(image, root_part) as mnt:
- if os.path.exists('%s/etc/debian_version' % mnt):
+ os_release_file = '%s/etc/os-release' % mnt
+ if os.path.exists(os_release_file):
+ for line in open(os_release_file):
+ if line.startswith('ID='):
+ os_release_id = line[(len('ID=')):]
+ os_release_id = os_release_id.strip('\"\n')
+ break
+ if os_release_id == 'debian' or os_release_id == 'ubuntu' or \
+ os.path.exists('%s/etc/debian_version' % mnt):
self._customize_ubuntu(mnt)
+ elif os_release_id == 'fedora':
+ self._customize_fedora(mnt)
else:
# assume an OE based image. This is actually pretty safe
# because we are doing pretty standard linux stuff, just
=== added directory 'lava_test_shell/distro/fedora'
=== added file 'lava_test_shell/distro/fedora/lava-install-packages'
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+sudo yum -e 0 -y -q install "$@"
=== added file 'lava_test_shell/distro/fedora/lava-installed-packages'
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+rpm -qa --qf "package: %{NAME} : %{VERSION}-%{RELEASE} \n"
=== added file 'lava_test_shell/distro/fedora/lava-os-build'
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cat /etc/os-release | grep PRETTY_NAME | cut -d\" -f2