summaryrefslogtreecommitdiffstats
path: root/meta-perl
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2015-01-12 11:25:28 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2015-01-15 16:37:56 +0100
commit2fbc57e10562a809e20a7be93c76d9f08a88ea5f (patch)
tree1fa094dbcd71dc74f94b88ded8d939d56e531fe4 /meta-perl
parent8c17bb27c5b1ca72fc28457ff8b056c8fbdcc6f7 (diff)
downloadmeta-openembedded-2fbc57e10562a809e20a7be93c76d9f08a88ea5f.tar.gz
adduser: add new recipe
This is a utility from debain to add users/groups to the system, which is actually a perl wrapper of the useradd/groupadd command. We want this to replace the same commands provided by busybox. Homepage: https://alioth.debian.org/projects/adduser Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-perl')
-rw-r--r--meta-perl/recipes-perl/adduser/adduser_3.113+nmu3.bb53
-rw-r--r--meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch57
2 files changed, 110 insertions, 0 deletions
diff --git a/meta-perl/recipes-perl/adduser/adduser_3.113+nmu3.bb b/meta-perl/recipes-perl/adduser/adduser_3.113+nmu3.bb
new file mode 100644
index 000000000..969a739d4
--- /dev/null
+++ b/meta-perl/recipes-perl/adduser/adduser_3.113+nmu3.bb
@@ -0,0 +1,53 @@
1SUMMARY = "a utility to add users/groups to the system"
2DESCRIPTION = "adduser, addgroup - add a user or group to the system"
3HOMEPAGE = "http://alioth.debian.org/projects/adduser/"
4SECTION = "base/utils"
5
6LICENSE = "GPLv2"
7LIC_FILES_CHKSUM = "file://debian/copyright;md5=caed49ab166f22ef31bf1127f558d0ef"
8
9SRC_URI = "http://ftp.de.debian.org/debian/pool/main/a/${BPN}/${BPN}_${PV}.tar.gz \
10 file://adduser-add-M-option-for-useradd-when-no-create-home.patch \
11"
12
13SRC_URI[md5sum] = "ccb5864bde56683182c89c44474e7182"
14SRC_URI[sha256sum] = "02682be3f51f3e732121f20a3e4922bb8bef15cfacb8767fc250a01d09502122"
15
16inherit cpan-base update-alternatives
17
18do_install() {
19 install -d ${D}${sbindir}
20 install -m 0755 ${S}/adduser ${D}${sbindir}
21 install -m 0755 ${S}/deluser ${D}${sbindir}
22
23 install -d ${D}${libdir}/perl/${PERLVERSION}/Debian
24 install -m 0644 ${S}/AdduserCommon.pm ${D}${libdir}/perl/${PERLVERSION}/Debian
25 sed -i -e "s/VERSION/${PV}/" ${D}${sbindir}/*
26
27 install -d ${D}/${sysconfdir}
28 install -m 0644 ${S}/*.conf ${D}/${sysconfdir}
29
30 install -d ${D}${mandir}/man5
31 install -m 0644 ${S}/doc/*.conf.5 ${D}${mandir}/man5
32 install -d ${D}${mandir}/man8
33 install -m 0644 ${S}/doc/*.8 ${D}${mandir}/man8
34 install -d ${D}${docdir}/${BPN}
35 cp -rf ${S}/examples ${D}${docdir}/${BPN}
36}
37
38RDEPENDS_${PN} += "\
39 shadow \
40 perl-module-getopt-long \
41 perl-module-overloading \
42 perl-module-file-find \
43 perl-module-file-temp \
44"
45
46ALTERNATIVE_${PN} = "adduser deluser addgroup delgroup"
47ALTERNATIVE_PRIORITY = "60"
48ALTERNATIVE_LINK_NAME[adduser] = "${sbindir}/adduser"
49ALTERNATIVE_LINK_NAME[deluser] = "${sbindir}/deluser"
50ALTERNATIVE_LINK_NAME[addgroup] = "${sbindir}/addgroup"
51ALTERNATIVE_LINK_NAME[delgroup] = "${sbindir}/delgroup"
52ALTERNATIVE_TARGET[addgroup] = "${sbindir}/adduser.${BPN}"
53ALTERNATIVE_TARGET[delgroup] = "${sbindir}/deluser.${BPN}"
diff --git a/meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch b/meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch
new file mode 100644
index 000000000..4b0a03f02
--- /dev/null
+++ b/meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch
@@ -0,0 +1,57 @@
1From 809f00a6ef0224b41b2e1207194c8da3cd3e3c7e Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Thu, 18 Dec 2014 17:23:37 +0800
4Subject: [PATCH] adduser: add -M option for useradd when --no-create-home is specified
5
6The useradd (from package passwd) in debian based system sets -M (--no-create-home) by default,
7but the one we are using (from package shadow) sets -m (--create-home) by default, so we
8need to explicitly add -M option for useradd call when --no-create-home is specified for adduser.
9
10Upstream-Status: Pending
11
12Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
13---
14 adduser | 20 ++++++++++++++++----
15 1 files changed, 16 insertions(+), 4 deletions(-)
16
17diff --git a/adduser b/adduser
18index c3bd8b0..9a07f9f 100755
19--- a/adduser
20+++ b/adduser
21@@ -434,8 +434,14 @@ if ($action eq "addsysuser") {
22 $shell = $special_shell || '/bin/false';
23 $undouser = $new_name;
24 my $useradd = &which('useradd');
25- &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
26- $shell, '-u', $new_uid, $new_name);
27+ if ($no_create_home) {
28+ &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
29+ $shell, '-u', $new_uid, '-M', $new_name);
30+ }
31+ else {
32+ &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
33+ $shell, '-u', $new_uid, $new_name);
34+ }
35 if(!$disabled_login) {
36 my $usermod = &which('usermod');
37 &systemcall($usermod, '-p', '*', $new_name);
38@@ -524,8 +530,14 @@ if ($action eq "adduser") {
39 $shell = $special_shell || $config{"dshell"};
40 $undouser = $new_name;
41 my $useradd = &which('useradd');
42- &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
43- $shell, '-u', $new_uid, $new_name);
44+ if ($no_create_home) {
45+ &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
46+ $shell, '-u', $new_uid, '-M', $new_name);
47+ }
48+ else {
49+ &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
50+ $shell, '-u', $new_uid, $new_name);
51+ }
52 &invalidate_nscd();
53
54 create_homedir (1); # copy skeleton data
55--
561.7.1
57