Tree/branch: poky/1.2_M4 Commit: 4d9f4d6ac25f39fe6d5491d05c7a26195bab648b Following the wiki page: https://wiki.yoctoproject.org/wiki/PAM_Integration to build a image with PAM support. Image do_rootfs failed: | -- | WARNING: useradd command did not succeed. Retrying... | WARNING: useradd command did not succeed. Retrying... | WARNING: useradd command did not succeed. Retrying... | WARNING: useradd command did not succeed. Retrying... | WARNING: useradd command did not succeed. Retrying... | ERROR: tried running useradd command 10 times without success, giving up | xserver-nodm-init ################################################## | Adding system startup for /buildarea2/yzhao-test/poky-test/build-pam/tmp/work/qemumips-poky-linux/core-image-sato-1.0-r0/rootfs/etc/init.d/xserver-nodm. | xrandr ################################################## | update-rc.d ################################################## | sysvinit-pidof ###########ERROR: Function failed: do_rootfs (see /buildarea2/yzhao-test/poky-test/build-pam/tmp/work/qemumips-poky-linux/core-image-sato-1.0-r0/temp/log.do_rootfs.18567 for further information) | ####################################### | NOTE: package core-image-sato-1.0-r0: task do_rootfs: Failed ERROR: Task 8 (/buildarea2/yzhao-test/poky-test/meta/recipes-sato/images/core-image-sato.bb, do_rootfs) failed with exit code '1' NOTE: Tasks Summary: Attempted 4695 tasks of which 455 didn't need to be rerun and 1 failed. Summary: 1 task failed: /buildarea2/yzhao-test/poky-test/meta/recipes-sato/images/core-image-sato.bb, do_rootfs Summary: There were 24 WARNING messages shown. Summary: There was 1 ERROR message shown, returning a non-zero exit code.
This failure is apparently a nondeterministic error that is appearing randomly. The useradd class now uses code which checks that the user account or group account was created in the passwd and group files, respectively. If the account was not created (which is verified via a grep command), the script sleeps for 1 second and tries again, up to 10 times. This is intended to avoid lockfile races, as useradd and groupadd lock the passwd and group files when creating accounts. I'll take this bug, I have the most familiarity with the code.
The root cause of this bug is that, despite efforts to ensure base-passwd and (if needed) shadow packages get installed first, they are actually not. I've found that the do_rootfs logs for the final image when this bug occur show the useradd retry failure up until the point that the shadow package is installed. After that fact, any package installations that need to call useradd will succeed. Further research is ongoing to discover why shadow is not being installed by RPM earlier in the rootfs generation process.
Richard fixed this in oe-core and poky master as of: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0923ee40ae59133c91a95e0727eb1ab95aca13b8
Verified with 1.2 rc3. Tree/branch: poky/1.2_M4 Commit: fae1c7a5fdcea199338b5f91efaafd7c72aec5dd