OLD | NEW |
1 import os, shutil, copy, pickle, re, glob, time, logging | 1 import os, shutil, copy, pickle, re, glob, time, logging |
2 from autotest_lib.client.bin import kernel_config, os_dep, kernelexpand, test | 2 from autotest_lib.client.bin import kernel_config, os_dep, kernelexpand, test |
3 from autotest_lib.client.bin import utils | 3 from autotest_lib.client.bin import utils |
4 from autotest_lib.client.common_lib import log, error, packages | 4 from autotest_lib.client.common_lib import log, error, packages |
5 | 5 |
6 | 6 |
7 def tee_output_logdir_mark(fn): | 7 def tee_output_logdir_mark(fn): |
8 def tee_logdir_mark_wrapper(self, *args, **dargs): | 8 def tee_logdir_mark_wrapper(self, *args, **dargs): |
9 mark = self.__class__.__name__ + "." + fn.__name__ | 9 mark = self.__class__.__name__ + "." + fn.__name__ |
10 logging.info("--- START %s ---", mark) | 10 logging.info("--- START %s ---", mark) |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 # if base_tree is a dir, assume uncompressed kernel | 265 # if base_tree is a dir, assume uncompressed kernel |
266 if os.path.isdir(base_tree): | 266 if os.path.isdir(base_tree): |
267 print 'Symlinking existing kernel source' | 267 print 'Symlinking existing kernel source' |
268 os.symlink(base_tree, self.build_dir) | 268 os.symlink(base_tree, self.build_dir) |
269 | 269 |
270 # otherwise, extract tarball | 270 # otherwise, extract tarball |
271 else: | 271 else: |
272 os.chdir(os.path.dirname(self.src_dir)) | 272 os.chdir(os.path.dirname(self.src_dir)) |
273 # Figure out local destination for tarball | 273 # Figure out local destination for tarball |
274 tarball = os.path.join(self.src_dir, os.path.basename(base_tree)) | 274 tarball = os.path.join(self.src_dir, os.path.basename(base_tree.spli
t(';')[0])) |
275 utils.get_file(base_tree, tarball) | 275 utils.get_file(base_tree, tarball) |
276 print 'Extracting kernel tarball:', tarball, '...' | 276 print 'Extracting kernel tarball:', tarball, '...' |
277 utils.extract_tarball_to_dir(tarball, self.build_dir) | 277 utils.extract_tarball_to_dir(tarball, self.build_dir) |
278 | 278 |
279 | 279 |
280 def extraversion(self, tag, append=1): | 280 def extraversion(self, tag, append=1): |
281 os.chdir(self.build_dir) | 281 os.chdir(self.build_dir) |
282 extraversion_sub = r's/^EXTRAVERSION =\s*\(.*\)/EXTRAVERSION = ' | 282 extraversion_sub = r's/^EXTRAVERSION =\s*\(.*\)/EXTRAVERSION = ' |
283 if append: | 283 if append: |
284 p = extraversion_sub + '\\1-%s/' % tag | 284 p = extraversion_sub + '\\1-%s/' % tag |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 # kernel from that specific path. | 838 # kernel from that specific path. |
839 job.pkgmgr.fetch_pkg(rpm_name, os.path.join(job.pkgdir, rpm_name
), | 839 job.pkgmgr.fetch_pkg(rpm_name, os.path.join(job.pkgdir, rpm_name
), |
840 repo_url=os.path.dirname(kernel_path)) | 840 repo_url=os.path.dirname(kernel_path)) |
841 | 841 |
842 rpm_paths.append(os.path.join(job.pkgdir, rpm_name)) | 842 rpm_paths.append(os.path.join(job.pkgdir, rpm_name)) |
843 return rpm_kernel_vendor(job, rpm_paths, subdir) | 843 return rpm_kernel_vendor(job, rpm_paths, subdir) |
844 else: | 844 else: |
845 if len(kernel_paths) > 1: | 845 if len(kernel_paths) > 1: |
846 raise error.TestError("don't know what to do with more than one non-
rpm kernel file") | 846 raise error.TestError("don't know what to do with more than one non-
rpm kernel file") |
847 return kernel(job,kernel_paths[0], subdir, tmp_dir, build_dir, leave) | 847 return kernel(job,kernel_paths[0], subdir, tmp_dir, build_dir, leave) |
OLD | NEW |