#!/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/llx1505 trusty main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1505 trusty-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1505 trusty-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/llx1505 trusty main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1505 trusty-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://mirror/llx1505 trusty-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/llx1505 trusty main universe restricted multiverse" >> /etc/apt/sources.list echo "#deb file:///net/mirror/llx1505 trusty-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "#deb file:///net/mirror/llx1505 trusty-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/trusty trusty main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://lliurex.net/trusty trusty-updates main universe restricted multiverse" >> /etc/apt/sources.list echo "deb http://lliurex.net/trusty trusty-security main universe restricted multiverse" >> /etc/apt/sources.list # Removing apt conf settings (proxy) : > /etc/apt/apt.conf || true : > /etc/network/interfaces || true echo "# interfaces(5) file used by ifup(8) and ifdown(8)" >> /etc/network/interfaces || true echo "auto lo" >> /etc/network/interfaces || true echo "iface lo inet loopback" >> /etc/network/interfaces || 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