HomeDefectsLIN1022-1897
Fixed

LIN1022-1897 : useradd is not working with LTS22

Created: Sep 26, 2022    Updated: Nov 13, 2022
Resolved Date: Nov 1, 2022
Found In Version: 10.22.33.1
Fix Version: 10.22.33.2
Severity: Standard
Applicable for: Wind River Linux LTS 22
Component/s: Userspace

Description


useradd is not working with LTS22, even the openembedded skeleton exmaple recipe seems to fail:
ERROR: useradd-example-1.0-r1 do_prepare_recipe_sysroot: useradd-example: useradd command did not succeed.

And from the log (log.do_prepare_recipe_sysroot.73422 - attached):
NOTE: useradd-example: Performing useradd with [--root /workspace/xxx/test-lts22/build/tmp-glibc/work/cortexa57-wrs-linux/useradd-example/1.0-r1/recipe-sysroot -u 1202 -d /home/user3 -r -s /bin/bash -P '
useradd: prefix must be an absolute path
ERROR: useradd-example: useradd command did not succeed.

This issue would occur with any layers where customers would use useradd, in a manner like:

inherit useradd
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "..."

The openembedded skeleton exmaple recipe can be easily used to reproduce this issue - as showcased in Steps to Reproduce.

The issue might be related to the following commit:
https://git.yoctoproject.org/yocto-docs/commit/?id=3f3e5574ac9801ad92940168b61b532e0bd53a80

Steps to Reproduce

1. Configure an LTS22 project, quemu BSP
2. Add in the meta-skeleton layer in conf/bblayers.conf
...
  /<prj-dir>/layers/oe-core/meta-skeleton \
"
3. Add the example in conf/local.conf
IMAGE_INSTALL:append = " useradd-example"
4. bitbake wrlinux-image-std