feat: add feature to update cachyOS in the background
This commit is contained in:
53
lib/config.py
Normal file
53
lib/config.py
Normal file
@ -0,0 +1,53 @@
|
||||
from pathlib import Path
|
||||
|
||||
STATE_FILE = Path("/var/lib/cachyos-updater/state.json")
|
||||
LOG_FILE = Path("/var/log/cachyos-updater.log")
|
||||
SOCKET_PATH = Path("/run/cachyos-updater.sock")
|
||||
|
||||
# Paquets nécessitant un redémarrage complet du système
|
||||
PACKAGES_RESTART_REQUIRED = {
|
||||
"linux", "linux-lts", "linux-zen", "linux-hardened",
|
||||
"linux-cachyos", "linux-cachyos-lts", "linux-cachyos-rc",
|
||||
"linux-cachyos-bore", "linux-cachyos-bore-lts",
|
||||
"systemd", "systemd-libs", "systemd-sysvcompat", "systemd-resolvconf",
|
||||
"glibc", "lib32-glibc",
|
||||
"linux-firmware", "linux-firmware-whence",
|
||||
"mkinitcpio", "mkinitcpio-busybox",
|
||||
"grub", "efibootmgr", "refind",
|
||||
"dracut",
|
||||
}
|
||||
|
||||
# Paquets nécessitant le redémarrage de services (aussi reportés à l'extinction)
|
||||
PACKAGES_SERVICE_RESTART = {
|
||||
"pipewire", "pipewire-audio", "pipewire-alsa", "pipewire-jack", "pipewire-pulse",
|
||||
"wireplumber", "pipewire-wireplumber",
|
||||
"networkmanager", "network-manager-applet",
|
||||
"bluez", "bluez-utils", "bluez-libs",
|
||||
"cups", "cups-filters",
|
||||
"avahi",
|
||||
"dbus", "dbus-broker", "dbus-broker-units",
|
||||
"polkit",
|
||||
"udisks2",
|
||||
"upower",
|
||||
"mesa", "lib32-mesa",
|
||||
"vulkan-radeon", "vulkan-intel", "vulkan-nouveau",
|
||||
"lib32-vulkan-radeon", "lib32-vulkan-intel",
|
||||
"wayland",
|
||||
"xorg-server", "xorg-server-common",
|
||||
"gdm", "sddm", "lightdm",
|
||||
"plymouth",
|
||||
}
|
||||
|
||||
# Patterns de noms de paquets nécessitant un redémarrage
|
||||
PACKAGES_RESTART_PATTERNS = [
|
||||
r"^linux-[0-9]",
|
||||
r"^linux-cachyos",
|
||||
r"^linux-headers",
|
||||
r"^nvidia",
|
||||
r"^cuda",
|
||||
r"^amdgpu-pro",
|
||||
r"^rocm-",
|
||||
]
|
||||
|
||||
UPDATE_INTERVAL_SECONDS = 3600 # Vérification toutes les heures
|
||||
FIRST_RUN_DELAY_SECONDS = 0 # Pas de délai : systemd garantit le réseau via network-online.target
|
||||
Reference in New Issue
Block a user