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

Proposed by Guilherme Salgado
Status: Superseded
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) Needs Fixing
James Westby (community) Approve
Review via email: mp+49251@code.launchpad.net

This proposal has been superseded by a proposal from 2011-02-28.

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 :

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 :

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

Revision history for this message
Guilherme Salgado (salgado) wrote :

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 :

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 :

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 :

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 :

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 :

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 :

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 :

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
287. By Guilherme Salgado

Rename the plain-text boot script saved on the boot partition from boot.script to boot.txt

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro_media_create/boards.py'
2--- linaro_media_create/boards.py 2011-02-01 13:16:43 +0000
3+++ linaro_media_create/boards.py 2011-02-10 17:00:04 +0000
4@@ -399,12 +399,12 @@
5 def make_boot_script(boot_script_data, boot_script):
6 # Need to save the boot script data into a file that will be passed to
7 # mkimage.
8- _, tmpfile = tempfile.mkstemp()
9- atexit.register(os.unlink, tmpfile)
10- with open(tmpfile, 'w') as fd:
11+ plain_boot_script = os.path.join(
12+ os.path.dirname(boot_script), 'boot.script')
13+ with open(plain_boot_script, 'w') as fd:
14 fd.write(boot_script_data)
15 return _run_mkimage(
16- 'script', '0', '0', 'boot script', tmpfile, boot_script)
17+ 'script', '0', '0', 'boot script', plain_boot_script, boot_script)
18
19
20 def install_mx51evk_boot_loader(imx_file, boot_device_or_file):
21
22=== modified file 'linaro_media_create/tests/test_media_create.py'
23--- linaro_media_create/tests/test_media_create.py 2011-02-02 17:38:16 +0000
24+++ linaro_media_create/tests/test_media_create.py 2011-02-10 17:00:04 +0000
25@@ -552,15 +552,16 @@
26 self.assertEqual([expected], fixture.mock.calls)
27
28 def test_make_boot_script(self):
29- self.useFixture(MockSomethingFixture(
30- tempfile, 'mkstemp', lambda: (-1, '/tmp/random-abxzr')))
31+ tempdir = self.useFixture(CreateTempDirFixture()).tempdir
32 self._mock_get_file_matching()
33 fixture = self._mock_Popen()
34- make_boot_script('boot script data', 'boot_script')
35+ boot_script_path = os.path.join(tempdir, 'boot.scr')
36+ plain_boot_script_path = os.path.join(tempdir, 'boot.script')
37+ make_boot_script('boot script data', boot_script_path)
38 expected = [
39 'sudo', 'mkimage', '-A', 'arm', '-O', 'linux', '-T', 'script',
40 '-C', 'none', '-a', '0', '-e', '0', '-n', 'boot script',
41- '-d', '/tmp/random-abxzr', 'boot_script']
42+ '-d', plain_boot_script_path, boot_script_path]
43 self.assertEqual([expected], fixture.mock.calls)
44
45 def test_get_file_matching(self):

Subscribers

People subscribed via source and target branches