When I changed ROOT_HOME in my custom distro conf file, I had to manually clean the sstate directories of base-files and base-passwd or the change would not appear in the generated RPM packages and the image rootfs. Running the package task manually on those recipes did produce a package directory with correct content, but package_write_rpm again replaced it with the old incorrect content. This had me stumped for a while, but cleaning the sstate fixed it.
I can confirm this is still an issue in the latest master.
This should also cause a re-build of the rootfs, which is doesn't trigger.
Can you provide a little more detail, like what version of Poky/OE-Core meta-data you are using, which bitbake? I just tested this here with core-image-minimal built with no change and then set the ROOT_HOME, I also confirmed that the Signature stamps changed. I looked at the generated rootfs and it has the root directory as /root not /home/root. % cat tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/passwd root::0:0:root:/root:/bin/sh There have been some critical changes recently, just want to make sure you are using the latest HEAD, as it may be fixed there.
oe-core: 9a98b8bfe13b94d89a9e39cca821f26fdeaeffc3 bitbake: 56321b18808f5ed932543d907b9ebcfbf4420233 The main offenders in my case were openshh still using /home/root and passwd still having /home/root. I'm sure there are others, but in order to get a truely clean build I had to wipre tmp/ and sstate/. In order to get it to rebuild at all I had to force the clean of a few packages and then force a rebuild of the rootfs. It didn't pick up the change automatically.
Ok, I tried this again with openssh and it worked correctly for me. Here is what I did: build core-image-minimal with IMAGE_FEATURES +- "ssh-server-openssh" to enable the openssh server. I built that image and verified that the root's home directory is /home/root, then I set ROOT_HOME="/root" and rebuilt, I confirmed in the logs that both base-passwd and openssh rebuilt and the resulting rootfs contained a /root home directory that I could log into via the console and ssh remotely. I am building with Poky master HEAD which has a few more patches, but I don't think any should affect this. I also verified with bitbake-dumpsig the signatures were different before and after the ROOT_HOME change I guess I still need more details about what's failing and how, since I can't reproduce it (yet).
I think I have tracked this down a little better, turns out that we are sed'ing the patch file and once it's changed, the next time we run do_install the change is maintained due to the orignal sed is not matched (since we changed it from /root -> /home/root) the next sed just changes /home/root -> /home/root (matching on the /root part). So no change. I found this is a problem in both base-files and base-passwd, but also found the systemd has a similar issue when it sed's the units directory. For the base-* files, I am changing to sed after installing the file, so the installed file always starts out as the original. The units directory issue is a little harder.
Ah hah, good shout. I don't use the systemd build so hadn't noticed any issues with that. I found that the OpenSSH problem was seemingly one of my own making so I would cross that off from the list for the time being. I'm glad you've found the issue, I was starting to doubt what I'd seen!
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=49cdb68e3bfa885e7eaf67aec97631413f53bdf3 http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=370b2d819648ea6dd963b1e6f22ef2d15e6f74ea http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d2f5f2b0b129a654ae8b3ff3f048b582c93c385b