summaryrefslogtreecommitdiff
path: root/recipes-core/useradd
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2020-07-22 17:35:52 -0500
committerJohn Klug <john.klug@multitech.com>2020-07-22 17:35:52 -0500
commitef2522b126d6d00584781e34340294f1e1470d4a (patch)
tree038f4acc0caf864e2cdbbf5288d6582f3e69edcd /recipes-core/useradd
parent101849516150716c1fe2141746dbea0f843732b6 (diff)
downloadmeta-mlinux-ef2522b126d6d00584781e34340294f1e1470d4a.tar.gz
meta-mlinux-ef2522b126d6d00584781e34340294f1e1470d4a.tar.bz2
meta-mlinux-ef2522b126d6d00584781e34340294f1e1470d4a.zip
Alternative to commissioning for test images
Diffstat (limited to 'recipes-core/useradd')
-rw-r--r--recipes-core/useradd/useradd.bb20
1 files changed, 10 insertions, 10 deletions
diff --git a/recipes-core/useradd/useradd.bb b/recipes-core/useradd/useradd.bb
index 29d6508..d229a2f 100644
--- a/recipes-core/useradd/useradd.bb
+++ b/recipes-core/useradd/useradd.bb
@@ -7,9 +7,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
S = "${WORKDIR}"
-user = "mtadm"
-home = "/home/${user}"
-FILES_${PN} = "${home}/.ssh"
+
inherit useradd
# You must set USERADD_PACKAGES when you inherit useradd. This
@@ -30,28 +28,30 @@ GROUPADD_PARAM_${PN} = "-r -g 27 sudo"
# useradd command. Multiple users can be created by separating
# the commands with a semicolon. Here we'll create two users,
# user1 and user2:
-USERADD_PARAM_${PN} = "-u 50 -G sudo,disk,dialout -m -r -s /bin/bash ${user}"
+USERADD_PARAM_${PN} = "-u 50 -G sudo,disk,dialout -m -r -s /bin/bash mtadm"
do_install () {
# If the recipe doesn't have a file, the ipk
# is deleted, and it does nothing.
# Create a .ssh directory for mtadm.
- install -d 0700 ${D}/${FILES_${PN}}
- chown mtadm:mtadm ${D}/${home}
- chown mtadm:mtadm ${D}/${FILES_${PN}}
+ install -d 0700 ${D}/home/mtadm/.ssh
+ chown mtadm:mtadm ${D}/home/mtadm
+ chown mtadm:mtadm ${D}/home/mtadm/.ssh
}
+FILES_${PN} = "/home/mtadm/.ssh"
+
# Prevents do_package failures with:
# debugsources.list: No such file or directory:
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
pkg_postinst_${PN} () {
- profile=${home}/.profile
+ profile=$D/home/mtadm/.profile
if ! grep 'sbin' ${profile} ; then
Sub='${PA'
Sub=${Sub}'TH}:/sbin:/usr/sbin'
- echo 'PATH='${Sub} >>$D/${home}/.profile
- echo 'export PATH' >>$D/${home}/.profile
+ echo 'PATH='${Sub} >>${profile}
+ echo 'export PATH' >>${profile}
fi
# If doing an update, we need to add mtadm to dialout.
# If the admin has been changed, then the user must