Skip to content
Snippets Groups Projects
Commit f19eeb1f 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 db7e0150
No related branches found
No related tags found
No related merge requests found
......@@ -5,16 +5,19 @@
# Add a new user named oniro with default password oniro
inherit extrausers
# This is a sha512 hash of the word "oniro"
# This is a sha512 hash of the chosen password, by default it's 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."
# WARNING: this is a temporary solution until we have a provisioning solution to set up the initial password
EXTRA_USERS_PARAMS = "\
useradd -p '${ONIRO_USER_PASSWORD}' oniro; \
"
DEFAULT_USER_PASSWORD ?= "\$6\$OQzoC.wu9LDCEs/.\$IPXgswE3EXBYkkMUotolWlUGGJ.zcQjAOlN5C5xEH7dwS/qRKDaL9BSKdsZ/wK5v8TrL2cGQipm4bBUByBVm40"
DEFAULT_USER_USERNAME = "oniro"
EXTRA_USERS_PARAMS = "\
useradd -p '${DEFAULT_USER_PASSWORD}' ${DEFAULT_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 "${DEFAULT_USER_USERNAME} ALL=(ALL:ALL) ALL" > ${IMAGE_ROOTFS}/etc/sudoers.d/${DEFAULT_USER_USERNAME}
echo "Defaults secure_path=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" >> ${IMAGE_ROOTFS}/etc/sudoers.d/${DEFAULT_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