dev/runs/boot

59 lines
2.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# NAME: Configure systemd-boot manager settings
set -euo pipefail
SDBOOT_CONFIG="/etc/sdboot-manage.conf"
echo "Configuring systemd-boot manager..."
# Check if sdboot-manage is installed
if ! command -v sdboot-manage &>/dev/null; then
echo "⚠️ sdboot-manage not found. Install systemd-boot-manager first."
exit 1
fi
# Backup existing config if it exists
if [[ -f "$SDBOOT_CONFIG" ]]; then
sudo cp "$SDBOOT_CONFIG" "$SDBOOT_CONFIG.backup.$(date +%Y%m%d_%H%M%S)"
echo "→ Backed up existing config"
fi
# Create the configuration
sudo tee "$SDBOOT_CONFIG" >/dev/null <<'EOF'
# Config file for sdboot-manage
# Kernel options to be appended to the "options" line
LINUX_OPTIONS="zswap.enabled=0 nowatchdog ipv6.disable=1 audit=0 loglevel=3 rd.systemd.show_status=auto rd.udev.log_level=3"
#LINUX_FALLBACK_OPTIONS=""
# When DISABLE_FALLBACK is set to "yes", it will stop creating fallback entries for each kernel.
DISABLE_FALLBACK="no"
# Use this pattern to match kernels which should be considered native OS kernels
#KERNEL_PATTERN="vmlinuz-"
# Setting REMOVE_EXISTING to "yes" will remove all your existing systemd-boot entries before building new entries
REMOVE_EXISTING="yes"
# Unless OVERWRITE_EXISTING is set to "yes" existing entries for currently installed kernels will not be touched
# this setting has no meaning if REMOVE_EXISTING is set to "yes"
OVERWRITE_EXISTING="yes"
# When REMOVE_OBSOLETE is set to "yes" entries for kernels no longer available on the system will be removed
REMOVE_OBSOLETE="yes"
# If PRESERVE_FOREIGN is set to "yes", do not delete entries starting with $ENTRY_ROOT
#PRESERVE_FOREIGN="no"
# Setting NO_AUTOUPDATE to "yes" will stop the updates to systemd-boot when systemd is updated - not recommended unless you are seperately updating systemd-boot
#NO_AUTOUPDATE="no"
# Setting NO_AUTOGEN to "yes" will stop the automatic creation of entries when kernels are installed or updated
#NO_AUTOGEN="no"
# Use this to change the default initramfs prefix (e.g. when using booster)
#INITRD_PREFIX="initramfs"
# Additional entities to initrd can be added here, such as microcode if your initramfs does not include it.
#INITRD_ENTRIES=()
EOF