File: 99-dib-init-system

package info (click to toggle)
python-diskimage-builder 3.37.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,572 kB
  • sloc: sh: 7,380; python: 6,444; makefile: 37
file content (30 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# This runs last in the environment to ensure DIB_INIT_SYSTEM is set.
# We expect the base environments to set this variable particular to
# their platform.  Note we used to try and guess this automatically
# inside the chroot, but there's a chicken-and-egg issue when you're
# building from scratch and you're guessing before you've even
# installed the init system.
#

if [ -z "${DIB_INIT_SYSTEM:-}" ]; then
    echo "DIB_INIT_SYSTEM is not set! Can not continue"
    exit 1
fi

# whitelist known systems
case $DIB_INIT_SYSTEM in
    upstart)  ;;
    openrc)   ;;
    systemd)  ;;
    sysv)     ;;
    *)
        echo "Unrecognised init system: ${DIB_INIT_SYSTEM}!"
        echo "Can not continue"
        exit 1
esac

# Tell emacs to use shell-mode
# Local variables:
# mode: sh
# End: