diff options
author | Corneliu Stoicescu <corneliux.stoicescu@intel.com> | 2014-06-06 22:14:33 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-06-13 12:52:20 +0100 |
commit | 41d300067b8ce9290abe38cc5a4c56215ce3eff1 (patch) | |
tree | ddaee637fd4cea20cb3d2be9ce79d8949ad207b6 /meta | |
parent | af384220175dc548d8eb0b94209c49c937292d91 (diff) | |
download | poky-41d300067b8ce9290abe38cc5a4c56215ce3eff1.tar.gz |
masterimage.py: enable dynamical determination of rootfs type
YB: #6375
Adding support for get_image_fstype() in the MasterImageHardwareTarget and GummibootTarget classes.
(From OE-Core rev: 06ed50a2b8c311e56ac9f1c6f2145bc020d5d500)
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/controllers/masterimage.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py index f2585d4860..b03c5bf74b 100644 --- a/meta/lib/oeqa/controllers/masterimage.py +++ b/meta/lib/oeqa/controllers/masterimage.py | |||
@@ -28,6 +28,8 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget): | |||
28 | 28 | ||
29 | __metaclass__ = ABCMeta | 29 | __metaclass__ = ABCMeta |
30 | 30 | ||
31 | supported_image_fstypes = ['tar.gz', 'tar.bz2'] | ||
32 | |||
31 | def __init__(self, d): | 33 | def __init__(self, d): |
32 | super(MasterImageHardwareTarget, self).__init__(d) | 34 | super(MasterImageHardwareTarget, self).__init__(d) |
33 | 35 | ||
@@ -48,7 +50,8 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget): | |||
48 | bb.note("Server IP: %s" % self.server_ip) | 50 | bb.note("Server IP: %s" % self.server_ip) |
49 | 51 | ||
50 | # test rootfs + kernel | 52 | # test rootfs + kernel |
51 | self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.tar.gz') | 53 | self.image_fstype = self.get_image_fstype(d) |
54 | self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype) | ||
52 | self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE")) | 55 | self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE")) |
53 | if not os.path.isfile(self.rootfs): | 56 | if not os.path.isfile(self.rootfs): |
54 | # we could've checked that IMAGE_FSTYPES contains tar.gz but the config for running testimage might not be | 57 | # we could've checked that IMAGE_FSTYPES contains tar.gz but the config for running testimage might not be |
@@ -177,7 +180,7 @@ class GummibootTarget(MasterImageHardwareTarget): | |||
177 | 'mount -t efivarfs efivarfs /sys/firmware/efi/efivars', | 180 | 'mount -t efivarfs efivarfs /sys/firmware/efi/efivars', |
178 | 'cp ~/test-kernel /boot', | 181 | 'cp ~/test-kernel /boot', |
179 | 'rm -rf /mnt/testrootfs/*', | 182 | 'rm -rf /mnt/testrootfs/*', |
180 | 'tar xzvf ~/test-rootfs.tar.gz -C /mnt/testrootfs', | 183 | 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype, |
181 | 'printf "%s" > /sys/firmware/efi/efivars/LoaderEntryOneShot-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f' % self.efivarvalue | 184 | 'printf "%s" > /sys/firmware/efi/efivars/LoaderEntryOneShot-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f' % self.efivarvalue |
182 | ] | 185 | ] |
183 | 186 | ||
@@ -187,7 +190,7 @@ class GummibootTarget(MasterImageHardwareTarget): | |||
187 | # from now on, every deploy cmd should return 0 | 190 | # from now on, every deploy cmd should return 0 |
188 | # else an exception will be thrown by sshcontrol | 191 | # else an exception will be thrown by sshcontrol |
189 | self.master.ignore_status = False | 192 | self.master.ignore_status = False |
190 | self.master.copy_to(self.rootfs, "~/test-rootfs.tar.gz") | 193 | self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype) |
191 | self.master.copy_to(self.kernel, "~/test-kernel") | 194 | self.master.copy_to(self.kernel, "~/test-kernel") |
192 | for cmd in self.deploy_cmds: | 195 | for cmd in self.deploy_cmds: |
193 | self.master.run(cmd) | 196 | self.master.run(cmd) |