Initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/user:"
|
||||
|
||||
inherit obmc-phosphor-systemd
|
||||
|
||||
RDEPENDS:${PN} += "bash"
|
||||
|
||||
|
||||
SRC_URI += " file://update_admin_account.sh"
|
||||
SYSTEMD_SERVICE:${PN}:append = " update_admin_account.service"
|
||||
|
||||
do_install:append() {
|
||||
install -m 0755 ${WORKDIR}/update_admin_account.sh ${D}${bindir}/update_admin_account.sh
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Update admin user home directory
|
||||
Before=xyz.openbmc_project.User.Manager.service
|
||||
|
||||
[Service]
|
||||
ExecStart={bindir}/update_admin_account.sh
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
RequiredBy=xyz.openbmc_project.User.Manager.service
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# Purpose: creates /home/admin directory and updates admin user
|
||||
# home directory to /home/admin
|
||||
|
||||
# Update admin user home directory
|
||||
if id -u "admin" >/dev/null 2>&1; then
|
||||
# admin user exists
|
||||
homedir=$(grep '^admin:' /etc/passwd | cut -d: -f6)
|
||||
if test "${homedir}" = "/"; then
|
||||
echo "Changing admin user home directory"
|
||||
mkdir -p /home/admin
|
||||
chmod 0755 /home/admin
|
||||
chown --recursive admin:admin /home/admin
|
||||
usermod --home /home/admin admin
|
||||
else
|
||||
echo "admin user home directory is okay"
|
||||
fi
|
||||
else
|
||||
echo "admin user account is not present"
|
||||
fi
|
||||
Reference in New Issue
Block a user