I'm setting up yocto v1.7.1 "dizzy" to build a custom Linux image from a customized Linux kernel revision checked into my local git repository.
When going through the build process it fails during do_validate_branches()
with the following error messages.
DEBUG: Executing shell function do_validate_branches
usage: git cat-file (-t|-s|-e|-p|<type>|--textconv) <object>
or: git cat-file (--batch|--batch-check) < <list_of_objects>
<type> can be one of: blob, tree, commit, tag
-t show object type
-s show object size
-e exit with zero when there's no error
-p pretty-print object's content
--textconv for blob objects, run textconv on object's content
--batch[=<format>] show info and content of objects fed from the standard input
--batch-check[=<format>]
show info about objects fed from the standard input
ERROR: is not a valid commit ID.
ERROR: The kernel source tree may be out of sync
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_validate_branches (log file is located at etc..)
Looking at the generated code for do_validate_branches the problem seems to be because it is calling git cat-file -t ${machine_srcrev}
, but ${machine_srcrev}
is an empty string. Further this seems to be because I am using the following in my linux-yocto-custom.bb
SRCREV="${AUTOREV}"
Because when I replace it with a revision number I no longer get the problem, such as...
SRCREV="7035c2a67d964acbb5d917f470bcda42691a3d9c"
The thing is I actually want this recipe to build from the HEAD of the branch, so putting a specific revision does not seem to be what I'm after and SRCREV="${AUTOREV}"
would seem to be what I actually want. But as mentioned above this makes ${SRCREV_machine}
is an empty string, rather than AUTOINC
as I think it should be evaluating to.
Can anyone offer me any insight on how I can get the recipe to both follow the head without having to constantly update the recipe to contain the correct SRCREV
and have it pass its do_validate_branches()
? What am I missing here?
Edit: More info...
The problem also seems to be fixed if I modify my kernel-yocto.bbclass as follows... @285
- machine_srcrev="${SRCREV_machine}"
+ machine_srcrev="${@ get_machine_branch(d, "${SRCREV}" )}"
My understanding of my change is I am making it explicitly re-get the $SRCREV
from my machine branch. Which the original seems to think is already stored in ${SRCREV_machine}
. Though the original results in an empty string and my change results in AUTOINC
.
Though I still think I must be missing something, because I shouldn't need to be editing the base classes. But I'm always more inclined to think I'm missing something, than that this is a bug. Perhaps I should be posting this to the yocto mailing lists somewhere.
After some small discussion on the yocto mailing list... http://thread.gmane.org/gmane.linux.embedded.yocto.general/24316
Summary:
It seems that the current logic in do_validate_branches()
is not full proof.
In particular it seems that SRCREV_machine
is not set correctly by the time it gets to do_validate_branches()
, at least in this instance where I am using linux-yocto-custom.bb and trying to track the head of a source branch with SRCREV="${AUTOREV}"
. It is currently being looked at and reworked, hopefully for v1.8 release.
A good work around is to just set SRCREV_machine
in your linux-yocto-custom.bb. In particular you can set it to the same thing as your SRCREV
variable on the line directly after setting your SRCREV
variable. So that it looks like...
SRCREV="${AUTOREV}"
SRCREV_machine="${AUTOREV}" # or SRCREV_machine="${SRCREV}"
Keeping in mind that eventually when you lock down the source version you are building from and replace "${AUTOREV}"
with a specific revision, this problem then goes away.
So this work around is only neccesary for development builds when the source you are building from is still progressing, so you want to track the moving head with "${AUTOREV}"
.