Add new user, set password and change root password in Yocto

Created a new image recipe like below and named it as, recipes-images/images/lynxbee-core-image-minimal.bb

inherit extrausers
SUMMARY = "A small image just capable of allowing a device to boot."

IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"

IMAGE_LINGUAS = " "

LICENSE = "MIT"

inherit core-image

IMAGE_ROOTFS_SIZE ?= "8192"

EXTRA_USERS_PARAMS = "\
        useradd -P password124 lynxbee; \
        usermod -P password124 root; \"

Compile the image as,

$ bitbake lynxbee-core-image-minimal

and run as,

$ runqemu qemuarm

On, login menu you should be able to use the user & passwords as defined above.

Reference : Yocto manual

Leave a Comment