#!/bin/bash
# Configure system for a specific bootc variant
set -xeuo pipefail

VARIANT="${1:-}"

if [ -z "$VARIANT" ]; then
  # No variant specified, nothing to do
  exit 0
fi

# Handle variant-specific configuration
case "${VARIANT}" in
  *-sdboot)
    # Install systemd-boot and remove bootupd
    dnf -y install systemd-boot-unsigned
    # Uninstall bootupd
    rpm -e bootupd
    rm -rf /usr/lib/bootupd/updates
    # Clean up package manager caches
    dnf clean all
    rm -rf /var/cache /var/lib/{dnf,rhsm} /var/log/*
  ;;
  # Future variants can be added here
  # For Debian support, this could check package manager type and use apt instead
esac
