aboutsummaryrefslogtreecommitdiffstats
path: root/meta-selftest/recipes-test/postinst/postinst_1.0.bb
blob: 403462e7f2cca0383930ee2f4dfed05369db072a (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
LICENSE = "MIT"

ALLOW_EMPTY_${PN} = "1"
ALLOW_EMPTY_${PN}-a = "1"
ALLOW_EMPTY_${PN}-b = "1"
ALLOW_EMPTY_${PN}-d = "1"
ALLOW_EMPTY_${PN}-p = "1"
ALLOW_EMPTY_${PN}-t = "1"

PACKAGES =+ "${PN}-a ${PN}-b ${PN}-d ${PN}-p ${PN}-t"
FILES_${PN}-a = ""
FILES_${PN}-b = ""
FILES_${PN}-d = ""
FILES_${PN}-p = ""
FILES_${PN}-t = ""

# Runtime dependencies
RDEPENDS_${PN}-a = "${PN}"
RDEPENDS_${PN}-b = "${PN}-a"
RDEPENDS_${PN}-d = "${PN}-b"
RDEPENDS_${PN}-p = "${PN}-d"
RDEPENDS_${PN}-t = "${PN}-p"

# Main recipe post-install
pkg_postinst_${PN} () {
    tfile="/etc/postinsta-test"
    if test "x$D" != "x" then
        # Need to run on first boot
        exit 1
    else
        echo "lets write postinst" > $tfile
    fi
}

# Dependency recipes post-installs
pkg_postinst_${PN}-a () {
    efile="/etc/postinst-test"
    tfile="/etc/postinsta-test"
    rdeps="postinst"

    if test "x$D" != "x"; then
      # Need to run on first boot
      exit 1
    else
      if test -e $efile ; then
        echo 'success' > $tfile
      else
        echo 'fail to install $rdeps first!' >&2
        exit 1
      fi
   fi
}

pkg_postinst_${PN}-b () {
    efile="/etc/postinsta-test"
    tfile="/etc/postinstb-test"
    rdeps="postinsta"

    if test "x$D" != "x"; then
      # Need to run on first boot
      exit 1
    else
      if test -e $efile ; then
        echo 'success' > $tfile
      else
        echo 'fail to install $rdeps first!' >&2
        exit 1
      fi
   fi
}

pkg_postinst_${PN}-d () {
    efile="/etc/postinstb-test"
    tfile="/etc/postinstd-test"
    rdeps="postinstb"

    if test "x$D" != "x"; then
      # Need to run on first boot
      exit 1
    else
      if test -e $efile ; then
        echo 'success' > $tfile
      else
        echo 'fail to install $rdeps first!' >&2
        exit 1
      fi
   fi
}

pkg_postinst_${PN}-p () {
    efile="/etc/postinstd-test"
    tfile="/etc/postinstp-test"
    rdeps="postinstd"

    if test "x$D" != "x"; then
      # Need to run on first boot
      exit 1
    else
      if test -e $efile ; then
        echo 'success' > $tfile
      else
        echo 'fail to install $rdeps first!' >&2
        exit 1
      fi
   fi
}

pkg_postinst_${PN}-t () {
    efile="/etc/postinstp-test"
    tfile="/etc/postinstt-test"
    rdeps="postinstp"

    if test "x$D" != "x"; then
      # Need to run on first boot
      exit 1
    else
      if test -e $efile ; then
          echo 'success' > $tfile
      else
          echo 'fail to install $rdeps first!' >&2
          exit 1
      fi
   fi
}