# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2017-2021 Mikhail Morfikov
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/tpacpi-bat
profile tpacpi-bat @{exec_path} {
  include <abstractions/base>
  include <abstractions/perl>

  @{exec_path} mr,
  @{bin}/perl r,

  @{sh_path}        rix,
  @{bin}/cat        rix,

  # To load the acpi_call module
  @{bin}/kmod rPx,

  @{PROC}/acpi/call rw,

  @{sys}/devices/virtual/dmi/id/product_version r,
  @{sys}/devices/**/path r,

  include if exists <local/tpacpi-bat>
}
