Skip to content
Snippets Groups Projects
Verified Commit f39d8ed1 authored by Davide Gardenal's avatar Davide Gardenal
Browse files

meta-oniro-core: create oniro-user class


oniro-user is a class that can be inherited in local.conf
and it adds a user named oniro with default password oniro.
The class also installs sudo and adds oniro to the suders.

Signed-off-by: Davide Gardenal's avatarDavide Gardenal <davide.gardenal@huawei.com>
parent 6b4d14bf
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !168. Comments created here will be created in the context of that merge request.
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Add a new user named oniro with default password oniro
inherit extrausers
# This is a sha512 hash of the word "oniro"
# To generate a new password run the following command:
# $ mkpasswd -m sha512crypt
# WARNING: this is a temporary solution until we have a provisioning solution to set up the initial password
ONIRO_USER_PASSWORD ?= "\$6\$cI/pmFRW1S8seZ24\$e/7XAuVsOBgoAEmlKQnk54.jQEpRuQmmzik6.1Osaji7ca.04N70Ji.PN86sFXBvqwDGhhSr.jqZsDDA8OVuy."
EXTRA_USERS_PARAMS = "\
useradd -p '${ONIRO_USER_PASSWORD}' oniro; \
"
IMAGE_INSTALL:append = " sudo"
# Add to PATH:
# - /usr/local/sbin
# - /usr/sbin
# - /sbin
# Add oniro to the sudo users
init_user_oniro () {
echo "export PATH=\$PATH:/usr/local/sbin:/usr/sbin:/sbin" >> ${IMAGE_ROOTFS}/home/oniro/.bashrc
echo "oniro ALL=(ALL:ALL) ALL" > ${IMAGE_ROOTFS}/etc/sudoers.d/oniro
}
ROOTFS_POSTPROCESS_COMMAND:append = " init_user_oniro;"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment