feat(profile): add hwclock.

This commit is contained in:
Alexandre Pujol 2025-07-20 14:25:41 +02:00
parent cba7355142
commit e490a11c1a
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
3 changed files with 35 additions and 4 deletions

View 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

View file

@ -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
}

View file

@ -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*)
;;