This is yet another important hidden gem as of now. It would be nice to see some documentation for it. Some relevant information can be found the link below how to override the default and what the default value of this variable is. http://patches.openembedded.org/patch/49683/
Hi, Please see http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-ROOT_HOME for the variable. I am marking the status as IN PROGRESS REVIEW. Please look it over and comment if needed. Thanks, Scott
I have only one suggestion. Instead of: ROOT_HOME ?= "<path>" I would probably write: ROOT_HOME = "/root" a) "?=" means the variable is set if it is not yet set (at least in my understanding), but it will be always set to something by default ("/home/root"). b) "/root" seems to be probably the most common case (i.e. majority) for the override. Otherwise, it looks OK. Hmm, perhaps I would also mention the reason why the default value is that rather than the most common Unix "/root". As far as I know, the reason is that some embedded scenarios prefer to have read-only root filesystem, and hence they prefer to keep the writable data in one place, hence "/home/root" because other user folders are also under the "/home" folder.
Laszlo, Thanks for the suggestions. I will get another version in that uses them. Before that, though, I have a question on overriding this path. I don't see how the default would ever be overridden. The "?=" operator does only assign the override path if ROOT_HOME is not set. But it is set in the BitBake conf file. I don't get it... Maybe you can explain it to me. Thanks, Scott
As far as I know, "=" will always override. "?=" will only override if it is not set. For instance, in the following scenario: FOO ?= bar FOO = baz FOO will be set to baz. I am not 100% sure how the bitbake conf is evaluated, but since it seems to be the core of the system, it is likely to be evaluated before the layers, especially the end user's layer. So, you can compare bitbake's setting to "bar", and the end user's baz. Paul Eggleton or Ross Burton could fix me if I am wrong, but that would be my understanding. This is also what I discussed with an existing user on IRC how he sets the variable to "/root" with simple the "=" (assignment) operator.
Okay - that makes sense. The comment in the http://patches.openembedded.org/patch/49683/ did not make sense. He specifically says to override it with "?=". That was confusing me... Thanks
Hmm, from the bitbake manual: http://docs.openembedded.org/bitbake/html/ch02.html#id398548 Now, I am also confused. :) I do not have much experience with "??=" and "?=". Your original code about "?=" might be wrong, and I wrongly misled you, apologize. So, if I understand the bitbake documentation correct, if you do this: FOO ??= bar and later in the same parsing unit: FOO ?= baz Then we can conclude the following: FOO is initially unset, so it will be set to either bar or baz. "??=" guarantees no immediate assignment until the complete parsing is done, so it goes further. Once the parsing reaches the second statement, FOO is still unset, and the immediate assigment will assign baz. So, it seems to be your original version is right, and the "=" assignment is also right. As for me as an end user, "=" would cause the least confusion for this scenario, so I think it is good idea to represent that. You are right that probably the patch from Kang should have suggested that instead.
"Your original code about "?=" might be wrong, and I wrongly misled you, apologize." Sorry, that is a typo. I meant to write that: "Your original code about "?=" might be correct, and I wrongly misled you, apologize."
Okay Laszlo... Try this new version at http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-ROOT_HOME. I tried to get in the extra information and I am covering both the "=" and "?=" cases. Let me know if you have more changes. Thanks, Scott
Works for me, thanks!
Thanks Laszlo, I am marking this one as RESOLVED and setting the doc flag to "Done". Thanks, Scott