summaryrefslogtreecommitdiff
path: root/scripts/build/chroot_upstart
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2013-05-06 14:48:46 +0200
committerDaniel Baumann <mail@daniel-baumann.ch>2013-05-06 14:48:46 +0200
commitd1047e809a90daa0e88329efc0db21931be0b919 (patch)
tree5dc92aaaeb4d15dcad4796935b90a9675be93ad5 /scripts/build/chroot_upstart
parent160d6bade79bf58a1c0d1842dc9b55ec178ec303 (diff)
downloadvyos-live-build-d1047e809a90daa0e88329efc0db21931be0b919.tar.gz
vyos-live-build-d1047e809a90daa0e88329efc0db21931be0b919.zip
Adding debian version 4.0~a1-1.debian/4.0_a1-1
Diffstat (limited to 'scripts/build/chroot_upstart')
-rwxr-xr-xscripts/build/chroot_upstart27
1 files changed, 15 insertions, 12 deletions
diff --git a/scripts/build/chroot_upstart b/scripts/build/chroot_upstart
index 377a239a8..fd7c72f75 100755
--- a/scripts/build/chroot_upstart
+++ b/scripts/build/chroot_upstart
@@ -1,7 +1,7 @@
#!/bin/sh
## live-build(7) - System Build Scripts
-## Copyright (C) 2006-2013 Daniel Baumann <daniel@debian.org>
+## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
@@ -27,12 +27,6 @@ Set_defaults
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
-# Check if system uses upstart
-if [ ! -e chroot/sbin/initctl ]
-then
- exit 0
-fi
-
case "${1}" in
install)
Echo_message "Configuring file /sbin/initctl"
@@ -46,9 +40,13 @@ case "${1}" in
# Creating lock file
Create_lockfile .lock
- # Create custom initctl file
- Chroot chroot dpkg-divert --rename --quiet --add /sbin/initctl
+ if [ -f chroot/sbin/initctl ]
+ then
+ # Save initctl file
+ mv chroot/sbin/initctl chroot/sbin/initctl.orig
+ fi
+ # Create initctl file
cat > chroot/sbin/initctl << EOF
#!/bin/sh
echo "All runlevel operations denied by policy" >&2
@@ -70,9 +68,14 @@ EOF
# Creating lock file
Create_lockfile .lock
- # Remove custom initctl file
- rm -f chroot/sbin/initctl
- Chroot chroot dpkg-divert --rename --quiet --remove /sbin/initctl
+ if [ -f chroot/sbin/initctl.orig ]
+ then
+ # Restore initctl file
+ mv chroot/sbin/initctl.orig chroot/sbin/initctl
+ else
+ # Remove initctl file
+ rm -f chroot/sbin/initctl
+ fi
# Removing stage file
rm -f .build/chroot_upstart