Merge lp:~terceiro/lava-dispatcher/bootloadertype into lp:lava-dispatcher

Proposed by Antonio Terceiro
Status: Merged
Merged at revision: 666
Proposed branch: lp:~terceiro/lava-dispatcher/bootloadertype
Merge into: lp:lava-dispatcher
Diff against target: 256 lines (+33/-32)
9 files modified
lava_dispatcher/actions/deploy.py (+3/-3)
lava_dispatcher/client/targetdevice.py (+3/-3)
lava_dispatcher/device/bootloader.py (+4/-4)
lava_dispatcher/device/fastmodel.py (+10/-9)
lava_dispatcher/device/ipmi_pxe.py (+3/-3)
lava_dispatcher/device/master.py (+3/-3)
lava_dispatcher/device/qemu.py (+3/-3)
lava_dispatcher/device/sdmux.py (+2/-2)
lava_dispatcher/device/target.py (+2/-2)
To merge this branch: bzr merge lp:~terceiro/lava-dispatcher/bootloadertype
Reviewer Review Type Date Requested Status
Tyler Baker Approve
Linaro Validation Team Pending
Review via email: mp+183291@code.launchpad.net

Description of the change

This patch makes two changes:

  - first, it addds a bootloadertype argument to the
    deploy_linaro_prebuilt action, which makes it possible to specify
    which bootloader is present in the image. This makes it possible for
    example to interact with uefi when using a prebuilt image, what
    previosly was only possible with hwpack+rootfs (for prebuilt image
    u-boot was always assumed)

  - second, the "bootloader" argument is being renamed to
    "bootloadertype", which is what it actually means.
    The `bootloader` device uses a "bootloader" argument that actually
    means the bootloader, i.e. you are supposed to pass the URL of a
    bootloader binary to it.

To post a comment you must log in.
Revision history for this message
Tyler Baker (tyler-baker) wrote :

Approved. I grepped through the tip, looks to me you have renamed all occurances. Thanks for enabling the prebuilt images!

I'm curious if you have tested UEFI booting with a prebuilt image with these changes? I suggest we add a functional test cases for UEFI / AXF booting with a prebuilt image.

The only CI job I'm aware of that uses the old "bootloader" parameter is: http://validation.linaro.org/dashboard/image-reports/linux-efi-stub

When we deploy to production, we need to communicate this change to Fathi at that time.

review: Approve
Revision history for this message
Antonio Terceiro (terceiro) wrote :

On Tue, Sep 03, 2013 at 11:53:24PM -0000, Tyler Baker wrote:
> Review: Approve
>
> Approved. I grepped through the tip, looks to me you have renamed all
> occurances. Thanks for enabling the prebuilt images!
>
> I'm curious if you have tested UEFI booting with a prebuilt image with
> these changes?

I did, that was actually my initial motivation - having to wait for
l-m-c every time was killing me. ;-)

> I suggest we add a functional test cases for UEFI / AXF booting with a
> prebuilt image.

Agreed. Can you please create one based on

http://community.validation.linaro.org/images/armv7-fastmodel/hwpack_linaro-vexpress_20130811-427_armhf_supported.tar.gz
http://community.validation.linaro.org/images/armv7-fastmodel/linaro-raring-nano-lava-20130811-459.tar.gz

and let me know?

I already did the renaming from bootloader to bootloadertype in the repository.

> The only CI job I'm aware of that uses the old "bootloader" parameter
> is:
> http://validation.linaro.org/dashboard/image-reports/linux-efi-stub
>
> When we deploy to production, we need to communicate this change to Fathi at that time.

