Merge lp:~milo/linaro-image-tools/var-refactoring into lp:linaro-image-tools/11.11

Proposed by Milo Casagrande
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 598
Merged at revision: 597
Proposed branch: lp:~milo/linaro-image-tools/var-refactoring
Merge into: lp:linaro-image-tools/11.11
Diff against target: 174 lines (+31/-30)
2 files modified
linaro_image_tools/media_create/android_boards.py (+11/-11)
linaro_image_tools/media_create/boards.py (+20/-19)
To merge this branch: bzr merge lp:~milo/linaro-image-tools/var-refactoring
Reviewer Review Type Date Requested Status
James Tunnicliffe (community) Approve
linaro-image-tools maintainers Pending
Review via email: mp+142093@code.launchpad.net

Description of the change

A simple variable name refactoring in order to have the same name between boards.py and android_boards.py.
Tests do not need to be changed.

To post a comment you must log in.
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Looks fine, though I wonder if it is worth picking up more:

46 @@ -547,7 +548,7 @@
47 lowmem_opt = ''
48 boot_snippet = 'root=%s' % rootfs_id
49 if is_live:
50 - serial_opts += ' %s' % self.live_serial_opts
51 + serial_opts += ' %s' % self.live_serial_options
52 boot_snippet = 'boot=casper'
53 if is_lowmem:
54 lowmem_opt = 'only-ubiquity'

I would change the local serial_opts variable to be consistent. There are a few places in android_boards where serial_opts turns up as well.

598. By Milo Casagrande

Refactored serial_opts into serial_options.

Revision history for this message
Milo Casagrande (milo) wrote :

On Mon, Jan 7, 2013 at 12:20 PM, James Tunnicliffe
<email address hidden> wrote:
>
> I would change the local serial_opts variable to be consistent. There are a few places in android_boards where serial_opts turns up as well.

Should be done now.
Thanks.

