ci-test-sample/debian/patches/upstart-not-in-bootstrap

43 lines
1.1 KiB
Plaintext

From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Date: Tue, 18 Jul 2017 17:21:09 +0800
Subject: upstart-not-in-bootstrap
---
scripts/build/lb_chroot_upstart | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/scripts/build/lb_chroot_upstart b/scripts/build/lb_chroot_upstart
index 10b8899..8b7c1c4 100755
--- a/scripts/build/lb_chroot_upstart
+++ b/scripts/build/lb_chroot_upstart
@@ -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"
@@ -49,6 +43,8 @@ case "${1}" in
# Create custom initctl file
Chroot chroot dpkg-divert --rename --quiet --add /sbin/initctl
+ # Only create stub if we actually diverted something
+ if [ -e chroot/sbin/initctl.distrib ]; then
cat > chroot/sbin/initctl << EOF
#!/bin/sh
echo "All runlevel operations denied by policy" >&2
@@ -56,6 +52,7 @@ exit 101
EOF
chmod 0755 chroot/sbin/initctl
+ fi
# Creating stage file
Create_stagefile .build/chroot_upstart