Initial commit
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Purpose: Upgrade pre-release BMCs with items needed for hostconsole group
|
||||
# This can be removed when there is no longer a direct upgrade path for BMCs
|
||||
# which were installed with pre-release images.
|
||||
|
||||
# Create groups if not already present
|
||||
if grep -wq hostconsole /etc/group; then
|
||||
echo "hostconsole group already exists"
|
||||
else
|
||||
echo "hostconsole group does not exist, add it"
|
||||
groupadd -f hostconsole
|
||||
fi
|
||||
|
||||
# Add the root user to the groups
|
||||
if id -nG root | grep -wq hostconsole; then
|
||||
echo "root already in hostconsole"
|
||||
else
|
||||
echo "root not in group hostconsole, add it"
|
||||
usermod -a -G hostconsole root
|
||||
fi
|
||||
|
||||
# Add all users in the priv-admin group to the
|
||||
# hostconsole group so that it will not break
|
||||
# exiting setup for any user.
|
||||
for usr in $(grep '^'priv-admin':.*$' /etc/group | cut -d: -f4 | tr ',' ' ')
|
||||
do
|
||||
# Add the usr to the hostconsole group
|
||||
if id -nG "$usr" | grep -wq hostconsole; then
|
||||
echo "$usr already in hostconsole"
|
||||
else
|
||||
echo "$usr not in group hostconsole, add it"
|
||||
usermod -a -G hostconsole "$usr"
|
||||
fi
|
||||
done
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Phosphor Ldap config updater
|
||||
Wants=nslcd.service nscd.service
|
||||
After=nslcd.service nscd.service
|
||||
Before=xyz.openbmc_project.Software.Sync.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env phosphor-ldap-conf
|
||||
SyslogIdentifier=phosphor-ldap-conf
|
||||
Restart=always
|
||||
Type=dbus
|
||||
BusName={BUSNAME}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Phosphor User Manager
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/usr/libexec/upgrade_hostconsole_group.sh
|
||||
ExecStart=/usr/bin/env phosphor-user-manager
|
||||
SyslogIdentifier=phosphor-user-manager
|
||||
Restart=always
|
||||
Type=dbus
|
||||
BusName={BUSNAME}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,59 @@
|
||||
SUMMARY = "Phosphor User Manager Daemon"
|
||||
DESCRIPTION = "Daemon that does user management"
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-user-manager"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "phosphor-dbus-interfaces"
|
||||
DEPENDS += "boost"
|
||||
DEPENDS += "nss-pam-ldapd"
|
||||
DEPENDS += "systemd"
|
||||
SRCREV = "4b29462cd9873391e1e0414840515f76aeaeae89"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-user-manager;branch=master;protocol=https"
|
||||
SRC_URI += "file://upgrade_hostconsole_group.sh"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit obmc-phosphor-dbus-service
|
||||
inherit useradd
|
||||
|
||||
EXTRA_OEMESON = "-Dtests=disabled"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${libexecdir}
|
||||
install -m 0755 ${WORKDIR}/upgrade_hostconsole_group.sh ${D}${libexecdir}/upgrade_hostconsole_group.sh
|
||||
}
|
||||
|
||||
FILES:phosphor-ldap += " \
|
||||
${bindir}/phosphor-ldap-conf \
|
||||
"
|
||||
FILES:${PN} += " \
|
||||
${systemd_unitdir} \
|
||||
${datadir}/dbus-1 \
|
||||
${datadir}/phosphor-certificate-manager \
|
||||
"
|
||||
|
||||
USERADD_PACKAGES = "${PN} phosphor-ldap"
|
||||
|
||||
PACKAGE_BEFORE_PN = "phosphor-ldap"
|
||||
DBUS_PACKAGES = "${USERADD_PACKAGES}"
|
||||
# add groups needed for privilege maintenance
|
||||
GROUPADD_PARAM:${PN} = "priv-admin; priv-operator; priv-user "
|
||||
GROUPADD_PARAM:phosphor-ldap = "priv-admin; priv-operator; priv-user "
|
||||
DBUS_SERVICE:${PN} += "xyz.openbmc_project.User.Manager.service"
|
||||
DBUS_SERVICE:phosphor-ldap = " \
|
||||
xyz.openbmc_project.Ldap.Config.service \
|
||||
"
|
||||
|
||||
EXTRA_USERS_PARAMS += " \
|
||||
groupadd hostconsole; \
|
||||
"
|
||||
|
||||
EXTRA_USERS_PARAMS += " \
|
||||
usermod --append --groups hostconsole root; \
|
||||
"
|
||||
Reference in New Issue
Block a user