Merge lp:~salgado/linaro-image-tools/save-plain-boot-script into lp:linaro-image-tools/11.11

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: 291
Proposed branch: lp:~salgado/linaro-image-tools/save-plain-boot-script
Merge into: lp:linaro-image-tools/11.11
Diff against target: 45 lines (+9/-8)
2 files modified
linaro_media_create/boards.py (+4/-4)
linaro_media_create/tests/test_media_create.py (+5/-4)
To merge this branch: bzr merge lp:~salgado/linaro-image-tools/save-plain-boot-script
Reviewer Review Type Date Requested Status
Loïc Minier (community) Approve
James Westby (community) Abstain
Review via email: mp+51574@code.launchpad.net

This proposal supersedes a proposal from 2011-02-10.

Description of the change

l-m-c now stores the original boot script (before we feed it to mkimage)
in the boot partition

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote : Posted in a previous version of this proposal

Hi,

Looks good to me, thanks.

Requesting a review from Loïc as I think that he had some opinions
about this.

Thanks,

James

review: Approve
Revision history for this message
Loïc Minier (lool) wrote : Posted in a previous version of this proposal

Is this compatible with flash-kernel boot.script usage?

Revision history for this message
Guilherme Salgado (salgado) wrote : Posted in a previous version of this proposal

On Thu, 2011-02-10 at 20:51 +0000, Loïc Minier wrote:
> Is this compatible with flash-kernel boot.script usage?

flash-kernel's seems to look for the boot.script file under /boot, so I
think the answer is no.

Revision history for this message
Loïc Minier (lool) wrote : Posted in a previous version of this proposal

Maybe we should write it to /boot instead then?

In general, I think we should treat linaro-image-tools as an installer, and the installed system should allow upgrades etc., but this was also always a lower priority for Linaro and I don't know the specifics of how boot.script was designed/implemented; I lack a good understanding to make a good proposal to push this forward

Revision history for this message
Guilherme Salgado (salgado) wrote : Posted in a previous version of this proposal

On Tue, 2011-02-15 at 21:06 +0000, Loïc Minier wrote:
> Maybe we should write it to /boot instead then?

We could do that, but it's not as trivial as writing it to the boot
partition -- the function which writes it doesn't have a reference to
the rootfs, so I'm not sure when I'll be able to do it.

> In general, I think we should treat linaro-image-tools as an installer, and the installed system should allow upgrades etc., but this was also always a lower priority for Linaro and I don't know the specifics of how boot.script was designed/implemented; I lack a good understanding to make a good proposal to push this forward

That makes sense, but it is a different use case to the one presented on
the bug. Since the change here supports the bug's use case, how would
you feel about landing it now and filing a separate bug for having the
boot.script written under /boot rather than on the boot partition?

Revision history for this message
Loïc Minier (lool) wrote : Posted in a previous version of this proposal

I'm a bit concerned about having two "boot.script" files in different locations

Perhaps with another name; perhaps we can simply name it boot.txt and this will also mean that if u-boot moves to supporting text files it gets picked up?

Revision history for this message
Loïc Minier (lool) wrote : Posted in a previous version of this proposal

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/93267

It should be named uEnv.txt apparently, and should contain an environment, not a boot script

Revision history for this message
Alexander Sack (asac) wrote : Posted in a previous version of this proposal

just my comment: the bug i filed definitely had in mind that flash-kernel picks this up. hence i wrote /boot/boot.script

Revision history for this message
Guilherme Salgado (salgado) wrote : Posted in a previous version of this proposal

On Wed, 2011-02-16 at 14:41 +0000, Alexander Sack wrote:
> just my comment: the bug i filed definitely had in mind that flash-kernel picks this up. hence i wrote /boot/boot.script

Fair enough. I think it's better to drop this and and do a separate
change which places the file under /boot. It'd have been nicer if you
said so when I asked on the bug why the request was for the file to be
under /boot, though, but anyway..

Revision history for this message
Loïc Minier (lool) wrote : Posted in a previous version of this proposal

So this should be fixed to either install a boot.script to root_partition/boot or to install boot.txt to boot_partition, but the current version with boot_partition/boot.script isn't ok.

review: Needs Fixing
Revision history for this message
James Westby (james-w) wrote :

I have no objection to the implementation, so I'll leave the decision up to Loïc,
as he is opinionated about the intent.

Thanks,

James

review: Abstain
Revision history for this message
Loïc Minier (lool) wrote :

As discussed earlier, I'm fine with a boot.txt in the boot partition; thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'linaro_media_create/boards.py'
--- linaro_media_create/boards.py 2011-02-25 13:19:31 +0000
+++ linaro_media_create/boards.py 2011-02-28 17:22:01 +0000
@@ -498,12 +498,12 @@
498def make_boot_script(boot_script_data, boot_script):498def make_boot_script(boot_script_data, boot_script):
499 # Need to save the boot script data into a file that will be passed to499 # Need to save the boot script data into a file that will be passed to
500 # mkimage.500 # mkimage.
501 _, tmpfile = tempfile.mkstemp()501 plain_boot_script = os.path.join(
502 atexit.register(os.unlink, tmpfile)502 os.path.dirname(boot_script), 'boot.txt')
503 with open(tmpfile, 'w') as fd:503 with open(plain_boot_script, 'w') as fd:
504 fd.write(boot_script_data)504 fd.write(boot_script_data)
505 return _run_mkimage(505 return _run_mkimage(
506 'script', '0', '0', 'boot script', tmpfile, boot_script)506 'script', '0', '0', 'boot script', plain_boot_script, boot_script)
507507
508508
509def install_mx5_boot_loader(imx_file, boot_device_or_file):509def install_mx5_boot_loader(imx_file, boot_device_or_file):
510510
=== modified file 'linaro_media_create/tests/test_media_create.py'
--- linaro_media_create/tests/test_media_create.py 2011-02-25 13:19:31 +0000
+++ linaro_media_create/tests/test_media_create.py 2011-02-28 17:22:01 +0000
@@ -606,15 +606,16 @@
606 self.assertEqual(expected, fixture.mock.calls)606 self.assertEqual(expected, fixture.mock.calls)
607607
608 def test_make_boot_script(self):608 def test_make_boot_script(self):
609 self.useFixture(MockSomethingFixture(609 tempdir = self.useFixture(CreateTempDirFixture()).tempdir
610 tempfile, 'mkstemp', lambda: (-1, '/tmp/random-abxzr')))
611 self._mock_get_file_matching()610 self._mock_get_file_matching()
612 fixture = self._mock_Popen()611 fixture = self._mock_Popen()
613 make_boot_script('boot script data', 'boot_script')612 boot_script_path = os.path.join(tempdir, 'boot.scr')
613 plain_boot_script_path = os.path.join(tempdir, 'boot.txt')
614 make_boot_script('boot script data', boot_script_path)
614 expected = [615 expected = [
615 'sudo', 'mkimage', '-A', 'arm', '-O', 'linux', '-T', 'script',616 'sudo', 'mkimage', '-A', 'arm', '-O', 'linux', '-T', 'script',
616 '-C', 'none', '-a', '0', '-e', '0', '-n', 'boot script',617 '-C', 'none', '-a', '0', '-e', '0', '-n', 'boot script',
617 '-d', '/tmp/random-abxzr', 'boot_script']618 '-d', plain_boot_script_path, boot_script_path]
618 self.assertEqual([expected], fixture.mock.calls)619 self.assertEqual([expected], fixture.mock.calls)
619620
620 def test_get_file_matching(self):621 def test_get_file_matching(self):

Subscribers

People subscribed via source and target branches