mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
devtool: extract: correct initial rev for kernel packages
Change handling of kernel packages so that the "initial rev" is parsed correctly. Also, the devtool-specific git tags (devtool-base and devtoo-patched) are now generated for kernel packages as well. [YOCTO #6658] (From OE-Core rev: 65fe3e45b10c5578446c758f66840891c62cd774) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
9e9fd091d5
commit
3b3f9bbc30
@@ -273,6 +273,10 @@ def _extract_source(srctree, keep_temp, devbranch, d):
|
|||||||
task_executor.exec_func('do_fetch', False)
|
task_executor.exec_func('do_fetch', False)
|
||||||
logger.info('Unpacking...')
|
logger.info('Unpacking...')
|
||||||
task_executor.exec_func('do_unpack', False)
|
task_executor.exec_func('do_unpack', False)
|
||||||
|
if bb.data.inherits_class('kernel-yocto', d):
|
||||||
|
# Extra step for kernel to populate the source directory
|
||||||
|
logger.info('Doing kernel checkout...')
|
||||||
|
task_executor.exec_func('do_kernel_checkout', False)
|
||||||
srcsubdir = crd.getVar('S', True)
|
srcsubdir = crd.getVar('S', True)
|
||||||
if srcsubdir == workdir:
|
if srcsubdir == workdir:
|
||||||
# Find non-patch sources that were "unpacked" to srctree directory
|
# Find non-patch sources that were "unpacked" to srctree directory
|
||||||
@@ -302,26 +306,21 @@ def _extract_source(srctree, keep_temp, devbranch, d):
|
|||||||
else:
|
else:
|
||||||
os.rmdir(patchdir)
|
os.rmdir(patchdir)
|
||||||
|
|
||||||
if bb.data.inherits_class('kernel-yocto', d):
|
if not os.listdir(srcsubdir):
|
||||||
(stdout, _) = bb.process.run('git --git-dir="%s" rev-parse HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir)
|
raise DevtoolError("no source unpacked to S, perhaps the %s "
|
||||||
initial_rev = stdout.rstrip()
|
"recipe doesn't use any source?" % pn)
|
||||||
else:
|
|
||||||
if not os.listdir(srcsubdir):
|
|
||||||
raise DevtoolError("no source unpacked to S, perhaps the %s "
|
|
||||||
"recipe doesn't use any source?" % pn)
|
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(srcsubdir, '.git')):
|
if not os.path.exists(os.path.join(srcsubdir, '.git')):
|
||||||
bb.process.run('git init', cwd=srcsubdir)
|
bb.process.run('git init', cwd=srcsubdir)
|
||||||
bb.process.run('git add .', cwd=srcsubdir)
|
bb.process.run('git add .', cwd=srcsubdir)
|
||||||
bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir)
|
bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir)
|
||||||
|
|
||||||
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
|
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
|
||||||
initial_rev = stdout.rstrip()
|
initial_rev = stdout.rstrip()
|
||||||
|
|
||||||
bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir)
|
bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir)
|
||||||
bb.process.run('git tag -f devtool-base', cwd=srcsubdir)
|
bb.process.run('git tag -f devtool-base', cwd=srcsubdir)
|
||||||
|
crd.setVar('PATCHTOOL', 'git')
|
||||||
crd.setVar('PATCHTOOL', 'git')
|
|
||||||
|
|
||||||
logger.info('Patching...')
|
logger.info('Patching...')
|
||||||
task_executor.exec_func('do_patch', False)
|
task_executor.exec_func('do_patch', False)
|
||||||
|
|||||||
Reference in New Issue
Block a user