File config.sh of Package Aeon

#!/bin/bash
set -euo pipefail

# 1. SETUP UTENTE ROOT E ABILITAZIONE LOGIN GRAFICO
#-------------------------------------------------
# Password vuota per root
passwd -d root

# Permetti a root di loggarsi graficamente (Necessario per GNOME/GDM)
# Modifichiamo la configurazione PAM per GDM
if [ -f /etc/pam.d/gdm-password ]; then
    # Commenta la riga che nega l'accesso a root (user != root)
    sed -i 's/.*pam_succeed_if.so user != root.*/#&/' /etc/pam.d/gdm-password
fi

# Configura GDM per il login automatico
mkdir -p /etc/gdm
cat > /etc/gdm/custom.conf <<EOF
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=root
EOF

# 2. AUTOSTART INSTALLER
#-------------------------------------------------
mkdir -p /etc/xdg/autostart
cat > /etc/xdg/autostart/install-distro.desktop <<EOF
[Desktop Entry]
Type=Application
Name=Install Aeon Fork
Exec=/usr/sbin/yast2 installation
Terminal=false
Categories=System;
X-GNOME-Autostart-enabled=true
EOF

# ... resto dello script (servizi, snapper, pulizia) ...


# 3. PERMESSI E POLKIT (Cruciale per YaST)
#-------------------------------------------------
# Assicura che root possa lanciare app grafiche
mkdir -p /var/lib/polkit-1
if [ -x /usr/sbin/set_polkit_default_privs ]; then
    /usr/sbin/set_polkit_default_privs
fi

# 4. PLYMOUTH & SERVIZI
#-------------------------------------------------
if [ -f /usr/bin/plymouth-set-default-theme ]; then
    /usr/bin/plymouth-set-default-theme openSUSE || true
fi

systemctl enable NetworkManager.service || true

# Abilita rebootmgr solo se il pacchetto รจ installato
if [ -f /usr/lib/systemd/system/rebootmgr.service ]; then
    systemctl enable rebootmgr.service || true
fi

systemctl enable transactional-update.timer || true

# 4. CONFIGURAZIONE SNAPPER
#-----------------------------------
if [ -x /usr/bin/snapper ]; then
    echo "Configurazione Snapper..."
    mkdir -p /etc/snapper/configs
    if [ ! -f /etc/snapper/configs/root ]; then
        if [ -f /usr/share/snapper/config-templates/default ]; then
            cp /usr/share/snapper/config-templates/default /etc/snapper/configs/root
        fi
    fi
    # Ottimizzazioni per MicroOS/Aeon
    if [ -f /etc/snapper/configs/root ]; then
        sed -i 's/^TIMELINE_CREATE="yes"/TIMELINE_CREATE="no"/' /etc/snapper/configs/root
        sed -i 's/^NUMBER_LIMIT=".*"/NUMBER_LIMIT="2-10"/' /etc/snapper/configs/root
    fi
fi

# 5. PULIZIA RESIDUI (Tik e vari)
#-----------------------------------
# Pulizia aggressiva per evitare conflitti con tik se presente nei pattern
rm -f /usr/lib/systemd/system/tik-*
rm -f /etc/systemd/system/multi-user.target.wants/tik-*

# 6. CHIUSURA
#-----------------------------------
# ldconfig aggiorna la cache delle librerie
ldconfig

echo "Configurazione completata con successo."

exit 0
openSUSE Build Service is sponsored by