Merge lp:~stgraber/ubuntu/saucy/lxc-android-config/boot-hooks into lp:ubuntu/saucy/lxc-android-config

Proposed by Stéphane Graber
Status: Merged
Approved by: Steve Langasek
Approved revision: 104
Merged at revision: 105
Proposed branch: lp:~stgraber/ubuntu/saucy/lxc-android-config/boot-hooks
Merge into: lp:ubuntu/saucy/lxc-android-config
Diff against target: 49 lines (+36/-0)
2 files modified
debian/changelog (+6/-0)
etc/init/boot-hooks-emit.conf (+30/-0)
To merge this branch: bzr merge lp:~stgraber/ubuntu/saucy/lxc-android-config/boot-hooks
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+188172@code.launchpad.net

Description of the change

Add the boot-hooks (LP: #1215092)

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

LGTM.

review: Approve
Revision history for this message
Loïc Minier (lool) wrote :

Is there something we should block on the hooks finishing? Like the unity8 session?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-09-25 15:42:51 +0000
3+++ debian/changelog 2013-09-27 21:27:03 +0000
4@@ -1,3 +1,9 @@
5+lxc-android-config (0.104) UNRELEASED; urgency=low
6+
7+ * Add basic boot-hooks infrastructure (LP: #1215092)
8+
9+ -- Stéphane Graber <stgraber@ubuntu.com> Fri, 27 Sep 2013 16:57:39 -0400
10+
11 lxc-android-config (0.103) saucy; urgency=low
12
13 * Fix some issues with the upstart job so that it gets into the right
14
15=== added directory 'etc/init/boot-hooks'
16=== added file 'etc/init/boot-hooks-emit.conf'
17--- etc/init/boot-hooks-emit.conf 1970-01-01 00:00:00 +0000
18+++ etc/init/boot-hooks-emit.conf 2013-09-27 21:27:03 +0000
19@@ -0,0 +1,30 @@
20+# boot-hooks-emit - Triggers boot hooks
21+# This job is used to trigger a variety of hooks at boot time on Touch devices
22+
23+# It does that through the "boot-hooks" event and the WHEN variable.
24+# That variable can be "every-boot" or "new-version".
25+# In the latter case, it's accompanied by two other variables,
26+# OLD_BUILD and NEW_BUILD each containing a build ID.
27+
28+author "Stéphane Graber <stgraber@ubuntu.com>"
29+description "Triggers boot hooks"
30+
31+start on local-filesystems
32+
33+emits boot-hooks
34+
35+script
36+ initctl emit boot-hooks WHEN=every-boot
37+
38+ if [ -e /etc/ubuntu-build ]; then
39+ last_buildid=0
40+ [ -e /userdata/.last_ubuntu-build ] && last_buildid=$(cat /userdata/.last_ubuntu-build)
41+
42+ current_buildid=$(cat /etc/ubuntu-build)
43+
44+ if [ "$last_buildid" != "$current_buildid" ]; then
45+ cp /etc/ubuntu-build /userdata/.last_ubuntu-build || true
46+ initctl emit boot-hooks WHEN=new-version OLD_BUILD=$last_buildid NEW_BUILD=$current_buildid
47+ fi
48+ fi
49+end script

Subscribers

People subscribed via source and target branches