summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/devtool/standard.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4cb03f3a54..bf18aae686 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -137,10 +137,6 @@ def _extract_source(srctree, keep_temp, devbranch, d):
137 logger.error("The perf recipe does not actually check out source and thus cannot be supported by this tool") 137 logger.error("The perf recipe does not actually check out source and thus cannot be supported by this tool")
138 return None 138 return None
139 139
140 if 'work-shared' in d.getVar('S', True):
141 logger.error("The %s recipe uses a shared workdir which this tool does not currently support" % pn)
142 return None
143
144 if bb.data.inherits_class('image', d): 140 if bb.data.inherits_class('image', d):
145 logger.error("The %s recipe is an image, and therefore is not supported by this tool" % pn) 141 logger.error("The %s recipe is an image, and therefore is not supported by this tool" % pn)
146 return None 142 return None
@@ -169,6 +165,16 @@ def _extract_source(srctree, keep_temp, devbranch, d):
169 workdir = os.path.join(tempdir, 'workdir') 165 workdir = os.path.join(tempdir, 'workdir')
170 crd.setVar('WORKDIR', workdir) 166 crd.setVar('WORKDIR', workdir)
171 crd.setVar('T', os.path.join(tempdir, 'temp')) 167 crd.setVar('T', os.path.join(tempdir, 'temp'))
168 if not crd.getVar('S', True).startswith(workdir):
169 # Usually a shared workdir recipe (kernel, gcc)
170 # Try to set a reasonable default
171 if bb.data.inherits_class('kernel', d):
172 crd.setVar('S', '${WORKDIR}/source')
173 else:
174 crd.setVar('S', '${WORKDIR}/${BP}')
175 if bb.data.inherits_class('kernel', d):
176 # We don't want to move the source to STAGING_KERNEL_DIR here
177 crd.setVar('STAGING_KERNEL_DIR', '${S}')
172 178
173 # FIXME: This is very awkward. Unfortunately it's not currently easy to properly 179 # FIXME: This is very awkward. Unfortunately it's not currently easy to properly
174 # execute tasks outside of bitbake itself, until then this has to suffice if we 180 # execute tasks outside of bitbake itself, until then this has to suffice if we
@@ -204,7 +210,10 @@ def _extract_source(srctree, keep_temp, devbranch, d):
204 else: 210 else:
205 os.rmdir(patchdir) 211 os.rmdir(patchdir)
206 212
207 if not bb.data.inherits_class('kernel-yocto', d): 213 if bb.data.inherits_class('kernel-yocto', d):
214 (stdout, _) = bb.process.run('git --git-dir="%s" rev-parse HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir)
215 initial_rev = stdout.rstrip()
216 else:
208 if not os.listdir(srcsubdir): 217 if not os.listdir(srcsubdir):
209 logger.error("no source unpacked to S, perhaps the %s recipe doesn't use any source?" % pn) 218 logger.error("no source unpacked to S, perhaps the %s recipe doesn't use any source?" % pn)
210 return None 219 return None