summaryrefslogtreecommitdiff
path: root/recipes-core/useradd
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2019-07-26 13:00:09 -0500
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-20 13:46:02 +0300
commitd5eda847daabc4b27c61ab35407c457efe80516e (patch)
tree12f029833822a9ade7ba3f3f337cbf915b971750 /recipes-core/useradd
parentdc6ddbdae1fdb0c8c703aedf8de28821d46a3878 (diff)
downloadmeta-mlinux-d5eda847daabc4b27c61ab35407c457efe80516e.tar.gz
meta-mlinux-d5eda847daabc4b27c61ab35407c457efe80516e.tar.bz2
meta-mlinux-d5eda847daabc4b27c61ab35407c457efe80516e.zip
Update recipe useradd for thud
Diffstat (limited to 'recipes-core/useradd')
-rw-r--r--recipes-core/useradd/useradd.bb20
1 files changed, 11 insertions, 9 deletions
diff --git a/recipes-core/useradd/useradd.bb b/recipes-core/useradd/useradd.bb
index cbc48e7..7a026e3 100644
--- a/recipes-core/useradd/useradd.bb
+++ b/recipes-core/useradd/useradd.bb
@@ -7,7 +7,9 @@ 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
@@ -28,30 +30,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 -m -r -s /bin/bash mtadm"
+USERADD_PARAM_${PN} = "-u 50 -G sudo,disk -m -r -s /bin/bash ${user}"
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}/home/mtadm/.ssh
- chown mtadm:mtadm ${D}/home/mtadm
- chown mtadm:mtadm ${D}/home/mtadm/.ssh
+ install -d 0700 ${D}/${FILES_${PN}}
+ chown mtadm:mtadm ${D}/${home}
+ chown mtadm:mtadm ${D}/${FILES_${PN}}
}
-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/mtadm/.profile
+ profile=${home}/.profile
if ! grep 'sbin' ${profile} ; then
Sub='${PA'
Sub=${Sub}'TH}:/sbin:/usr/sbin'
- echo 'PATH='${Sub} >>/home/mtadm/.profile
- echo 'export PATH' >>/home/mtadm/.profile
+ echo 'PATH='${Sub} >>$D/${home}/.profile
+ echo 'export PATH' >>$D/${home}/.profile
fi
}