feat(profile): add hwclock.
This commit is contained in:
parent
cba7355142
commit
e490a11c1a
3 changed files with 35 additions and 4 deletions
30
apparmor.d/groups/utils/hwclock
Normal file
30
apparmor.d/groups/utils/hwclock
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2025 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = @{sbin}/hwclock
|
||||
profile hwclock @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
|
||||
capability audit_write,
|
||||
capability sys_time,
|
||||
|
||||
network netlink raw,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/etc/adjtime rw,
|
||||
|
||||
@{sys}/devices/pnp@{int}/*/rtc/rtc@{int}/{,*} r,
|
||||
|
||||
/dev/rtc@{int} r,
|
||||
|
||||
include if exists <local/hwclock>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
|
|
@ -6,14 +6,14 @@
|
|||
load ../common
|
||||
|
||||
@test "hwclock: Display the current time as reported by the hardware clock" {
|
||||
hwclock
|
||||
sudo hwclock
|
||||
}
|
||||
|
||||
@test "hwclock: Write the current software clock time to the hardware clock (sometimes used during system setup)" {
|
||||
hwclock --systohc
|
||||
sudo hwclock --systohc
|
||||
}
|
||||
|
||||
@test "hwclock: Write the current hardware clock time to the software clock" {
|
||||
hwclock --hctosys
|
||||
sudo hwclock --hctosys
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ debian | ubuntu | whonix)
|
|||
sudo apt update -y
|
||||
sudo apt install -y \
|
||||
bats bats-support \
|
||||
cpuid dfc systemd-userdbd systemd-homed tlp network-manager flatpak
|
||||
cpuid dfc systemd-userdbd systemd-homed tlp network-manager flatpak \
|
||||
util-linux-extra
|
||||
;;
|
||||
opensuse*)
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue