summaryrefslogtreecommitdiffstats
path: root/meta-selftest/recipes-test
diff options
context:
space:
mode:
Diffstat (limited to 'meta-selftest/recipes-test')
-rw-r--r--meta-selftest/recipes-test/postinst/postinst_1.0.bb124
1 files changed, 124 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
new file mode 100644
index 0000000000..97a1987305
--- /dev/null
+++ b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -0,0 +1,124 @@
1LICENSE = "MIT"
2ALLOW_EMPTY_${PN}-at-rootfs = "1"
3ALLOW_EMPTY_${PN}-delayed-a = "1"
4ALLOW_EMPTY_${PN}-delayed-b = "1"
5ALLOW_EMPTY_${PN}-delayed-d = "1"
6ALLOW_EMPTY_${PN}-delayed-p = "1"
7ALLOW_EMPTY_${PN}-delayed-t = "1"
8
9PACKAGES += "${PN}-at-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-delayed-d ${PN}-delayed-p ${PN}-delayed-t"
10PROVIDES += "${PN}-at-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-delayed-d ${PN}-delayed-p ${PN}-delayed-t"
11FILES_${PN}-delayed-a = ""
12FILES_${PN}-delayed-b = ""
13FILES_${PN}-delayed-d = ""
14FILES_${PN}-delayed-p = ""
15FILES_${PN}-delayed-t = ""
16
17# Runtime dependencies
18RDEPENDS_${PN}-delayed-a = "${PN}-at-rootfs"
19RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a"
20RDEPENDS_${PN}-delayed-d = "${PN}-delayed-b"
21RDEPENDS_${PN}-delayed-p = "${PN}-delayed-d"
22RDEPENDS_${PN}-delayed-t = "${PN}-delayed-p"
23
24# Main recipe post-install
25pkg_postinst_${PN}-at-rootfs () {
26 tfile="/etc/postinsta-test"
27 if test "x$D" != "x" then
28 # Need to run on first boot
29 exit 1
30 else
31 echo "lets write postinst" > $tfile
32 fi
33}
34
35# Dependency recipes post-installs
36pkg_postinst_${PN}-delayed-a () {
37 efile="/etc/postinst-test"
38 tfile="/etc/postinsta-test"
39 rdeps="postinst"
40
41 if test "x$D" != "x"; then
42 # Need to run on first boot
43 exit 1
44 else
45 if test -e $efile ; then
46 echo 'success' > $tfile
47 else
48 echo 'fail to install $rdeps first!' >&2
49 exit 1
50 fi
51 fi
52}
53
54pkg_postinst_${PN}-delayed-b () {
55 efile="/etc/postinsta-test"
56 tfile="/etc/postinstb-test"
57 rdeps="postinsta"
58
59 if test "x$D" != "x"; then
60 # Need to run on first boot
61 exit 1
62 else
63 if test -e $efile ; then
64 echo 'success' > $tfile
65 else
66 echo 'fail to install $rdeps first!' >&2
67 exit 1
68 fi
69 fi
70}
71
72pkg_postinst_${PN}-delayed-d () {
73 efile="/etc/postinstb-test"
74 tfile="/etc/postinstd-test"
75 rdeps="postinstb"
76
77 if test "x$D" != "x"; then
78 # Need to run on first boot
79 exit 1
80 else
81 if test -e $efile ; then
82 echo 'success' > $tfile
83 else
84 echo 'fail to install $rdeps first!' >&2
85 exit 1
86 fi
87 fi
88}
89
90pkg_postinst_${PN}-delayed-p () {
91 efile="/etc/postinstd-test"
92 tfile="/etc/postinstp-test"
93 rdeps="postinstd"
94
95 if test "x$D" != "x"; then
96 # Need to run on first boot
97 exit 1
98 else
99 if test -e $efile ; then
100 echo 'success' > $tfile
101 else
102 echo 'fail to install $rdeps first!' >&2
103 exit 1
104 fi
105 fi
106}
107
108pkg_postinst_${PN}-delayed-t () {
109 efile="/etc/postinstp-test"
110 tfile="/etc/postinstt-test"
111 rdeps="postinstp"
112
113 if test "x$D" != "x"; then
114 # Need to run on first boot
115 exit 1
116 else
117 if test -e $efile ; then
118 echo 'success' > $tfile
119 else
120 echo 'fail to install $rdeps first!' >&2
121 exit 1
122 fi
123 fi
124}