I'm talking to him on IRC about it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/actions/deploy.py'
2--- lava_dispatcher/actions/deploy.py 2013-08-28 14:55:50 +0000
3+++ lava_dispatcher/actions/deploy.py 2013-08-30 22:17:08 +0000
4@@ -54,7 +54,7 @@
5 'rootfs': {'type': 'string', 'optional': True},
6 'image': {'type': 'string', 'optional': True},
7 'rootfstype': {'type': 'string', 'optional': True},
8- 'bootloader': {'type': 'string', 'optional': True, 'default': 'u_boot'},
9+ 'bootloadertype': {'type': 'string', 'optional': True, 'default': 'u_boot'},
10 'role': {'type': 'string', 'optional': True},
11 },
12 'additionalProperties': False,
13@@ -71,9 +71,9 @@
14 elif 'image' not in parameters:
15 raise ValueError('must specify image if not specifying a hwpack')
16
17- def run(self, hwpack=None, rootfs=None, image=None, rootfstype='ext3', bootloader='u_boot'):
18+ def run(self, hwpack=None, rootfs=None, image=None, rootfstype='ext3', bootloadertype='u_boot'):
19 self.client.deploy_linaro(
20- hwpack=hwpack, rootfs=rootfs, image=image, rootfstype=rootfstype, bootloader=bootloader)
21+ hwpack=hwpack, rootfs=rootfs, image=image, rootfstype=rootfstype, bootloadertype=bootloadertype)
22
23
24 class cmd_deploy_linaro_android_image(BaseAction):
25
26=== modified file 'lava_dispatcher/client/targetdevice.py'
27--- lava_dispatcher/client/targetdevice.py 2013-08-28 14:55:50 +0000
28+++ lava_dispatcher/client/targetdevice.py 2013-08-30 22:17:08 +0000
29@@ -50,7 +50,7 @@
30 self.target_device.deploy_android(boot, system, data)
31
32 def deploy_linaro(self, hwpack=None, rootfs=None, image=None,
33- rootfstype='ext3', bootloader='u_boot'):
34+ rootfstype='ext3', bootloadertype='u_boot'):
35 if image is None:
36 if hwpack is None or rootfs is None:
37 raise CriticalError(
38@@ -60,9 +60,9 @@
39 "cannot specify hwpack or rootfs when specifying image")
40
41 if image is None:
42- self.target_device.deploy_linaro(hwpack, rootfs, bootloader)
43+ self.target_device.deploy_linaro(hwpack, rootfs, bootloadertype)
44 else:
45- self.target_device.deploy_linaro_prebuilt(image)
46+ self.target_device.deploy_linaro_prebuilt(image, bootloadertype)
47
48 def deploy_linaro_kernel(self, kernel, ramdisk=None, dtb=None, rootfs=None,
49 bootloader=None, firmware=None, rootfstype='ext4',
50
51=== modified file 'lava_dispatcher/device/bootloader.py'
52--- lava_dispatcher/device/bootloader.py 2013-08-28 14:55:50 +0000
53+++ lava_dispatcher/device/bootloader.py 2013-08-30 22:17:08 +0000
54@@ -113,13 +113,13 @@
55 raise CriticalError("U-Boot is the only supported bootloader \
56 at this time")
57
58- def deploy_linaro(self, hwpack, rfs, bootloader):
59+ def deploy_linaro(self, hwpack, rfs, bootloadertype):
60 self._uboot_boot = False
61- super(BootloaderTarget, self).deploy_linaro(hwpack, rfs, bootloader)
62+ super(BootloaderTarget, self).deploy_linaro(hwpack, rfs, bootloadertype)
63
64- def deploy_linaro_prebuilt(self, image):
65+ def deploy_linaro_prebuilt(self, image, bootloadertype):
66 self._uboot_boot = False
67- super(BootloaderTarget, self).deploy_linaro_prebuilt(image)
68+ super(BootloaderTarget, self).deploy_linaro_prebuilt(image, bootloadertype)
69
70 def _inject_boot_cmds(self):
71 if self._is_job_defined_boot_cmds(self.config.boot_cmds):
72
73=== modified file 'lava_dispatcher/device/fastmodel.py'
74--- lava_dispatcher/device/fastmodel.py 2013-08-28 14:55:50 +0000
75+++ lava_dispatcher/device/fastmodel.py 2013-08-30 22:17:08 +0000
76@@ -68,7 +68,7 @@
77 self._dtb = None
78 self._initrd = None
79 self._uefi = None
80- self._bootloader = 'u_boot'
81+ self._bootloadertype = 'u_boot'
82
83 def _customize_android(self):
84 with image_partition_mounted(self._sd_image, self.DATA_PARTITION) as d:
85@@ -103,7 +103,7 @@
86
87 def _copy_needed_files_from_directory(self, subdir):
88 odir = os.path.dirname(self._sd_image)
89- if self._bootloader == 'u_boot':
90+ if self._bootloadertype == 'u_boot':
91 # Extract the bootwrapper from the image
92 if self.config.simulator_axf_files and self._axf is None:
93 self._axf = self._copy_first_find_from_list(subdir, odir,
94@@ -120,14 +120,14 @@
95 if self.config.simulator_dtb and self._dtb is None:
96 self._dtb = self._find_and_copy(
97 subdir, odir, self.config.simulator_dtb)
98- elif self._bootloader == 'uefi':
99+ elif self._bootloadertype == 'uefi':
100 # Extract the uefi binary from the image
101 if self.config.simulator_uefi and self._uefi is None:
102 self._uefi = self._find_and_copy(
103 subdir, odir, self.config.simulator_uefi)
104
105 def _check_needed_files(self):
106- if self._bootloader == 'u_boot':
107+ if self._bootloadertype == 'u_boot':
108 # AXF is needed when we are not using UEFI
109 if self._axf is None and self.config.simulator_axf_files:
110 raise RuntimeError('No AXF found, %r' %
111@@ -144,7 +144,7 @@
112 if self._dtb is None and self.config.simulator_dtb:
113 raise RuntimeError('No DTB found, %r' %
114 self.config.simulator_dtb)
115- elif self._bootloader == 'uefi':
116+ elif self._bootloadertype == 'uefi':
117 # UEFI binary is needed when specified
118 if self._uefi is None and self.config.simulator_uefi:
119 raise RuntimeError('No UEFI binary found, %r' %
120@@ -167,14 +167,14 @@
121
122 self._customize_android()
123
124- def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'):
125+ def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype='u_boot'):
126 hwpack = download_image(hwpack, self.context, decompress=False)
127 rootfs = download_image(rootfs, self.context, decompress=False)
128 odir = os.path.dirname(rootfs)
129
130- self._bootloader = bootloader
131+ self._bootloadertype = bootloadertype
132
133- generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloader)
134+ generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloadertype)
135 self._sd_image = '%s/sd.img' % odir
136
137 self._copy_needed_files_from_directory(odir)
138@@ -183,8 +183,9 @@
139
140 self._customize_linux(self._sd_image)
141
142- def deploy_linaro_prebuilt(self, image):
143+ def deploy_linaro_prebuilt(self, image, bootloadertype):
144 self._sd_image = download_image(image, self.context)
145+ self._bootloadertype = bootloadertype
146
147 self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm')
148 self._copy_needed_files_from_partition(self.config.root_part, 'boot')
149
150=== modified file 'lava_dispatcher/device/ipmi_pxe.py'
151--- lava_dispatcher/device/ipmi_pxe.py 2013-07-16 16:06:42 +0000
152+++ lava_dispatcher/device/ipmi_pxe.py 2013-08-30 22:17:08 +0000
153@@ -73,13 +73,13 @@
154 def power_off(self, proc):
155 pass
156
157- def deploy_linaro(self, hwpack, rfs, bootloader):
158- image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloader,
159+ def deploy_linaro(self, hwpack, rfs, bootloadertype):
160+ image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloadertype,
161 extra_boot_args='1', image_size='1G')
162 self._customize_linux(image_file)
163 self._deploy_image(image_file, '/dev/sda')
164
165- def deploy_linaro_prebuilt(self, image):
166+ def deploy_linaro_prebuilt(self, image, bootloadertype):
167 image_file = download_image(image, self.context, self.scratch_dir)
168 self._customize_linux(image_file)
169 self._deploy_image(image_file, '/dev/sda')
170
171=== modified file 'lava_dispatcher/device/master.py'
172--- lava_dispatcher/device/master.py 2013-08-28 14:55:50 +0000
173+++ lava_dispatcher/device/master.py 2013-08-30 22:17:08 +0000
174@@ -106,10 +106,10 @@
175 if self.config.power_off_cmd:
176 self.context.run_command(self.config.power_off_cmd)
177
178- def deploy_linaro(self, hwpack, rfs, bootloader):
179+ def deploy_linaro(self, hwpack, rfs, bootloadertype):
180 self.boot_master_image()
181
182- image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloader)
183+ image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloadertype)
184 (boot_tgz, root_tgz, data) = self._generate_tarballs(image_file)
185
186 self._read_boot_cmds(boot_tgz=boot_tgz)
187@@ -149,7 +149,7 @@
188 _deploy_linaro_android_system(master, system_url)
189 _deploy_linaro_android_data(master, data_url)
190
191- def deploy_linaro_prebuilt(self, image):
192+ def deploy_linaro_prebuilt(self, image, bootloadertype):
193 self.boot_master_image()
194
195 if self.context.job_data.get('health_check', False):
196
197=== modified file 'lava_dispatcher/device/qemu.py'
198--- lava_dispatcher/device/qemu.py 2013-08-28 14:55:50 +0000
199+++ lava_dispatcher/device/qemu.py 2013-08-30 22:17:08 +0000
200@@ -78,14 +78,14 @@
201 else:
202 raise CriticalError("No kernel images to boot")
203
204- def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'):
205+ def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype='u_boot'):
206 odir = self.scratch_dir
207- self._sd_image = generate_image(self, hwpack, rootfs, odir, bootloader)
208+ self._sd_image = generate_image(self, hwpack, rootfs, odir, bootloadertype)
209 self._customize_linux(self._sd_image)
210 self.append_qemu_options(self.config.qemu_options.format(
211 DISK_IMAGE=self._sd_image))
212
213- def deploy_linaro_prebuilt(self, image):
214+ def deploy_linaro_prebuilt(self, image, bootloadertype='u_boot'):
215 self._sd_image = download_image(image, self.context)
216 self._customize_linux(self._sd_image)
217 self.append_qemu_options(self.config.qemu_options.format(
218
219=== modified file 'lava_dispatcher/device/sdmux.py'
220--- lava_dispatcher/device/sdmux.py 2013-07-16 16:04:07 +0000
221+++ lava_dispatcher/device/sdmux.py 2013-08-30 22:17:08 +0000
222@@ -88,12 +88,12 @@
223 if config.pre_connect_command:
224 self.context.run_command(config.pre_connect_command)
225
226- def deploy_linaro(self, hwpack=None, rootfs=None, bootloader=None):
227+ def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype=None):
228 img = generate_image(self, hwpack, rootfs, self.scratch_dir)
229 self._customize_linux(img)
230 self._write_image(img)
231
232- def deploy_linaro_prebuilt(self, image):
233+ def deploy_linaro_prebuilt(self, image, bootloadertype=None):
234 img = download_image(image, self.context)
235 self._customize_linux(img)
236 self._write_image(img)
237
238=== modified file 'lava_dispatcher/device/target.py'
239--- lava_dispatcher/device/target.py 2013-08-28 14:55:50 +0000
240+++ lava_dispatcher/device/target.py 2013-08-30 22:17:08 +0000
241@@ -89,13 +89,13 @@
242 """
243 raise NotImplementedError('power_on')
244
245- def deploy_linaro(self, hwpack, rfs, bootloader):
246+ def deploy_linaro(self, hwpack, rfs, bootloadertype):
247 raise NotImplementedError('deploy_image')
248
249 def deploy_android(self, boot, system, userdata):
250 raise NotImplementedError('deploy_android_image')
251
252- def deploy_linaro_prebuilt(self, image):
253+ def deploy_linaro_prebuilt(self, image, bootloadertype):
254 raise NotImplementedError('deploy_linaro_prebuilt')
255
256 def power_off(self, proc):

Subscribers

People subscribed via source and target branches