aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create
diff options
context:
space:
mode:
authorMilo Casagrande <milo.casagrande@linaro.org>2013-12-20 14:36:35 +0100
committerMilo Casagrande <milo.casagrande@linaro.org>2013-12-20 14:36:35 +0100
commita0ad4bfcd115b709f3895aee634fb4400b14f8ab (patch)
treeb543c999574b93a2fe09f0aa48d9ad60cb332b9c /linaro_image_tools/media_create
parent5df3545d3ed0a61209b2d7f1cf8891708934d589 (diff)
downloadlinaro-image-tools-a0ad4bfcd115b709f3895aee634fb4400b14f8ab.tar.gz
Remove not necessary white spaces from boot command.
Change-Id: I53e21a1b99bcf4f52df6892a8458c7eff1bc2e54
Diffstat (limited to 'linaro_image_tools/media_create')
-rw-r--r--linaro_image_tools/media_create/android_boards.py9
-rw-r--r--linaro_image_tools/media_create/boards.py10
2 files changed, 10 insertions, 9 deletions
diff --git a/linaro_image_tools/media_create/android_boards.py b/linaro_image_tools/media_create/android_boards.py
index 6883c4f..01f9bc1 100644
--- a/linaro_image_tools/media_create/android_boards.py
+++ b/linaro_image_tools/media_create/android_boards.py
@@ -183,7 +183,7 @@ class AndroidBoardConfig(BoardConfig):
return (
"%(serial_options)s "
"%(boot_args_options)s"
- % replacements)
+ % replacements).strip()
def _get_boot_env(self, consoles):
"""Get the boot environment for this board.
@@ -212,11 +212,12 @@ class AndroidBoardConfig(BoardConfig):
boot_env = self._get_boot_env(consoles)
cmdline_filepath = os.path.join(boot_disk, "cmdline")
- cmdline_file = open(cmdline_filepath, 'r')
- android_kernel_cmdline = cmdline_file.read()
+
+ with open(cmdline_filepath, 'r') as cmdline_file:
+ android_kernel_cmdline = cmdline_file.read().strip()
+
boot_env['bootargs'] = boot_env['bootargs'] + ' ' + \
android_kernel_cmdline
- cmdline_file.close()
boot_dir = boot_disk
boot_script_path = os.path.join(boot_dir, self.boot_script)
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py
index 0c42a49..38b62e1 100644
--- a/linaro_image_tools/media_create/boards.py
+++ b/linaro_image_tools/media_create/boards.py
@@ -584,14 +584,14 @@ class BoardConfig(object):
boot_args_options = 'rootwait ro'
serial_options = ''
if self.extra_boot_args_options:
- boot_args_options += ' %s' % self.extra_boot_args_options
+ boot_args_options += ' %s' % self.extra_boot_args_options.strip()
if self.extra_serial_options:
- serial_options = self.extra_serial_options
+ serial_options = self.extra_serial_options.strip()
for console in consoles:
- serial_options += ' console=%s' % console
+ serial_options += ' console=%s' % console.strip()
lowmem_opt = ''
- boot_snippet = 'root=%s' % rootfs_id
+ boot_snippet = 'root=%s' % rootfs_id.strip()
if is_live:
serial_options += ' %s' % self.live_serial_options
boot_snippet = 'boot=casper'
@@ -1973,7 +1973,7 @@ def get_plain_boot_script_contents(boot_env):
'setenv fdt_high "%(fdt_high)s"\n'
'setenv bootcmd "%(bootcmd)s"\n'
'setenv bootargs "%(bootargs)s"\n'
- "boot"
+ 'boot'
% boot_env)