--
Milo Casagrande | Infrastructure Team
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'linaro_image_tools/media_create/android_boards.py'
--- linaro_image_tools/media_create/android_boards.py 2013-01-03 13:55:33 +0000
+++ linaro_image_tools/media_create/android_boards.py 2013-01-07 12:42:21 +0000
@@ -170,15 +170,15 @@
170 if self.extra_boot_args_options:170 if self.extra_boot_args_options:
171 boot_args_options += ' %s' % self.extra_boot_args_options171 boot_args_options += ' %s' % self.extra_boot_args_options
172 boot_args_options += ' %s' % self.android_specific_args172 boot_args_options += ' %s' % self.android_specific_args
173 serial_opts = self.extra_serial_options173 serial_options = self.extra_serial_options
174 for console in consoles:174 for console in consoles:
175 serial_opts += ' console=%s' % console175 serial_options += ' console=%s' % console
176176
177 replacements = dict(177 replacements = dict(
178 serial_opts=serial_opts,178 serial_options=serial_options,
179 boot_args_options=boot_args_options)179 boot_args_options=boot_args_options)
180 return (180 return (
181 "%(serial_opts)s "181 "%(serial_options)s "
182 "%(boot_args_options)s"182 "%(boot_args_options)s"
183 % replacements)183 % replacements)
184184
@@ -391,13 +391,13 @@
391 self._android_specific_args = 'init=/init androidboot.console=%s'391 self._android_specific_args = 'init=/init androidboot.console=%s'
392392
393 def _get_extra_serial_options(self):393 def _get_extra_serial_options(self):
394 serial_opts = self._extra_serial_options394 serial_options = self._extra_serial_options
395 if serial_opts:395 if serial_options:
396 if isinstance(serial_opts, list):396 if isinstance(serial_options, list):
397 serial_opts = ' '.join(serial_opts)397 serial_options = ' '.join(serial_options)
398 if self._check_placeholder_presence(serial_opts, '%s'):398 if self._check_placeholder_presence(serial_options, '%s'):
399 serial_opts = serial_opts % self.serial_tty399 serial_options = serial_options % self.serial_tty
400 return serial_opts400 return serial_options
401401
402 def _set_extra_serial_options(self, value):402 def _set_extra_serial_options(self, value):
403 self._extra_serial_options = value403 self._extra_serial_options = value
404404
=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py 2013-01-02 14:38:13 +0000
+++ linaro_image_tools/media_create/boards.py 2013-01-07 12:42:21 +0000
@@ -151,7 +151,7 @@
151 # placeholders in the string for dinamically change values. But this151 # placeholders in the string for dinamically change values. But this
152 # is done only for hwpack v1.152 # is done only for hwpack v1.
153 self._extra_serial_options = ''153 self._extra_serial_options = ''
154 self._live_serial_opts = ''154 self._live_serial_options = ''
155 self.board = None155 self.board = None
156 self.boot_script = None156 self.boot_script = None
157 self.bootloader_dd = False157 self.bootloader_dd = False
@@ -211,16 +211,17 @@
211 self.initrd = None211 self.initrd = None
212212
213 # XXX: can be removed when killing v1 hwpack.213 # XXX: can be removed when killing v1 hwpack.
214 def _get_live_serial_opts(self):214 def _get_live_serial_options(self):
215 return_value = self._live_serial_opts215 return_value = self._live_serial_options
216 if self._check_placeholder_presence(return_value, r'%s'):216 if self._check_placeholder_presence(return_value, r'%s'):
217 return_value = self._live_serial_opts % self.serial_tty217 return_value = self._live_serial_options % self.serial_tty
218 return return_value218 return return_value
219219
220 def _set_live_serial_opts(self, value):220 def _set_live_serial_options(self, value):
221 self._live_serial_opts = value221 self._live_serial_options = value
222222
223 live_serial_opts = property(_get_live_serial_opts, _set_live_serial_opts)223 live_serial_options = property(_get_live_serial_options,
224 _set_live_serial_options)
224225
225 # XXX: can be removed when killing v1 hwpack.226 # XXX: can be removed when killing v1 hwpack.
226 def _get_extra_serial_options(self):227 def _get_extra_serial_options(self):
@@ -233,7 +234,7 @@
233 self._extra_serial_options = value234 self._extra_serial_options = value
234235
235 extra_serial_options = property(_get_extra_serial_options,236 extra_serial_options = property(_get_extra_serial_options,
236 _set_extra_serial_options)237 _set_extra_serial_options)
237238
238 def get_metadata_field(self, field_name):239 def get_metadata_field(self, field_name):
239 """ Return the metadata value for field_name if it can be found.240 """ Return the metadata value for field_name if it can be found.
@@ -540,24 +541,24 @@
540 boot_args_options = 'rootwait ro'541 boot_args_options = 'rootwait ro'
541 if self.extra_boot_args_options:542 if self.extra_boot_args_options:
542 boot_args_options += ' %s' % self.extra_boot_args_options543 boot_args_options += ' %s' % self.extra_boot_args_options
543 serial_opts = self.extra_serial_options544 serial_options = self.extra_serial_options
544 for console in consoles:545 for console in consoles:
545 serial_opts += ' console=%s' % console546 serial_options += ' console=%s' % console
546547
547 lowmem_opt = ''548 lowmem_opt = ''
548 boot_snippet = 'root=%s' % rootfs_id549 boot_snippet = 'root=%s' % rootfs_id
549 if is_live:550 if is_live:
550 serial_opts += ' %s' % self.live_serial_opts551 serial_options += ' %s' % self.live_serial_options
551 boot_snippet = 'boot=casper'552 boot_snippet = 'boot=casper'
552 if is_lowmem:553 if is_lowmem:
553 lowmem_opt = 'only-ubiquity'554 lowmem_opt = 'only-ubiquity'
554555
555 replacements = dict(556 replacements = dict(
556 serial_opts=serial_opts,557 serial_options=serial_options,
557 lowmem_opt=lowmem_opt, boot_snippet=boot_snippet,558 lowmem_opt=lowmem_opt, boot_snippet=boot_snippet,
558 boot_args_options=boot_args_options)559 boot_args_options=boot_args_options)
559 return (560 return (
560 "%(serial_opts)s %(lowmem_opt)s "561 "%(serial_options)s %(lowmem_opt)s "
561 "%(boot_snippet)s %(boot_args_options)s"562 "%(boot_snippet)s %(boot_args_options)s"
562 % replacements)563 % replacements)
563564
@@ -946,7 +947,7 @@
946 self.load_addr = '0x80008000'947 self.load_addr = '0x80008000'
947 self._serial_tty = 'ttyO2'948 self._serial_tty = 'ttyO2'
948 self._extra_serial_options = 'console=tty0 console=%s,115200n8'949 self._extra_serial_options = 'console=tty0 console=%s,115200n8'
949 self._live_serial_opts = 'serialtty=%s'950 self._live_serial_options = 'serialtty=%s'
950951
951952
952class OveroConfig(OmapConfig):953class OveroConfig(OmapConfig):
@@ -981,7 +982,7 @@
981 self.kernel_addr = '0x80200000'982 self.kernel_addr = '0x80200000'
982 self.load_addr = '0x80008000'983 self.load_addr = '0x80008000'
983 self._extra_serial_options = 'console=tty0 console=%s,115200n8'984 self._extra_serial_options = 'console=tty0 console=%s,115200n8'
984 self._live_serial_opts = 'serialtty=%s'985 self._live_serial_options = 'serialtty=%s'
985986
986987
987class IgepConfig(BeagleConfig):988class IgepConfig(BeagleConfig):
@@ -1020,7 +1021,7 @@
1020 self.mmc_option = '1:1'1021 self.mmc_option = '1:1'
1021 self.serial_tty = 'ttyAMA2'1022 self.serial_tty = 'ttyAMA2'
1022 self._extra_serial_options = 'console=tty0 console=%s,115200n8'1023 self._extra_serial_options = 'console=tty0 console=%s,115200n8'
1023 self._live_serial_opts = 'serialtty=%s'1024 self._live_serial_options = 'serialtty=%s'
10241025
1025 def _make_boot_files(self, boot_env, chroot_dir, boot_dir,1026 def _make_boot_files(self, boot_env, chroot_dir, boot_dir,
1026 boot_device_or_file, k_img_data, i_img_data,1027 boot_device_or_file, k_img_data, i_img_data,
@@ -1231,7 +1232,7 @@
1231 self.mmc_part_offset = 11232 self.mmc_part_offset = 1
1232 self.serial_tty = 'ttymxc0'1233 self.serial_tty = 'ttymxc0'
1233 self._extra_serial_options = 'console=tty0 console=%s,115200n8'1234 self._extra_serial_options = 'console=tty0 console=%s,115200n8'
1234 self._live_serial_opts = 'serialtty=%s'1235 self._live_serial_options = 'serialtty=%s'
12351236
1236 def get_v1_sfdisk_cmd(self, should_align_boot_part=None):1237 def get_v1_sfdisk_cmd(self, should_align_boot_part=None):
1237 """Return the sfdisk command to partition the media.1238 """Return the sfdisk command to partition the media.
@@ -1342,7 +1343,7 @@
1342 self.load_addr = '0x60008000'1343 self.load_addr = '0x60008000'
1343 self.serial_tty = 'ttyAMA0'1344 self.serial_tty = 'ttyAMA0'
1344 self._extra_serial_options = 'console=tty0 console=%s,38400n8'1345 self._extra_serial_options = 'console=tty0 console=%s,38400n8'
1345 self._live_serial_opts = 'serialtty=%s'1346 self._live_serial_options = 'serialtty=%s'
13461347
1347 def _make_boot_files(self, boot_env, chroot_dir, boot_dir,1348 def _make_boot_files(self, boot_env, chroot_dir, boot_dir,
1348 boot_device_or_file, k_img_data, i_img_data,1349 boot_device_or_file, k_img_data, i_img_data,
@@ -1588,7 +1589,7 @@
1588 self.kernel_flavors = ['generic', 'pae']1589 self.kernel_flavors = ['generic', 'pae']
1589 self.serial_tty = 'ttyS0'1590 self.serial_tty = 'ttyS0'
1590 self._extra_serial_options = 'console=tty0 console=%s,115200n8'1591 self._extra_serial_options = 'console=tty0 console=%s,115200n8'
1591 self._live_serial_opts = 'serialtty=%s'1592 self._live_serial_options = 'serialtty=%s'
15921593
1593 def _make_boot_files(self, boot_env, chroot_dir, boot_dir,1594 def _make_boot_files(self, boot_env, chroot_dir, boot_dir,
1594 boot_device_or_file, k_img_data, i_img_data,1595 boot_device_or_file, k_img_data, i_img_data,

Subscribers

People subscribed via source and target branches