Merge lp:~liuyq0307/lava-dispatcher/fix-1195536 into lp:lava-dispatcher
- fix-1195536
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 633 |
Proposed branch: | lp:~liuyq0307/lava-dispatcher/fix-1195536 |
Merge into: | lp:lava-dispatcher |
Diff against target: |
185 lines (+53/-38) 5 files modified
lava_dispatcher/config.py (+2/-2) lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf (+13/-7) lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf (+12/-6) lava_dispatcher/device/fastmodel.py (+22/-19) lava_dispatcher/device/target.py (+4/-4) |
To merge this branch: | bzr merge lp:~liuyq0307/lava-dispatcher/fix-1195536 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tyler Baker | Approve | ||
Review via email:
|
Commit message
Description of the change
1. fix the bug in _find_and_copy function,
we should use the root to genertate the src path
2. rename the file variable to file_name,
since file is a keyword of python

Yongqin Liu (liuyq0307) wrote : | # |

Tyler Baker (tyler-baker) wrote : | # |
Thanks for fixing these issue I introduced :)
However the issue still persists:
- 633. By Yongqin Liu
-
remove the directory of axf file path specified for simulator_axf_files
based on the thought like this:
we do not have much files in the boot partition,
and there will be no files with the same base name under different directory - 634. By Yongqin Liu
-
change for copy necessary uImage and uInitrd files
- 635. By Yongqin Liu
-
fix the error about parameter of _copy_first_
find_from_ list - 636. By Yongqin Liu
-
fix some other bugs

Tyler Baker (tyler-baker) wrote : | # |
Still in the process of testing these changes again.
One small issue I've encountered:
- simulator_kernel = schema.
- simulator_initrd = schema.
+ simulator_
+ simulator_

Tyler Baker (tyler-baker) wrote : | # |
With the changes mentioned above, I confirmed this fix is now working properly.

Tyler Baker (tyler-baker) wrote : | # |
We should also update the device-types for the following:
rtsm_foundation
rtsm_ve-armv8
- 637. By Yongqin Liu
-
fix the bug of definition of simulator_
kernel_ files and simulator_ initrd_ files

Yongqin Liu (liuyq0307) wrote : | # |
Hi, Tyler
I updated the definition of simulator_
Please check that.
> We should also update the device-types for the following:
>
> rtsm_foundation
>
> rtsm_ve-armv8
For the above comments, sorry, I am not very clear about what to do.
Why should we update these two device types.
They don't need to specify the simulator_
- 638. By Yongqin Liu
-
fix bug of use of simulator_kernel and simulator_initrd

Tyler Baker (tyler-baker) wrote : | # |
> Hi, Tyler
>
> I updated the definition of simulator_
> according to your comments.
> Please check that.
>
> > We should also update the device-types for the following:
> >
> > rtsm_foundation
> >
> > rtsm_ve-armv8
> For the above comments, sorry, I am not very clear about what to do.
> Why should we update these two device types.
>
> They don't need to specify the simulator_
> simulator_
At this point they do not. However in the future they will need to ;) We can do this work now or later, I just thought it might be nice to have them updated now.

Tyler Baker (tyler-baker) : | # |

