=== modified file 'linaro_image_tools/media_create/boards.py'
@@ -910,13 +910,20 @@
return img
-def make_boot_script(boot_env, boot_script_path):
- boot_script_data = (
- "setenv bootcmd '%(bootcmd)s'\n"
- "setenv bootargs %(bootargs)s\n"
+def get_plain_boot_script_contents(boot_env):
+ # We use double quotes to avoid u-boot argument limits
+ # while retaining the ability to expand variables. See
+ # https://bugs.launchpad.net/linaro-image-tools/+bug/788765
+ # for more.
+ return (
+ 'setenv bootcmd "%(bootcmd)s"\n'
+ 'setenv bootargs "%(bootargs)s"\n'
"boot"
% boot_env)
+
+def make_boot_script(boot_env, boot_script_path):
+ boot_script_data = get_plain_boot_script_contents(boot_env)
# Need to save the boot script data into a file that will be passed to
# mkimage.
_, tmpfile = tempfile.mkstemp()
=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
@@ -25,6 +25,7 @@
import subprocess
import sys
import tempfile
+import textwrap
import time
import types
@@ -44,6 +45,7 @@
align_up,
align_partition,
board_configs,
+ get_plain_boot_script_contents,
make_flashable_env,
install_mx5_boot_loader,
install_omap_boot_loader,
@@ -626,6 +628,14 @@
'%s cp -v chroot_dir/MLO boot_disk' % sudo_args, 'sync']
self.assertEqual(expected, fixture.mock.commands_executed)
+ def test_get_plain_boot_script_contents(self):
+ boot_env = {'bootargs': 'mybootargs', 'bootcmd': 'mybootcmd'}
+ boot_script_data = get_plain_boot_script_contents(boot_env)
+ self.assertEqual(textwrap.dedent("""\
+ setenv bootcmd "mybootcmd"
+ setenv bootargs "mybootargs"
+ boot"""), boot_script_data)
+
def test_make_boot_script(self):
self.useFixture(MockSomethingFixture(
tempfile, 'mkstemp', lambda: (-1, '/tmp/random-abxzr')))