Merge lp:~stylesen/lava-dispatcher/fix-bug-1172235 into lp:lava-dispatcher

Proposed by Senthil Kumaran S
Status: Merged
Approved by: Senthil Kumaran S
Approved revision: 587
Merged at revision: 587
Proposed branch: lp:~stylesen/lava-dispatcher/fix-bug-1172235
Merge into: lp:lava-dispatcher
Diff against target: 31 lines (+16/-4)
1 file modified
lava_dispatcher/device/master.py (+16/-4)
To merge this branch: bzr merge lp:~stylesen/lava-dispatcher/fix-bug-1172235
Reviewer Review Type Date Requested Status
Dave Pigott Approve
Review via email: mp+160607@code.launchpad.net

Description of the change

Specify correct root partitions which affects devices like snowball.

To post a comment you must log in.
Revision history for this message
Dave Pigott (dpigott) wrote :

Not sure I completely like the dependence on ttyAMA2 being in the boot args, but for now can't think of a better way. +1

review: Approve
Revision history for this message
Fathi Boudra (fboudra) wrote :

Agree with Dave. I don't like much the snowball exception approach (and the hardcoded partition number n+2). It's fine as band-aid but a bug to fix sanely the issue will be appreciated.

Revision history for this message
Dave Pigott (dpigott) wrote :

Turns out it was unnecessary anyway. Senthil is applying the proper fix now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/device/master.py'
2--- lava_dispatcher/device/master.py 2013-04-22 09:39:22 +0000
3+++ lava_dispatcher/device/master.py 2013-04-24 11:12:25 +0000
4@@ -182,11 +182,23 @@
5 """
6 Returns boot_cmds list after rewriting things such as:
7
8- partition number from n to n+2
9- root=LABEL=testrootfs instead of root=UUID=ab34-...
10+ * partition number from n to n+2
11+ * root=LABEL=testrootfs or root=/dev/mmcblk1p5 instead of
12+ root=UUID=ab34-...
13 """
14- boot_cmds = re.sub(
15- r"root=UUID=\S+", "root=LABEL=testrootfs", boot_cmds, re.MULTILINE)
16+
17+ # This console value is specific to snowball. A snowball has mmcblk1
18+ if 'ttyAMA2' in boot_cmds:
19+ boot_cmds = re.sub(r"root=UUID=\S+",
20+ "root=/dev/mmcblk1p5",
21+ boot_cmds,
22+ re.MULTILINE)
23+ else:
24+ boot_cmds = re.sub(r"root=UUID=\S+",
25+ "root=LABEL=testrootfs",
26+ boot_cmds,
27+ re.MULTILINE)
28+
29 pattern = "\s+\d+:(?P<partition>\d+)\s+"
30 boot_cmds = re.sub(
31 pattern, self._rewrite_partition_number, boot_cmds, re.MULTILINE)

Subscribers

People subscribed via source and target branches