Fetching into non-bare repository with bitbake

2019-09-05 15:55发布

问题:

Looks like I am facing a trivial issue, but I am not able to figure out anything. I was trying to bitbake the raspberry pi image and due to bad internet connection, it failed. Now when I retried to bitbake again, it gives me the below error.

fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository

I understand that, this is because my git repository is no longer bare. After searching a lot on the internet, I found only one solution. Running the below command will probably fix the issue.

bitbake -c cleanall

As per my understanding this will clear most of the contents of the build directory of poky. I want to avoid this. Is there any way I can continue bitbaking without cleaning all the stuff that I have downloaded so far ?

回答1:

You need to know what package is failing (and bitbake tells that), after that doing something like

$ bitbake -c cleansstate $PACKAGE_NAME
$ rm -fr ${DL_DIR}/git2/$REPOSITORY

(where $PACKAGE_NAME is your package name, ${DL_DIR} is the variable from local.conf (defaults to build/downloads) and $REPOSITORY is the repository (URL from the recipe) for this $PACKAGE_NAME) should be enough.