summaryrefslogtreecommitdiff
path: root/recipes-core/useradd/useradd.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/useradd/useradd.bb')
-rw-r--r--recipes-core/useradd/useradd.bb47
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes-core/useradd/useradd.bb b/recipes-core/useradd/useradd.bb
new file mode 100644
index 0000000..0afa3b1
--- /dev/null
+++ b/recipes-core/useradd/useradd.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Add mtadm user"
+DESCRIPTION = "Add mtadm user for security purposes"
+SECTION = "mtadm"
+PR = "r1"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+S = "${WORKDIR}"
+
+inherit useradd
+
+# You must set USERADD_PACKAGES when you inherit useradd. This
+# lists which output packages will include the user/group
+# creation code.
+#USERADD_PACKAGES = "${PN} ${PN}-user3"
+USERADD_PACKAGES = "${PN}"
+
+# You must also set USERADD_PARAM and/or GROUPADD_PARAM when
+# you inherit useradd.
+
+# GROUPADD_PARAM works the same way, which you set to the options
+# you'd normally pass to the groupadd command. This will create
+# groups group1 and group2:
+GROUPADD_PARAM_${PN} = "-r -g 27 sudo"
+
+# USERADD_PARAM specifies command line options to pass to the
+# 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 -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}/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"
+