summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/devtool/standard.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 6ba86ed801..f2621cdb91 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -273,6 +273,10 @@ def _extract_source(srctree, keep_temp, devbranch, d):
273 task_executor.exec_func('do_fetch', False) 273 task_executor.exec_func('do_fetch', False)
274 logger.info('Unpacking...') 274 logger.info('Unpacking...')
275 task_executor.exec_func('do_unpack', False) 275 task_executor.exec_func('do_unpack', False)
276 if bb.data.inherits_class('kernel-yocto', d):
277 # Extra step for kernel to populate the source directory
278 logger.info('Doing kernel checkout...')
279 task_executor.exec_func('do_kernel_checkout', False)
276 srcsubdir = crd.getVar('S', True) 280 srcsubdir = crd.getVar('S', True)
277 if srcsubdir == workdir: 281 if srcsubdir == workdir:
278 # Find non-patch sources that were "unpacked" to srctree directory 282 # Find non-patch sources that were "unpacked" to srctree directory
@@ -302,26 +306,21 @@ def _extract_source(srctree, keep_temp, devbranch, d):
302 else: 306 else:
303 os.rmdir(patchdir) 307 os.rmdir(patchdir)
304 308
305 if bb.data.inherits_class('kernel-yocto', d): 309 if not os.listdir(srcsubdir):
306 (stdout, _) = bb.process.run('git --git-dir="%s" rev-parse HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir) 310 raise DevtoolError("no source unpacked to S, perhaps the %s "
307 initial_rev = stdout.rstrip() 311 "recipe doesn't use any source?" % pn)
308 else:
309 if not os.listdir(srcsubdir):
310 raise DevtoolError("no source unpacked to S, perhaps the %s "
311 "recipe doesn't use any source?" % pn)
312 312
313 if not os.path.exists(os.path.join(srcsubdir, '.git')): 313 if not os.path.exists(os.path.join(srcsubdir, '.git')):
314 bb.process.run('git init', cwd=srcsubdir) 314 bb.process.run('git init', cwd=srcsubdir)
315 bb.process.run('git add .', cwd=srcsubdir) 315 bb.process.run('git add .', cwd=srcsubdir)
316 bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir) 316 bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir)
317 317
318 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir) 318 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
319 initial_rev = stdout.rstrip() 319 initial_rev = stdout.rstrip()
320
321 bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir)
322 bb.process.run('git tag -f devtool-base', cwd=srcsubdir)
323 320
324 crd.setVar('PATCHTOOL', 'git') 321 bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir)
322 bb.process.run('git tag -f devtool-base', cwd=srcsubdir)
323 crd.setVar('PATCHTOOL', 'git')
325 324
326 logger.info('Patching...') 325 logger.info('Patching...')
327 task_executor.exec_func('do_patch', False) 326 task_executor.exec_func('do_patch', False)