Skip to content
Snippets Groups Projects
Commit d30fc43d authored by Ghassane Ben El Aattar's avatar Ghassane Ben El Aattar
Browse files

oniro-user: Made the Oniro username a variable.


This should make it possible to edit the username
by modyfing the local.conf file and also automate
this process.

Signed-off-by: default avatarGhassane Ben El Aattar <ghassaneb.aattar@huawei.com>
parent 4c0160e8
No related branches found
No related tags found
1 merge request!249oniro-user: Make the Oniro username a variable
......@@ -8,13 +8,16 @@ 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
# 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; \
"
ONIRO_USER_USERNAME = "oniro"
EXTRA_USERS_PARAMS = "\
useradd -p '${ONIRO_USER_PASSWORD}' ${ONIRO_USER_USERNAME}; \
"
IMAGE_INSTALL:append = " sudo"
# Add to secure_path:
......@@ -26,8 +29,8 @@ IMAGE_INSTALL:append = " sudo"
# - /usr/local/sbin
# Add oniro to the sudo users
init_user_oniro () {
echo "oniro ALL=(ALL:ALL) ALL" > ${IMAGE_ROOTFS}/etc/sudoers.d/oniro
echo "Defaults secure_path=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" >> ${IMAGE_ROOTFS}/etc/sudoers.d/oniro
echo "${ONIRO_USER_USERNAME} ALL=(ALL:ALL) ALL" > ${IMAGE_ROOTFS}/etc/sudoers.d/${ONIRO_USER_USERNAME}
echo "Defaults secure_path=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" >> ${IMAGE_ROOTFS}/etc/sudoers.d/${ONIRO_USER_USERNAME}
}
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