Add files via upload

This commit is contained in:
stornic56
2026-05-07 01:31:06 -05:00
committed by GitHub
parent 364a956488
commit b2e83321e2
3 changed files with 82 additions and 11 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ install_extras() {
"fetch" "System info (${fetch_pkg})" ON \ "fetch" "System info (${fetch_pkg})" ON \
"cpufetch" "CPU info fetcher" ON \ "cpufetch" "CPU info fetcher" ON \
"cpu-x" "CPU-X (GUI alternative to CPU-Z)" ON \ "cpu-x" "CPU-X (GUI alternative to CPU-Z)" ON \
"btop" "Resource monitor (fancy top)" ON \ "btop" "Resource monitor (fancy top)" OFF \
"htop" "Interactive process viewer" ON \ "htop" "Interactive process viewer" ON \
"vlc" "VLC media player" ON \ "vlc" "VLC media player" ON \
"mpv" "Lightweight media player" OFF \ "mpv" "Lightweight media player" OFF \
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# kernel.sh
install_kernel_backports() {
echo -e "${YELLOW}Kernel from Backports${NC}"
# Check if backports are enabled at system level
if [ "$(is_backports_enabled)" != "true" ]; then
echo -e "${YELLOW}Backports repository is not enabled.${NC}"
echo "Use option 2 (Configure repositories) to enable backports first."
return 1
fi
local backports_kernel_ver
backports_kernel_ver=$(get_backports_kernel_version)
echo "This will install the latest stable kernel from backports."
echo " - Newer hardware support"
echo " - Potential performance improvements"
if [ "$backports_kernel_ver" != "unknown" ]; then
echo " - Kernel version available: $backports_kernel_ver"
else
echo " - Kernel version could not be determined at this time"
fi
echo ""
# Extra warning if NVIDIA GPU is detected
if [ "$GPU_TYPE" == "nvidia" ]; then
echo -e "${RED}============================================${NC}"
echo -e "${RED} WARNING: NVIDIA GPU detected${NC}"
echo -e "${RED}============================================${NC}"
echo "Backports kernels (6.19+) can break the NVIDIA 550 driver."
echo "If you installed the NVIDIA driver earlier, this may cause"
echo "display issues or DKMS compilation failures."
echo ""
fi
# Build the whiptail message dynamically
local msg
msg="Do you want to install the latest kernel from backports?\n\n"
if [ "$backports_kernel_ver" != "unknown" ]; then
msg+="Kernel version: $backports_kernel_ver\n\n"
fi
msg+="This replaces the current linux-image-amd64 metapackage.\n"
msg+="You can still boot older kernels from GRUB.\n"
if [ "$GPU_TYPE" == "nvidia" ]; then
msg+="\n WARNING: NVIDIA GPU detected.\n"
msg+="Backports kernels (6.19+) may break the NVIDIA 550 driver.\n"
fi
if ! whiptail --title "Install Kernel from Backports" \
--yesno "$msg" 16 70; then
echo "Skipping kernel installation."
return
fi
echo "Installing kernel from backports..."
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" linux-image-amd64
echo -e "${GREEN}Kernel from backports installed.${NC}"
echo "Please reboot to use the new kernel."
}
+18 -10
View File
@@ -150,16 +150,11 @@ get_intel_generation() {
fi fi
} }
# --------------------------------------------- # ----------------------------------------------------------------------
# Check if backports repository is enabled # Check if backports repository is enabled (active line without #)
# --------------------------------------------- # ----------------------------------------------------------------------
is_backports_enabled() { is_backports_enabled() {
if [ "$REPOS_CONFIGURED" != true ]; then # Check classic sources.list
echo false
return
fi
# Check both classic and deb822 sources
if [ -f /etc/apt/sources.list ]; then if [ -f /etc/apt/sources.list ]; then
if grep -Eq '^[^#]*[ \t]+bookworm-backports[ \t]+' /etc/apt/sources.list 2>/dev/null; then if grep -Eq '^[^#]*[ \t]+bookworm-backports[ \t]+' /etc/apt/sources.list 2>/dev/null; then
echo true echo true
@@ -171,8 +166,9 @@ is_backports_enabled() {
fi fi
fi fi
# Check deb822 .sources files
if [ -d /etc/apt/sources.list.d ]; then if [ -d /etc/apt/sources.list.d ]; then
if grep -qr 'backports' /etc/apt/sources.list.d/*.sources 2>/dev/null; then if grep -qr 'Suites:.*-backports' /etc/apt/sources.list.d/*.sources 2>/dev/null; then
echo true echo true
return return
fi fi
@@ -180,3 +176,15 @@ is_backports_enabled() {
echo false echo false
} }
get_backports_kernel_version() {
local ver
ver=$(apt-cache policy linux-image-amd64 2>/dev/null | \
grep -E '^[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+.*~bpo' | head -n1 | awk '{print $1}')
if [ -n "$ver" ]; then
echo "$ver"
else
echo "unknown"
fi
}