source: live-build/trunk/fuentes/debian/patches/dpkg-divert-initctl @ 900

Last change on this file since 900 was 900, checked in by kbut, 4 years ago

add original source

File size: 1.5 KB
Line 
1commit 20f042f923d25772cb87515a184308e2d2dec084
2Author: Daniel Baumann <mail@daniel-baumann.ch>
3Date:   Mon Mar 11 09:26:37 2013 +0100
4
5    Using dpkg-divert in chroot_upstart script to handle upgrades of upstart during the build (Closes: #702537).
6
7diff --git a/scripts/build/chroot_upstart b/scripts/build/chroot_upstart
8index 47d68c2..88dc3b2 100755
9--- a/scripts/build/lb_chroot_upstart
10+++ b/scripts/build/lb_chroot_upstart
11@@ -27,6 +27,12 @@ Set_defaults
12 # Requiring stage file
13 Require_stagefile .build/config .build/bootstrap
14 
15+# Check if system uses upstart
16+if [ ! -e chroot/sbin/initctl ]
17+then
18+       exit 0
19+fi
20+
21 case "${1}" in
22        install)
23                Echo_message "Configuring file /sbin/initctl"
24@@ -40,13 +46,9 @@ case "${1}" in
25                # Creating lock file
26                Create_lockfile .lock
27 
28-               if [ -f chroot/sbin/initctl ]
29-               then
30-                       # Save initctl file
31-                       mv chroot/sbin/initctl chroot/sbin/initctl.orig
32-               fi
33+               # Create custom initctl file
34+               Chroot chroot dpkg-divert --rename --quiet --add /sbin/initctl
35 
36-               # Create initctl file
37 cat > chroot/sbin/initctl << EOF
38 #!/bin/sh
39 echo "All runlevel operations denied by policy" >&2
40@@ -68,14 +70,9 @@ EOF
41                # Creating lock file
42                Create_lockfile .lock
43 
44-               if [ -f chroot/sbin/initctl.orig ]
45-               then
46-                       # Restore initctl file
47-                       mv chroot/sbin/initctl.orig chroot/sbin/initctl
48-               else
49-                       # Remove initctl file
50-                       rm -f chroot/sbin/initctl
51-               fi
52+               # Remove custom initctl file
53+               rm -f chroot/sbin/initctl
54+               Chroot chroot dpkg-divert --rename --quiet --remove /sbin/initctl
55 
56                # Removing stage file
57                rm -f .build/chroot_upstart
Note: See TracBrowser for help on using the repository browser.