1) refer to the link https://docs.yoctoproject.org/ref-manual/classes.html#extrausers-bbclass
2)remove debug-weaks in the local.conf
This is a reference local.conf change; where the debug-tweaks has been deleted and line 30-35 showing how to set root password and add user named as user1; which has sudo capability.
MACHINE ??= 'imx6ulevk'
DISTRO ?= 'fsl-imx-fb'
PACKAGE_CLASSES ?= "package_rpm"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"
DL_DIR ?= "/home/nxa15297/mydata/aosp/YoctoDN-4.9/downloads"
ACCEPT_FSL_EULA = "1"
BOOT_SPACE = "65536"
IMAGE_OVERHEAD_FACTOR = "1.5"
CORE_IMAGE_EXTRA_INSTALL += " cryptsetup cryptodev-module cryptodev-tests openssh dhcp-client dhcp-server connman"
TOOLCHAIN_HOST_TASK_append = " nativesdk-python nativesdk-python-pycrypto"
IMAGE_INSTALL_append = " sudo"
INHERIT += " extrausers"
EXTRA_USERS_PARAMS = "\
usermod -P 1876*18 root;\
useradd -P 2015*08 user1;\
usermod -a -G sudo user1;\
"
refer to the document
"https://community.nxp.com/t5/iMX-and-Vybrid-Support/i-MX6UL-Yocto-Rootfs-how-to-add-user-and-enable-..."
if you couldn't access it, pls refer to:
To set up proper sudo access for use1, bootup the system and login as root using the above root password. Then using visudo to modify the following line as:
## Uncomment to allow members of group sudo to execute any command
%sudo ALL=(ALL) NOPASSWD: ALL