#!/bin/bash

set -e
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

case "$1" in
    configure)
        if [ ! -d /lib/firmware/xilinx ]; then
            mkdir -p /lib/firmware/xilinx
        fi
        if id -u gdm >/dev/null 2>&1; then
            # Grant Xorg permissions
            usermod -a -G video gdm >/dev/null 2>&1
        else
            echo "the user doesn't exist: gdm"
        fi
        systemctl enable oem-usb-rebind-input-devices-after-resume.service
        if ischroot; then
            echo "chroot detected; skipping postinst"
            exit 0
        fi
    ;;
esac

exit 0
