#!/bin/sh # postinst script for qemu-block-extra # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installsystemd/13.14.1ubuntu5 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'run-qemu.mount' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'run-qemu.mount'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'run-qemu.mount' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'run-qemu.mount' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.14.1ubuntu5 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true deb-systemd-invoke start 'run-qemu.mount' >/dev/null || true fi fi # End automatically added section # dh_installsystemd will not fully enable or start .mount units, but we want # this to be ready after install. We want to avoid forcing users to fail once # only to realize they need to activate anything. if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then # enabling on install will not work through deb-systemd-helper # It will do all the rest like d-s-h state files and such, but # not enable (= symlink) it. Therefore on new install or # upgrade from a former version enable it once. if dpkg --compare-versions "$2" lt "1:6.0+dfsg-1~ubuntu1~"; then systemctl enable 'run-qemu.mount' >/dev/null || true fi fi # start it on configure if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true deb-systemd-invoke start 'run-qemu.mount' >/dev/null || true fi fi exit 0