#!/bin/bash # # This script is licensed under GPL V3 or higher # # # Sources.list Hooks # First fix the sources list for generic lliurex flavours # Sanity operations mkdir -p /etc/apt/ echo "# Net-Installer generated sources.list" > /etc/apt/sources.list echo "deb http://mirror/llx1605 xenial main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1605 xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1605 xenial-security main universe restricted multiverse" >> /etc/apt/sources.list IS_A_CLIENT="" IS_A_SERVER="" IS_A_MUSIC="" # Nsswitch.conf problems cp /usr/share/base-files/nsswitch.conf /etc/nsswitch.conf [ ! -e /etc/ldap.conf ] || rm -f /etc/ldap.conf [ ! -e /etc/ldap/ldap.conf ] || rm -f /etc/ldap/ldap.conf # Some problems with GRUB dpkg-reconfigure lliurex-grub-custom # Client rc=0 lliurex-version -t client || rc=1 if [ $rc -eq 0 ] ; then # Sanity operations mkdir -p /etc/apt/ # Now Write the sources.list echo "# LliureX Net-Installation Client" > /etc/apt/sources.list echo "deb http://mirror/llx1605 xenial main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1605 xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1605 xenial-security main universe restricted multiverse" >> /etc/apt/sources.list IS_A_CLIENT="True" fi # Server rc=0 lliurex-version -t server || rc=1 if [ $rc -eq 0 ] ; then # Sanity operations mkdir -p /etc/apt/ # Now Write the sources.list echo "# LliureX Net-Installation Server" >> /etc/apt/sources.list echo "# Uncomment the next line to enable the local mirror" >> /etc/apt/sources.list echo "#deb file:///net/mirror/llx1605 xenial main universe restricted multiverse" >> /etc/apt/sources.list echo "#deb file:///net/mirror/llx1605 xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "#deb file:///net/mirror/llx1605 xenial-security main universe restricted multiverse" >> /etc/apt/sources.list IS_A_SERVER="True" fi if [ -z "$IS_A_CLIENT" -a -z "$IS_A_SERVER" ]; then # Is a desktop machine echo "# LliureX Net-Installation Desktop" > /etc/apt/sources.list echo "deb http://lliurex.net/xeniai xenial main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://lliurex.net/xenial xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://lliurex.net/xenial xenial-security main universe restricted multiverse" >> /etc/apt/sources.list # Removing apt conf settings (proxy) : > /etc/apt/apt.conf || true fi # Fix the session: cp -f /usr/share/gnome-session/sessions/gnome-fallback.session /usr/share/gnome-session/sessions/ubuntu.session || true [ ! -f /usr/share/xsessions/ubuntu.desktop ] || rm -f /usr/share/xsessions/ubuntu.desktop [ ! -f /usr/share/xsessions/xterm.desktop ] || rm -f /usr/share/xsessions/xterm.desktop [ ! -f /usr/share/xsessions/ubuntu-2d.desktop ] || rm -f /usr/share/xsessions/ubuntu-2d.desktop [ ! -f /usr/share/gnome-session/sessions/ubuntu-2d.session ] || rm -f /usr/share/gnome-session/sessions/ubuntu-2d.session [ ! -f /usr/share/gnome-session/sessions/gnome.session ] || rm -f /usr/share/gnome-session/sessions/gnome.session [ ! -f /usr/share/gnome-session/sessions/ubuntu.session ] || rm -f /usr/share/gnome-session/sessions/ubuntu.session [ ! -f /var/lib/AccountsService/users/ubuntu ] || rm -f /var/lib/AccountsService/users/ubuntu # The mother of the lamb # Imported from lliurex-maker technology # Some values LIGHTDM_DM="/etc/lightdm/lightdm.conf" GNOME_DM="/etc/lightdm/gnome-fallback.conf" XFCE4_DM="/etc/lightdm/xfce.conf" if [ -f "$XFCE4_DM" ] ; then cat "$XFCE4_DM" > "$LIGHTDM_DM" elif [ -f "$GNOME_DM" ] ; then cat "$GNOME_DM" > "$LIGHTDM_DM" fi if [ "$1" = "--force" ] ; then # Do the reboot reboot fi exit 0