diff options
author | Richard Purdie <richard@openedhand.com> | 2007-11-05 16:08:56 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-11-05 16:08:56 +0000 |
commit | 87c422828e1b8d2256e73924e8509e28708d8731 (patch) | |
tree | 64602b20a9c06c3afe1e4290ce55458fc678c142 | |
parent | 139d1570605aeef3238a173ca90d81bb791d6b8a (diff) | |
download | poky-87c422828e1b8d2256e73924e8509e28708d8731.tar.gz |
Add run-postinsts. This runs any remaining postinstall scripts without needing ipkg/dpkg. Currently ipkg specific but this should be easy to change
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3069 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rwxr-xr-x | meta/packages/meta/run-postinsts/run-postinsts | 26 | ||||
-rw-r--r-- | meta/packages/meta/run-postinsts/run-postinsts.awk | 25 | ||||
-rw-r--r-- | meta/packages/meta/run-postinsts_1.0.bb | 30 |
3 files changed, 81 insertions, 0 deletions
diff --git a/meta/packages/meta/run-postinsts/run-postinsts b/meta/packages/meta/run-postinsts/run-postinsts new file mode 100755 index 0000000000..334a39b78b --- /dev/null +++ b/meta/packages/meta/run-postinsts/run-postinsts | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Copyright 2007 Openedhand Ltd. | ||
4 | # | ||
5 | # Author: Richard Purdie <rpurdie@openedhand.com> | ||
6 | # | ||
7 | |||
8 | PKGSYSTEM=/usr/lib/ipkg | ||
9 | STAMP=$PKGSYSTEM/postinsts-done | ||
10 | STATFILE=$PKGSYSTEM/status | ||
11 | STATFILE2=$PKGSYSTEM/status2 | ||
12 | |||
13 | if [ -e $STAMP ]; then | ||
14 | exit 0 | ||
15 | fi | ||
16 | |||
17 | awk -f /usr/share/run-postinsts/run-postinsts.awk $STATFILE > $STATFILE2 | ||
18 | if [ $? = 0 ]; then | ||
19 | mv $STATFILE2 $STATFILE | ||
20 | touch $STAMP | ||
21 | exit 0 | ||
22 | else | ||
23 | rm -f $STATFILE2 | ||
24 | rm -f $STAMP | ||
25 | exit 1 | ||
26 | fi | ||
diff --git a/meta/packages/meta/run-postinsts/run-postinsts.awk b/meta/packages/meta/run-postinsts/run-postinsts.awk new file mode 100644 index 0000000000..1532577b6e --- /dev/null +++ b/meta/packages/meta/run-postinsts/run-postinsts.awk | |||
@@ -0,0 +1,25 @@ | |||
1 | # | ||
2 | # Copyright 2007 Openedhand Ltd. | ||
3 | # | ||
4 | # Author: Richard Purdie <rpurdie@openedhand.com> | ||
5 | # | ||
6 | # Rather hacky proof of concept | ||
7 | # | ||
8 | |||
9 | BEGIN { | ||
10 | package="" | ||
11 | } | ||
12 | /Package:.*/ { | ||
13 | package = substr($0, 10) | ||
14 | } | ||
15 | /Status:.*unpacked.*/ { | ||
16 | print "Configuring: " package > "/dev/stderr" | ||
17 | ret = system("/usr/lib/ipkg/info/" package ".postinst 1>&2") | ||
18 | if (ret == 0) | ||
19 | $0 = gensub("unpacked", "installed", 1) | ||
20 | else | ||
21 | print "Postinstall failed for " package > "/dev/stderr" | ||
22 | } | ||
23 | { | ||
24 | print $0 | ||
25 | } | ||
diff --git a/meta/packages/meta/run-postinsts_1.0.bb b/meta/packages/meta/run-postinsts_1.0.bb new file mode 100644 index 0000000000..b095adc909 --- /dev/null +++ b/meta/packages/meta/run-postinsts_1.0.bb | |||
@@ -0,0 +1,30 @@ | |||
1 | DESCRIPTION = "Run postinstall scripts on device using awk" | ||
2 | SECTION = "devel" | ||
3 | PR = "r0" | ||
4 | |||
5 | SRC_URI = "file://run-postinsts file://run-postinsts.awk" | ||
6 | |||
7 | INITSCRIPT_NAME = "run-postinsts" | ||
8 | INITSCRIPT_PARAMS = "start 98 S ." | ||
9 | |||
10 | inherit update-rc.d | ||
11 | |||
12 | do_configure() { | ||
13 | : | ||
14 | } | ||
15 | |||
16 | do_compile () { | ||
17 | : | ||
18 | } | ||
19 | |||
20 | do_install() { | ||
21 | install -d ${D}${sysconfdir}/init.d/ | ||
22 | install -m 0755 ${WORKDIR}/run-postinsts ${D}${sysconfdir}/init.d/ | ||
23 | |||
24 | install -d ${D}${datadir}/${PN}/ | ||
25 | install -m 0644 ${WORKDIR}/run-postinsts.awk ${D}${datadir}/${PN}/ | ||
26 | } | ||
27 | |||
28 | do_stage () { | ||
29 | : | ||
30 | } | ||