Debian Codegraph @

debian/libsystemd-shared.preinst

raw
1 #!/bin/sh
2 set -e
3
4 check_unified_cgroup_v2_hierarchy() {
5 for line in $(awk '/cgroup2/{print $2 "," $3}' /proc/mounts); do
6 if [ "$line" = "/sys/fs/cgroup,cgroup2" ]; then
7 return 0
8 fi
9 done
10
11 return 1
12 }
13
14 if [ "$1" = install ] || [ "$1" = upgrade ]; then
15 if [ -z "$DPKG_ROOT"] && [ -d /run/systemd/system ] && dpkg --compare-versions "$2" lt-nl "258~rc1-1~"; then
16 if ! check_unified_cgroup_v2_hierarchy; then
17 cat <<EOF 1>&2
18 ******************************************************************************
19 *
20 * The systemd package cannot be upgraded to version $3, because this
21 * system is not running a unified cgroupv2 hierarchy, which is required
22 * since systemd v258.
23 *
24 * Please reboot using a unified cgroupv2 hierarchy, and then try again.
25 *
26 ******************************************************************************
27 EOF
28 exit 1
29 fi
30 fi
31 fi
32
33 #DEBHELPER#