There's more...

When generating users and groups using the useradd class, the uid and gid values are assigned dynamically during package installation. If this is not desired, there is a way to assign system-wide static uid and gid values by providing your own passwd and group files.

To do this, you need to define the USERADDEXTENSION variable in your conf/local.conf file as follows:

USERADDEXTENSION = "useradd-staticids" 

The build system will then search the BBPATH variable for files/passwd and files/group files to obtain the uid and gid values. The files have the standard passwd layout as defined previously, with the password field ignored.

The default filenames can be overridden by using the USERADD_UID_TABLES and USERADD_GID_TABLES variables.

You also need to define the following:

USERADD_ERROR_DYNAMIC = "error" 

This is done so that the build system produces an error if the required uid and gid values are not found in the provided files.

Note that if you use the useradd class in a project that is already built, you will need to remove the tmp directory and rebuild from the sstate-cache directory or you will get build errors.

There is also a way to add user and group information that is not tied to a specific recipe but to an image: by using the extrausers class. It is configured by the EXTRA_USERS_PARAMS variable in an image recipe. For example, to change the root password to password it is used as follows:

inherit extrausers 
 
EXTRA_USERS_PARAMS = " 
  usermod -p 9PfNy0O1z0O5g root;   
  " 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset