#!/bin/bash

## Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
shopt -s inherit_errexit
shopt -s shift_verbose

# shellcheck source=../../../../helper-scripts/usr/libexec/helper-scripts/has.sh
## Sibling repo: absent in an isolated CI checkout, so shellcheck cannot
## follow it there. The source= path above still documents where it lives.
##
## TODO: Can we only run shellcheck when there is a full derivative-maker
## checkout?
# shellcheck disable=SC1091
source /usr/libexec/helper-scripts/has.sh

export LC_ALL='C'

## Package 'pciutils' provides tool 'lspci'.
has lspci

if lspci | grep --quiet '^[^ ]* USB controller: '; then
  exit 0
fi

exit 1
