aboutsummaryrefslogtreecommitdiffstats
path: root/meta-app-framework/recipes-config/agl-users/agl-users_0.1.bb
blob: 0f61248db0cb1f8cab6275c733450fb390b49139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
inherit allarch useradd

SUMMARY = "AGL Users Seed"
DESCRIPTION = "This is a core framework component that\
 defines how users are managed and who are the default users."

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"


SRC_URI = ""


RDEPENDS_${PN}_append_smack = " smack-userspace"
DEPENDS_append_smack = " smack-userspace-native"

ALLOW_EMPTY_${PN} = "1"

USERADD_PACKAGES = "${PN}"

USERADD_PARAM_${PN} = "\
  -g users -d /home/agl-driver -m -K PASS_MAX_DAYS=-1 agl-driver ; \
  -g users -d /home/agl-passenger -m -K PASS_MAX_DAYS=-1 agl-passenger \
"


do_configure() {
    :
}

do_compile() {
    :
}

do_install() {
    :
}


pkg_postinst_${PN}() {
    #!/bin/sh -e

    # avoid to run on host
    [ x"$D" != "x" ] && exit 1

    # Drops password
    passwd -d agl-driver
    passwd -d agl-passenger
}
           
pkg_postinst_${PN}_smack() {
    #!/bin/sh -e

    # avoid to run on host
    [ x"$D" != "x" ] && exit 1

    # Actions to carry out on the device go here
    for x in /etc/skel /home/*
    do
        chsmack -a User::Home $x
    done
    passwd -d agl-driver
    passwd -d agl-passenger
}