diff options
Diffstat (limited to 'meta/recipes-core/base-passwd')
4 files changed, 159 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd-3.5.26/add_shutdown.patch b/meta/recipes-core/base-passwd/base-passwd-3.5.26/add_shutdown.patch new file mode 100644 index 0000000000..eb75559c49 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd-3.5.26/add_shutdown.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | |||
2 | We need to have a shutdown group to allow the shutdown icon | ||
3 | to work correctly. Any users that want to use shutdown like | ||
4 | the xuser should be added to this group. | ||
5 | |||
6 | Upstream-Status: Inapporpriate [Embedded] | ||
7 | |||
8 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
9 | Index: base-passwd-3.5.26/group.master | ||
10 | =================================================================== | ||
11 | --- base-passwd-3.5.26.orig/group.master | ||
12 | +++ base-passwd-3.5.26/group.master | ||
13 | @@ -36,5 +36,6 @@ sasl:*:45: | ||
14 | plugdev:*:46: | ||
15 | staff:*:50: | ||
16 | games:*:60: | ||
17 | +shutdown:*:70: | ||
18 | users:*:100: | ||
19 | nogroup:*:65534: | ||
diff --git a/meta/recipes-core/base-passwd/base-passwd-3.5.26/input.patch b/meta/recipes-core/base-passwd/base-passwd-3.5.26/input.patch new file mode 100644 index 0000000000..f1bfc2f604 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd-3.5.26/input.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | Add an input group for the /dev/input/* devices. | ||
2 | |||
3 | Upstream-Status: Invalid [configuration] | ||
4 | |||
5 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
6 | |||
7 | --- | ||
8 | group.master | 1 + | ||
9 | 1 file changed, 1 insertion(+) | ||
10 | |||
11 | Index: base-passwd-3.5.26/group.master | ||
12 | =================================================================== | ||
13 | --- base-passwd-3.5.26.orig/group.master | ||
14 | +++ base-passwd-3.5.26/group.master | ||
15 | @@ -12,6 +12,7 @@ uucp:*:10: | ||
16 | man:*:12: | ||
17 | proxy:*:13: | ||
18 | kmem:*:15: | ||
19 | +input:*:19: | ||
20 | dialout:*:20: | ||
21 | fax:*:21: | ||
22 | voice:*:22: | ||
diff --git a/meta/recipes-core/base-passwd/base-passwd-3.5.26/nobash.patch b/meta/recipes-core/base-passwd/base-passwd-3.5.26/nobash.patch new file mode 100644 index 0000000000..6371576440 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd-3.5.26/nobash.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | use /bin/sh instead of /bin/bash, since the latter may not be included in | ||
2 | some images such as minimal | ||
3 | |||
4 | comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06 | ||
5 | |||
6 | remove "*" for root since we don't have a /etc/shadow so far. | ||
7 | |||
8 | by Kevin Tian <kevin.tian@intel.com>, 2010-07-06 | ||
9 | |||
10 | Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher | ||
11 | |||
12 | Upstream-Status: Invalid [configuration] | ||
13 | |||
14 | Signed-off-by: Scott Garman <scott.a.garman@intel.com> | ||
15 | |||
16 | --- base-passwd/passwd.master~nobash | ||
17 | +++ base-passwd/passwd.master | ||
18 | @@ -1,4 +1,4 @@ | ||
19 | -root:*:0:0:root:/root:/bin/bash | ||
20 | +root::0:0:root:/root:/bin/sh | ||
21 | daemon:*:1:1:daemon:/usr/sbin:/bin/sh | ||
22 | bin:*:2:2:bin:/bin:/bin/sh | ||
23 | sys:*:3:3:sys:/dev:/bin/sh | ||
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.26.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.26.bb new file mode 100644 index 0000000000..4d94dcca65 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd_3.5.26.bb | |||
@@ -0,0 +1,95 @@ | |||
1 | SUMMARY = "Base system master password/group files." | ||
2 | DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files." | ||
3 | SECTION = "base" | ||
4 | PR = "r2" | ||
5 | LICENSE = "GPLv2+" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" | ||
7 | |||
8 | SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \ | ||
9 | file://add_shutdown.patch \ | ||
10 | file://nobash.patch \ | ||
11 | file://input.patch" | ||
12 | |||
13 | SRC_URI[md5sum] = "74245e5c21dc74d9675c77cd8dfa02e6" | ||
14 | SRC_URI[sha256sum] = "258a78317aa563143d10375c6e1e63a60898e503887f00fffd70b6b297c1b429" | ||
15 | |||
16 | inherit autotools | ||
17 | |||
18 | SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst" | ||
19 | |||
20 | do_install () { | ||
21 | install -d -m 755 ${D}${sbindir} | ||
22 | install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/ | ||
23 | install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8 | ||
24 | install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/ | ||
25 | install -p -m 644 ${S}/man/update-passwd.pl.8 \ | ||
26 | ${D}${mandir}/pl/man8/update-passwd.8 | ||
27 | gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/* | ||
28 | install -d -m 755 ${D}${datadir}/base-passwd | ||
29 | sed -i 's#:/root:#:${ROOT_HOME}:#' ${S}/passwd.master | ||
30 | install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/ | ||
31 | install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/ | ||
32 | |||
33 | install -d -m 755 ${D}${docdir}/${BPN} | ||
34 | install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/ | ||
35 | gzip -9 ${D}${docdir}/${BPN}/* | ||
36 | install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/ | ||
37 | install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/ | ||
38 | } | ||
39 | |||
40 | base_passwd_sstate_postinst() { | ||
41 | if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] | ||
42 | then | ||
43 | # Staging does not copy ${sysconfdir} files into the | ||
44 | # target sysroot, so we need to do so manually. We | ||
45 | # put these files in the target sysroot so they can | ||
46 | # be used by recipes which use custom user/group | ||
47 | # permissions. | ||
48 | install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir} | ||
49 | install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd | ||
50 | install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group | ||
51 | fi | ||
52 | } | ||
53 | |||
54 | python populate_packages_prepend() { | ||
55 | # Add in the preinst function for ${PN} | ||
56 | # We have to do this here as prior to this, passwd/group.master | ||
57 | # would be unavailable. We need to create these files at preinst | ||
58 | # time before the files from the package may be available, hence | ||
59 | # storing the data from the files in the preinst directly. | ||
60 | |||
61 | f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r') | ||
62 | passwd = "".join(f.readlines()) | ||
63 | f.close() | ||
64 | f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r') | ||
65 | group = "".join(f.readlines()) | ||
66 | f.close() | ||
67 | |||
68 | preinst = """#!/bin/sh | ||
69 | mkdir -p $D${sysconfdir} | ||
70 | if [ ! -e $D${sysconfdir}/passwd ]; then | ||
71 | \tcat << EOF > $D${sysconfdir}/passwd | ||
72 | """ + passwd + """EOF | ||
73 | fi | ||
74 | if [ ! -e $D${sysconfdir}/group ]; then | ||
75 | \tcat << EOF > $D${sysconfdir}/group | ||
76 | """ + group + """EOF | ||
77 | fi | ||
78 | """ | ||
79 | d.setVar('pkg_preinst_${PN}', preinst) | ||
80 | } | ||
81 | |||
82 | addtask do_package after do_populate_sysroot | ||
83 | |||
84 | ALLOW_EMPTY_${PN} = "1" | ||
85 | |||
86 | PACKAGES =+ "${PN}-update" | ||
87 | FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}" | ||
88 | |||
89 | pkg_postinst_${PN}-update () { | ||
90 | #!/bin/sh | ||
91 | if [ -n "$D" ]; then | ||
92 | exit 0 | ||
93 | fi | ||
94 | ${sbindir}/update-passwd | ||
95 | } | ||