Files
linux-provisioning/stages/11-tweaks.sh
Julian Prester 5a44aaecb0 Fix Fedora DNF5 compatibility and distro-specific packages
Key changes:
- lib/distro.sh: replace REPO_ADD_RPM variable with repo_add_rpm()
  function (DNF5 changed 'config-manager --add-repo' to
  'config-manager addrepo --from-repofile=')
- 01-repos.sh: use repo_add_rpm function; add Ghostty COPR for
  Fedora; remove Signal RPM repo (no official one — use Flatpak)
- 02-packages.sh: lowercase 'development-tools' group for DNF5;
  add python3-devel (needed for native extensions like evdev);
  swap ffmpeg-free → ffmpeg via RPM Fusion for full codec support;
  use tuned (preinstalled on Fedora) instead of TLP
- 11-tweaks.sh: conditional power management — TLP on Debian,
  tuned on Fedora
2026-06-07 14:34:12 +10:00

46 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# ===========================================================================
# Stage 11: System Tweaks
# sysctl tuning, kernel cmdline parameters, TLP/powertop, modprobe.
# Uses distro-agnostic variables from lib/distro.sh.
# ===========================================================================
# CAUTION: GPU kernel parameters are hardware-specific (AMD Radeon 680M).
# They are COMMENTED OUT by default. Uncomment only if you have the same GPU.
# ===========================================================================
CONFIG_DIR="${SCRIPT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}/config"
# ===========================================================================
# 1. TLP / PowerTOP
# ===========================================================================
info "Configuring power management..."
# Enable TLP on Debian, tuned (already enabled) on Fedora
if [ "$DISTRO_FAMILY" = "debian" ]; then
$SERVICE_ENABLE tlp 2>/dev/null && ok "TLP enabled." || warn "TLP not available."
else
# tuned is already enabled from stage 02
if systemctl is-active tuned &>/dev/null; then
ok "tuned is running (enabled in stage 02)"
fi
fi
if command -v powertop &>/dev/null; then
# Enable powertop auto-tune via systemd service
if [ ! -f /etc/systemd/system/powertop.service ]; then
sudo tee /etc/systemd/system/powertop.service > /dev/null << 'EOF'
[Unit]
Description=PowerTOP auto tune
[Service]
Type=oneshot
ExecStart=/usr/sbin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
fi
$SERVICE_ENABLE powertop 2>/dev/null && ok "PowerTOP auto-tune enabled." || true
fi
ok "Stage 11 complete: system tweaks applied."