summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2019-03-04 09:07:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-04 22:57:05 +0000
commit9120e52ba15535da8ec34502a441aaeaadfb4e9d (patch)
tree5fe4fb01c6eb7effe62c3b69a6c730b2ce65db5e /meta/lib
parentea706bdea9b257865c5eefa22cdca6a677446d9a (diff)
downloadpoky-9120e52ba15535da8ec34502a441aaeaadfb4e9d.tar.gz
masterimage: remove code duplication
Two identical classes exist for SystemdbootTarget, introduced in commit f9a61d3400ad ("gummiboot: Remove/change gummiboot references with systemd-boot") poky commit 2dce2648e3d8 Remove the duplicated copy. (From OE-Core rev: a59562c7ddbda1a266f0ea22ab78fb86de4861a3) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/controllers/masterimage.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py
index a2912fc568..f175e119da 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -197,43 +197,3 @@ class SystemdbootTarget(MasterImageHardwareTarget):
197 self.power_cycle(self.master) 197 self.power_cycle(self.master)
198 # there are better ways than a timeout but this should work for now 198 # there are better ways than a timeout but this should work for now
199 time.sleep(120) 199 time.sleep(120)
200
201
202class SystemdbootTarget(MasterImageHardwareTarget):
203
204 def __init__(self, d):
205 super(SystemdbootTarget, self).__init__(d)
206 # this the value we need to set in the LoaderEntryOneShot EFI variable
207 # so the system boots the 'test' bootloader label and not the default
208 # The first four bytes are EFI bits, and the rest is an utf-16le string
209 # (EFI vars values need to be utf-16)
210 # $ echo -en "test\0" | iconv -f ascii -t utf-16le | hexdump -C
211 # 00000000 74 00 65 00 73 00 74 00 00 00 |t.e.s.t...|
212 self.efivarvalue = r'\x07\x00\x00\x00\x74\x00\x65\x00\x73\x00\x74\x00\x00\x00'
213 self.deploy_cmds = [
214 'mount -L boot /boot',
215 'mkdir -p /mnt/testrootfs',
216 'mount -L testrootfs /mnt/testrootfs',
217 'modprobe efivarfs',
218 'mount -t efivarfs efivarfs /sys/firmware/efi/efivars',
219 'cp ~/test-kernel /boot',
220 'rm -rf /mnt/testrootfs/*',
221 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
222 'printf "%s" > /sys/firmware/efi/efivars/LoaderEntryOneShot-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f' % self.efivarvalue
223 ]
224
225 def _deploy(self):
226 # make sure these aren't mounted
227 self.master.run("umount /boot; umount /mnt/testrootfs; umount /sys/firmware/efi/efivars;")
228 # from now on, every deploy cmd should return 0
229 # else an exception will be thrown by sshcontrol
230 self.master.ignore_status = False
231 self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
232 self.master.copy_to(self.kernel, "~/test-kernel")
233 for cmd in self.deploy_cmds:
234 self.master.run(cmd)
235
236 def _start(self, params=None):
237 self.power_cycle(self.master)
238 # there are better ways than a timeout but this should work for now
239 time.sleep(120)