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
=== modified file 'lava_dispatcher/actions/deploy.py'
--- lava_dispatcher/actions/deploy.py 2013-08-28 14:55:50 +0000
+++ lava_dispatcher/actions/deploy.py 2013-08-30 22:17:08 +0000
@@ -54,7 +54,7 @@
54 'rootfs': {'type': 'string', 'optional': True},54 'rootfs': {'type': 'string', 'optional': True},
55 'image': {'type': 'string', 'optional': True},55 'image': {'type': 'string', 'optional': True},
56 'rootfstype': {'type': 'string', 'optional': True},56 'rootfstype': {'type': 'string', 'optional': True},
57 'bootloader': {'type': 'string', 'optional': True, 'default': 'u_boot'},57 'bootloadertype': {'type': 'string', 'optional': True, 'default': 'u_boot'},
58 'role': {'type': 'string', 'optional': True},58 'role': {'type': 'string', 'optional': True},
59 },59 },
60 'additionalProperties': False,60 'additionalProperties': False,
@@ -71,9 +71,9 @@
71 elif 'image' not in parameters:71 elif 'image' not in parameters:
72 raise ValueError('must specify image if not specifying a hwpack')72 raise ValueError('must specify image if not specifying a hwpack')
7373
74 def run(self, hwpack=None, rootfs=None, image=None, rootfstype='ext3', bootloader='u_boot'):74 def run(self, hwpack=None, rootfs=None, image=None, rootfstype='ext3', bootloadertype='u_boot'):
75 self.client.deploy_linaro(75 self.client.deploy_linaro(
76 hwpack=hwpack, rootfs=rootfs, image=image, rootfstype=rootfstype, bootloader=bootloader)76 hwpack=hwpack, rootfs=rootfs, image=image, rootfstype=rootfstype, bootloadertype=bootloadertype)
7777
7878
79class cmd_deploy_linaro_android_image(BaseAction):79class cmd_deploy_linaro_android_image(BaseAction):
8080
=== modified file 'lava_dispatcher/client/targetdevice.py'
--- lava_dispatcher/client/targetdevice.py 2013-08-28 14:55:50 +0000
+++ lava_dispatcher/client/targetdevice.py 2013-08-30 22:17:08 +0000
@@ -50,7 +50,7 @@
50 self.target_device.deploy_android(boot, system, data)50 self.target_device.deploy_android(boot, system, data)
5151
52 def deploy_linaro(self, hwpack=None, rootfs=None, image=None,52 def deploy_linaro(self, hwpack=None, rootfs=None, image=None,
53 rootfstype='ext3', bootloader='u_boot'):53 rootfstype='ext3', bootloadertype='u_boot'):
54 if image is None:54 if image is None:
55 if hwpack is None or rootfs is None:55 if hwpack is None or rootfs is None:
56 raise CriticalError(56 raise CriticalError(
@@ -60,9 +60,9 @@
60 "cannot specify hwpack or rootfs when specifying image")60 "cannot specify hwpack or rootfs when specifying image")
6161
62 if image is None:62 if image is None:
63 self.target_device.deploy_linaro(hwpack, rootfs, bootloader)63 self.target_device.deploy_linaro(hwpack, rootfs, bootloadertype)
64 else:64 else:
65 self.target_device.deploy_linaro_prebuilt(image)65 self.target_device.deploy_linaro_prebuilt(image, bootloadertype)
6666
67 def deploy_linaro_kernel(self, kernel, ramdisk=None, dtb=None, rootfs=None, 67 def deploy_linaro_kernel(self, kernel, ramdisk=None, dtb=None, rootfs=None,
68 bootloader=None, firmware=None, rootfstype='ext4', 68 bootloader=None, firmware=None, rootfstype='ext4',
6969
=== modified file 'lava_dispatcher/device/bootloader.py'
--- lava_dispatcher/device/bootloader.py 2013-08-28 14:55:50 +0000
+++ lava_dispatcher/device/bootloader.py 2013-08-30 22:17:08 +0000
@@ -113,13 +113,13 @@
113 raise CriticalError("U-Boot is the only supported bootloader \113 raise CriticalError("U-Boot is the only supported bootloader \
114 at this time")114 at this time")
115115
116 def deploy_linaro(self, hwpack, rfs, bootloader):116 def deploy_linaro(self, hwpack, rfs, bootloadertype):
117 self._uboot_boot = False117 self._uboot_boot = False
118 super(BootloaderTarget, self).deploy_linaro(hwpack, rfs, bootloader)118 super(BootloaderTarget, self).deploy_linaro(hwpack, rfs, bootloadertype)
119119
120 def deploy_linaro_prebuilt(self, image):120 def deploy_linaro_prebuilt(self, image, bootloadertype):
121 self._uboot_boot = False121 self._uboot_boot = False
122 super(BootloaderTarget, self).deploy_linaro_prebuilt(image)122 super(BootloaderTarget, self).deploy_linaro_prebuilt(image, bootloadertype)
123123
124 def _inject_boot_cmds(self):124 def _inject_boot_cmds(self):
125 if self._is_job_defined_boot_cmds(self.config.boot_cmds):125 if self._is_job_defined_boot_cmds(self.config.boot_cmds):
126126
=== modified file 'lava_dispatcher/device/fastmodel.py'
--- lava_dispatcher/device/fastmodel.py 2013-08-28 14:55:50 +0000
+++ lava_dispatcher/device/fastmodel.py 2013-08-30 22:17:08 +0000
@@ -68,7 +68,7 @@
68 self._dtb = None68 self._dtb = None
69 self._initrd = None69 self._initrd = None
70 self._uefi = None70 self._uefi = None
71 self._bootloader = 'u_boot'71 self._bootloadertype = 'u_boot'
7272
73 def _customize_android(self):73 def _customize_android(self):
74 with image_partition_mounted(self._sd_image, self.DATA_PARTITION) as d:74 with image_partition_mounted(self._sd_image, self.DATA_PARTITION) as d:
@@ -103,7 +103,7 @@
103103
104 def _copy_needed_files_from_directory(self, subdir):104 def _copy_needed_files_from_directory(self, subdir):
105 odir = os.path.dirname(self._sd_image)105 odir = os.path.dirname(self._sd_image)
106 if self._bootloader == 'u_boot':106 if self._bootloadertype == 'u_boot':
107 # Extract the bootwrapper from the image107 # Extract the bootwrapper from the image
108 if self.config.simulator_axf_files and self._axf is None:108 if self.config.simulator_axf_files and self._axf is None:
109 self._axf = self._copy_first_find_from_list(subdir, odir,109 self._axf = self._copy_first_find_from_list(subdir, odir,
@@ -120,14 +120,14 @@
120 if self.config.simulator_dtb and self._dtb is None:120 if self.config.simulator_dtb and self._dtb is None:
121 self._dtb = self._find_and_copy(121 self._dtb = self._find_and_copy(
122 subdir, odir, self.config.simulator_dtb)122 subdir, odir, self.config.simulator_dtb)
123 elif self._bootloader == 'uefi':123 elif self._bootloadertype == 'uefi':
124 # Extract the uefi binary from the image124 # Extract the uefi binary from the image
125 if self.config.simulator_uefi and self._uefi is None:125 if self.config.simulator_uefi and self._uefi is None:
126 self._uefi = self._find_and_copy(126 self._uefi = self._find_and_copy(
127 subdir, odir, self.config.simulator_uefi)127 subdir, odir, self.config.simulator_uefi)
128128
129 def _check_needed_files(self):129 def _check_needed_files(self):
130 if self._bootloader == 'u_boot':130 if self._bootloadertype == 'u_boot':
131 # AXF is needed when we are not using UEFI131 # AXF is needed when we are not using UEFI
132 if self._axf is None and self.config.simulator_axf_files:132 if self._axf is None and self.config.simulator_axf_files:
133 raise RuntimeError('No AXF found, %r' %133 raise RuntimeError('No AXF found, %r' %
@@ -144,7 +144,7 @@
144 if self._dtb is None and self.config.simulator_dtb:144 if self._dtb is None and self.config.simulator_dtb:
145 raise RuntimeError('No DTB found, %r' %145 raise RuntimeError('No DTB found, %r' %
146 self.config.simulator_dtb)146 self.config.simulator_dtb)
147 elif self._bootloader == 'uefi':147 elif self._bootloadertype == 'uefi':
148 # UEFI binary is needed when specified148 # UEFI binary is needed when specified
149 if self._uefi is None and self.config.simulator_uefi:149 if self._uefi is None and self.config.simulator_uefi:
150 raise RuntimeError('No UEFI binary found, %r' %150 raise RuntimeError('No UEFI binary found, %r' %
@@ -167,14 +167,14 @@
167167
168 self._customize_android()168 self._customize_android()
169169
170 def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'):170 def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype='u_boot'):
171 hwpack = download_image(hwpack, self.context, decompress=False)171 hwpack = download_image(hwpack, self.context, decompress=False)
172 rootfs = download_image(rootfs, self.context, decompress=False)172 rootfs = download_image(rootfs, self.context, decompress=False)
173 odir = os.path.dirname(rootfs)173 odir = os.path.dirname(rootfs)
174174
175 self._bootloader = bootloader175 self._bootloadertype = bootloadertype
176176
177 generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloader)177 generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloadertype)
178 self._sd_image = '%s/sd.img' % odir178 self._sd_image = '%s/sd.img' % odir
179179
180 self._copy_needed_files_from_directory(odir)180 self._copy_needed_files_from_directory(odir)
@@ -183,8 +183,9 @@
183183
184 self._customize_linux(self._sd_image)184 self._customize_linux(self._sd_image)
185185
186 def deploy_linaro_prebuilt(self, image):186 def deploy_linaro_prebuilt(self, image, bootloadertype):
187 self._sd_image = download_image(image, self.context)187 self._sd_image = download_image(image, self.context)
188 self._bootloadertype = bootloadertype
188189
189 self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm')190 self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm')
190 self._copy_needed_files_from_partition(self.config.root_part, 'boot')191 self._copy_needed_files_from_partition(self.config.root_part, 'boot')
191192
=== modified file 'lava_dispatcher/device/ipmi_pxe.py'
--- lava_dispatcher/device/ipmi_pxe.py 2013-07-16 16:06:42 +0000
+++ lava_dispatcher/device/ipmi_pxe.py 2013-08-30 22:17:08 +0000
@@ -73,13 +73,13 @@
73 def power_off(self, proc):73 def power_off(self, proc):
74 pass74 pass
7575
76 def deploy_linaro(self, hwpack, rfs, bootloader):76 def deploy_linaro(self, hwpack, rfs, bootloadertype):
77 image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloader,77 image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloadertype,
78 extra_boot_args='1', image_size='1G')78 extra_boot_args='1', image_size='1G')
79 self._customize_linux(image_file)79 self._customize_linux(image_file)
80 self._deploy_image(image_file, '/dev/sda')80 self._deploy_image(image_file, '/dev/sda')
8181
82 def deploy_linaro_prebuilt(self, image):82 def deploy_linaro_prebuilt(self, image, bootloadertype):
83 image_file = download_image(image, self.context, self.scratch_dir)83 image_file = download_image(image, self.context, self.scratch_dir)
84 self._customize_linux(image_file)84 self._customize_linux(image_file)
85 self._deploy_image(image_file, '/dev/sda')85 self._deploy_image(image_file, '/dev/sda')
8686
=== modified file 'lava_dispatcher/device/master.py'
--- lava_dispatcher/device/master.py 2013-08-28 14:55:50 +0000
+++ lava_dispatcher/device/master.py 2013-08-30 22:17:08 +0000
@@ -106,10 +106,10 @@
106 if self.config.power_off_cmd:106 if self.config.power_off_cmd:
107 self.context.run_command(self.config.power_off_cmd)107 self.context.run_command(self.config.power_off_cmd)
108108
109 def deploy_linaro(self, hwpack, rfs, bootloader):109 def deploy_linaro(self, hwpack, rfs, bootloadertype):
110 self.boot_master_image()110 self.boot_master_image()
111111
112 image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloader)112 image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloadertype)
113 (boot_tgz, root_tgz, data) = self._generate_tarballs(image_file)113 (boot_tgz, root_tgz, data) = self._generate_tarballs(image_file)
114114
115 self._read_boot_cmds(boot_tgz=boot_tgz)115 self._read_boot_cmds(boot_tgz=boot_tgz)
@@ -149,7 +149,7 @@
149 _deploy_linaro_android_system(master, system_url)149 _deploy_linaro_android_system(master, system_url)
150 _deploy_linaro_android_data(master, data_url)150 _deploy_linaro_android_data(master, data_url)
151151
152 def deploy_linaro_prebuilt(self, image):152 def deploy_linaro_prebuilt(self, image, bootloadertype):
153 self.boot_master_image()153 self.boot_master_image()
154154
155 if self.context.job_data.get('health_check', False):155 if self.context.job_data.get('health_check', False):
156156
=== modified file 'lava_dispatcher/device/qemu.py'
--- lava_dispatcher/device/qemu.py 2013-08-28 14:55:50 +0000
+++ lava_dispatcher/device/qemu.py 2013-08-30 22:17:08 +0000
@@ -78,14 +78,14 @@
78 else:78 else:
79 raise CriticalError("No kernel images to boot")79 raise CriticalError("No kernel images to boot")
8080
81 def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'):81 def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype='u_boot'):
82 odir = self.scratch_dir82 odir = self.scratch_dir
83 self._sd_image = generate_image(self, hwpack, rootfs, odir, bootloader)83 self._sd_image = generate_image(self, hwpack, rootfs, odir, bootloadertype)
84 self._customize_linux(self._sd_image)84 self._customize_linux(self._sd_image)
85 self.append_qemu_options(self.config.qemu_options.format(85 self.append_qemu_options(self.config.qemu_options.format(
86 DISK_IMAGE=self._sd_image))86 DISK_IMAGE=self._sd_image))
8787
88 def deploy_linaro_prebuilt(self, image):88 def deploy_linaro_prebuilt(self, image, bootloadertype='u_boot'):
89 self._sd_image = download_image(image, self.context)89 self._sd_image = download_image(image, self.context)
90 self._customize_linux(self._sd_image)90 self._customize_linux(self._sd_image)
91 self.append_qemu_options(self.config.qemu_options.format(91 self.append_qemu_options(self.config.qemu_options.format(
9292
=== modified file 'lava_dispatcher/device/sdmux.py'
--- lava_dispatcher/device/sdmux.py 2013-07-16 16:04:07 +0000
+++ lava_dispatcher/device/sdmux.py 2013-08-30 22:17:08 +0000
@@ -88,12 +88,12 @@
88 if config.pre_connect_command:88 if config.pre_connect_command:
89 self.context.run_command(config.pre_connect_command)89 self.context.run_command(config.pre_connect_command)
9090
91 def deploy_linaro(self, hwpack=None, rootfs=None, bootloader=None):91 def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype=None):
92 img = generate_image(self, hwpack, rootfs, self.scratch_dir)92 img = generate_image(self, hwpack, rootfs, self.scratch_dir)
93 self._customize_linux(img)93 self._customize_linux(img)
94 self._write_image(img)94 self._write_image(img)
9595
96 def deploy_linaro_prebuilt(self, image):96 def deploy_linaro_prebuilt(self, image, bootloadertype=None):
97 img = download_image(image, self.context)97 img = download_image(image, self.context)
98 self._customize_linux(img)98 self._customize_linux(img)
99 self._write_image(img)99 self._write_image(img)
100100
=== modified file 'lava_dispatcher/device/target.py'
--- lava_dispatcher/device/target.py 2013-08-28 14:55:50 +0000
+++ lava_dispatcher/device/target.py 2013-08-30 22:17:08 +0000
@@ -89,13 +89,13 @@
89 """89 """
90 raise NotImplementedError('power_on')90 raise NotImplementedError('power_on')
9191
92 def deploy_linaro(self, hwpack, rfs, bootloader):92 def deploy_linaro(self, hwpack, rfs, bootloadertype):
93 raise NotImplementedError('deploy_image')93 raise NotImplementedError('deploy_image')
9494
95 def deploy_android(self, boot, system, userdata):95 def deploy_android(self, boot, system, userdata):
96 raise NotImplementedError('deploy_android_image')96 raise NotImplementedError('deploy_android_image')
9797
98 def deploy_linaro_prebuilt(self, image):98 def deploy_linaro_prebuilt(self, image, bootloadertype):
99 raise NotImplementedError('deploy_linaro_prebuilt')99 raise NotImplementedError('deploy_linaro_prebuilt')
100100
101 def power_off(self, proc):101 def power_off(self, proc):

Subscribers

People subscribed via source and target branches