Zygmunt Krynicki (zyga) wrote : | # |
File is not a keyword in python.
It is okay to use, it might be confusing sometimes though
Thanks
ZK
2 lip 2013 17:08, "Tyler Baker" <email address hidden> napisał(a):
> Review: Approve
>
>
> --
>
> https:/
> You are subscribed to branch lp:lava-dispatcher.
>
Preview Diff
1 | === modified file 'lava_dispatcher/config.py' | |||
2 | --- lava_dispatcher/config.py 2013-06-20 15:37:54 +0000 | |||
3 | +++ lava_dispatcher/config.py 2013-07-01 10:49:37 +0000 | |||
4 | @@ -85,8 +85,8 @@ | |||
5 | 85 | simulator_version_command = schema.StringOption() | 85 | simulator_version_command = schema.StringOption() |
6 | 86 | simulator_command = schema.StringOption() | 86 | simulator_command = schema.StringOption() |
7 | 87 | simulator_axf_files = schema.ListOption() | 87 | simulator_axf_files = schema.ListOption() |
10 | 88 | simulator_kernel = schema.StringOption(default=None) | 88 | simulator_kernel_files = schema.ListOption(default=None) |
11 | 89 | simulator_initrd = schema.StringOption(default=None) | 89 | simulator_initrd_files = schema.ListOption(default=None) |
12 | 90 | simulator_dtb = schema.StringOption(default=None) | 90 | simulator_dtb = schema.StringOption(default=None) |
13 | 91 | simulator_uefi = schema.StringOption(default=None) | 91 | simulator_uefi = schema.StringOption(default=None) |
14 | 92 | simulator_boot_wrapper = schema.StringOption(default=None) | 92 | simulator_boot_wrapper = schema.StringOption(default=None) |
15 | 93 | 93 | ||
16 | === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf' | |||
17 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf 2013-06-19 16:22:43 +0000 | |||
18 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf 2013-07-01 10:49:37 +0000 | |||
19 | @@ -45,17 +45,23 @@ | |||
20 | 45 | sendline 2 | 45 | sendline 2 |
21 | 46 | 46 | ||
22 | 47 | simulator_axf_files = | 47 | simulator_axf_files = |
29 | 48 | img.axf | 48 | img.axf |
30 | 49 | linux-system-ISW.axf | 49 | linux-system-ISW.axf |
31 | 50 | rtsm/linux-system-semi.axf | 50 | linux-system-semi.axf |
32 | 51 | 51 | ||
33 | 52 | simulator_kernel = vmlinuz.* | 52 | simulator_kernel_files = |
34 | 53 | simulator_initrd = initrd.* | 53 | uImage |
35 | 54 | vmlinuz.* | ||
36 | 55 | |||
37 | 56 | simulator_initrd_files = | ||
38 | 57 | uInitrd | ||
39 | 58 | initrd.* | ||
40 | 59 | |||
41 | 54 | simulator_dtb = rtsm_ve-ca15x1-ca7x1.dtb | 60 | simulator_dtb = rtsm_ve-ca15x1-ca7x1.dtb |
42 | 55 | simulator_uefi = uefi_rtsm_ve-ca15.bin | 61 | simulator_uefi = uefi_rtsm_ve-ca15.bin |
43 | 56 | 62 | ||
44 | 57 | license_file = 8224@localhost | 63 | license_file = 8224@localhost |
46 | 58 | sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x4-A7x4/RTSM_VE_Cortex-A15x4-A7x4 | 64 | sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x1-A7x1/RTSM_VE_Cortex-A15x1-A7x1 |
47 | 59 | android_adb_port = 6555 | 65 | android_adb_port = 6555 |
48 | 60 | 66 | ||
49 | 61 | simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//' | 67 | simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//' |
50 | 62 | 68 | ||
51 | === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf' | |||
52 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf 2013-06-19 16:22:43 +0000 | |||
53 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf 2013-07-01 10:49:37 +0000 | |||
54 | @@ -45,12 +45,18 @@ | |||
55 | 45 | sendline 2 | 45 | sendline 2 |
56 | 46 | 46 | ||
57 | 47 | simulator_axf_files = | 47 | simulator_axf_files = |
64 | 48 | img.axf | 48 | img.axf |
65 | 49 | linux-system-ISW.axf | 49 | linux-system-ISW.axf |
66 | 50 | rtsm/linux-system-semi.axf | 50 | linux-system-semi.axf |
67 | 51 | 51 | ||
68 | 52 | simulator_kernel = vmlinuz.* | 52 | simulator_kernel_files = |
69 | 53 | simulator_initrd = initrd.* | 53 | uImage |
70 | 54 | vmlinuz.* | ||
71 | 55 | |||
72 | 56 | simulator_initrd_files = | ||
73 | 57 | uInitrd | ||
74 | 58 | initrd.* | ||
75 | 59 | |||
76 | 54 | simulator_dtb = rtsm_ve-ca15x4-ca7x4.dtb | 60 | simulator_dtb = rtsm_ve-ca15x4-ca7x4.dtb |
77 | 55 | simulator_uefi = uefi_rtsm_ve-ca15.bin | 61 | simulator_uefi = uefi_rtsm_ve-ca15.bin |
78 | 56 | 62 | ||
79 | 57 | 63 | ||
80 | === modified file 'lava_dispatcher/device/fastmodel.py' | |||
81 | --- lava_dispatcher/device/fastmodel.py 2013-06-25 10:50:02 +0000 | |||
82 | +++ lava_dispatcher/device/fastmodel.py 2013-07-01 10:49:37 +0000 | |||
83 | @@ -23,10 +23,8 @@ | |||
84 | 23 | import cStringIO | 23 | import cStringIO |
85 | 24 | import logging | 24 | import logging |
86 | 25 | import os | 25 | import os |
87 | 26 | import shutil | ||
88 | 27 | import stat | 26 | import stat |
89 | 28 | import subprocess | 27 | import subprocess |
90 | 29 | import re | ||
91 | 30 | 28 | ||
92 | 31 | import lava_dispatcher.device.boot_options as boot_options | 29 | import lava_dispatcher.device.boot_options as boot_options |
93 | 32 | 30 | ||
94 | @@ -48,7 +46,6 @@ | |||
95 | 48 | ensure_directory, | 46 | ensure_directory, |
96 | 49 | extract_targz, | 47 | extract_targz, |
97 | 50 | DrainConsoleOutput, | 48 | DrainConsoleOutput, |
98 | 51 | string_to_list, | ||
99 | 52 | ) | 49 | ) |
100 | 53 | 50 | ||
101 | 54 | 51 | ||
102 | @@ -93,24 +90,30 @@ | |||
103 | 93 | subdir = os.path.join(mntdir, subdir) | 90 | subdir = os.path.join(mntdir, subdir) |
104 | 94 | self._copy_needed_files_from_directory(subdir) | 91 | self._copy_needed_files_from_directory(subdir) |
105 | 95 | 92 | ||
106 | 93 | def _copy_first_find_from_list(self, subdir, odir, file_list): | ||
107 | 94 | f_path = None | ||
108 | 95 | for fname in file_list: | ||
109 | 96 | f_path = self._find_and_copy(subdir, odir, fname) | ||
110 | 97 | if f_path: | ||
111 | 98 | break | ||
112 | 99 | |||
113 | 100 | return f_path | ||
114 | 101 | |||
115 | 96 | def _copy_needed_files_from_directory(self, subdir): | 102 | def _copy_needed_files_from_directory(self, subdir): |
116 | 97 | odir = os.path.dirname(self._sd_image) | 103 | odir = os.path.dirname(self._sd_image) |
117 | 98 | if self._bootloader == 'u_boot': | 104 | if self._bootloader == 'u_boot': |
118 | 99 | # Extract the bootwrapper from the image | 105 | # Extract the bootwrapper from the image |
125 | 100 | for fname in self.config.simulator_axf_files: | 106 | if self.config.simulator_axf_files and self._axf is None: |
126 | 101 | if self._axf is None: | 107 | self._axf = self._copy_first_find_from_list(subdir, odir, |
127 | 102 | self._axf = self._find_and_copy( | 108 | self.config.simulator_axf_files) |
122 | 103 | subdir, odir, fname) | ||
123 | 104 | else: | ||
124 | 105 | break | ||
128 | 106 | # Extract the kernel from the image | 109 | # Extract the kernel from the image |
132 | 107 | if self.config.simulator_kernel and self._kernel is None: | 110 | if self.config.simulator_kernel_files and self._kernel is None: |
133 | 108 | self._kernel = self._find_and_copy( | 111 | self._kernel = self._copy_first_find_from_list(subdir, odir, |
134 | 109 | subdir, odir, self.config.simulator_kernel) | 112 | self.config.simulator_kernel_files) |
135 | 110 | # Extract the initrd from the image | 113 | # Extract the initrd from the image |
139 | 111 | if self.config.simulator_initrd and self._initrd is None: | 114 | if self.config.simulator_initrd_files and self._initrd is None: |
140 | 112 | self._initrd = self._find_and_copy( | 115 | self._initrd = self._copy_first_find_from_list(subdir, odir, |
141 | 113 | subdir, odir, self.config.simulator_initrd) | 116 | self.config.simulator_initrd_files) |
142 | 114 | # Extract the dtb from the image | 117 | # Extract the dtb from the image |
143 | 115 | if self.config.simulator_dtb and self._dtb is None: | 118 | if self.config.simulator_dtb and self._dtb is None: |
144 | 116 | self._dtb = self._find_and_copy( | 119 | self._dtb = self._find_and_copy( |
145 | @@ -128,13 +131,13 @@ | |||
146 | 128 | raise RuntimeError('No AXF found, %r' % | 131 | raise RuntimeError('No AXF found, %r' % |
147 | 129 | self.config.simulator_axf_files) | 132 | self.config.simulator_axf_files) |
148 | 130 | # Kernel is needed only for b.L models | 133 | # Kernel is needed only for b.L models |
150 | 131 | if self._kernel is None and self.config.simulator_kernel: | 134 | if self._kernel is None and self.config.simulator_kernel_files: |
151 | 132 | raise RuntimeError('No KERNEL found, %r' % | 135 | raise RuntimeError('No KERNEL found, %r' % |
153 | 133 | self.config.simulator_kernel) | 136 | self.config.simulator_kernel_files) |
154 | 134 | # Initrd is needed only for b.L models | 137 | # Initrd is needed only for b.L models |
156 | 135 | if self._initrd is None and self.config.simulator_initrd: | 138 | if self._initrd is None and self.config.simulator_initrd_files: |
157 | 136 | raise RuntimeError('No INITRD found, %r' % | 139 | raise RuntimeError('No INITRD found, %r' % |
159 | 137 | self.config.simulator_initrd) | 140 | self.config.simulator_initrd_files) |
160 | 138 | # DTB is needed only for b.L models | 141 | # DTB is needed only for b.L models |
161 | 139 | if self._dtb is None and self.config.simulator_dtb: | 142 | if self._dtb is None and self.config.simulator_dtb: |
162 | 140 | raise RuntimeError('No DTB found, %r' % | 143 | raise RuntimeError('No DTB found, %r' % |
163 | 141 | 144 | ||
164 | === modified file 'lava_dispatcher/device/target.py' | |||
165 | --- lava_dispatcher/device/target.py 2013-06-19 21:49:04 +0000 | |||
166 | +++ lava_dispatcher/device/target.py 2013-07-01 10:49:37 +0000 | |||
167 | @@ -158,14 +158,14 @@ | |||
168 | 158 | def _find_and_copy(self, rootdir, odir, pattern, name=None): | 158 | def _find_and_copy(self, rootdir, odir, pattern, name=None): |
169 | 159 | dest = None | 159 | dest = None |
170 | 160 | for root, dirs, files in os.walk(rootdir): | 160 | for root, dirs, files in os.walk(rootdir): |
173 | 161 | for file in files: | 161 | for file_name in files: |
174 | 162 | if re.match(pattern, file): | 162 | if re.match(pattern, file_name): |
175 | 163 | if name: | 163 | if name: |
176 | 164 | dest = os.path.join(odir, name) | 164 | dest = os.path.join(odir, name) |
177 | 165 | else: | 165 | else: |
179 | 166 | dest = os.path.join(odir, file) | 166 | dest = os.path.join(odir, file_name) |
180 | 167 | if rootdir != odir: | 167 | if rootdir != odir: |
182 | 168 | src = os.path.join(rootdir, file) | 168 | src = os.path.join(root, file_name) |
183 | 169 | shutil.copyfile(src, dest) | 169 | shutil.copyfile(src, dest) |
184 | 170 | return dest | 170 | return dest |
185 | 171 | else: | 171 | else: |
One thing I am not sure is that if I should change the usage of _copy_needed_ files_from_ partition method in deploy_android method of lava_dispatcher /device/ fastmodel. py file.
it is called as such in the deploy_linaro method: needed_ files_from_ directory( odir) needed_ files_from_ partition( self.config. boot_part, 'rtsm') needed_ files_from_ partition( self.config. root_part, 'boot')
self._copy_
self._copy_
self._copy_
but called like this in the deploy_android method: needed_ files_from_ partition( self.config. boot_part, '')
self._copy_
if we add following line to the deploy_android method, I guess it will work too. needed_ files_from_ partition( self.config. boot_part, 'rtsm')
self._copy_
but do we really need to specify the second parameter?