source: lliurex-up/trunk/fuentes/install-files/usr/sbin/final-d-i-installation @ 1080

Last change on this file since 1080 was 1080, checked in by jrpelegrina, 3 years ago

Fix links to pools of xenial

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1#!/bin/bash
2#
3# This script is licensed under GPL V3 or higher
4#
5#
6# Sources.list Hooks
7
8
9# First fix the sources list for generic lliurex flavours
10
11# Sanity operations
12mkdir -p /etc/apt/
13echo "# Net-Installer generated sources.list" > /etc/apt/sources.list
14echo "deb http://mirror/llx1605 xenial main universe restricted multiverse" >> /etc/apt/sources.list
15echo "deb http://mirror/llx1605 xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list
16echo "deb http://mirror/llx1605 xenial-security main universe restricted multiverse" >> /etc/apt/sources.list
17IS_A_CLIENT=""
18IS_A_SERVER=""
19IS_A_MUSIC=""
20
21
22
23
24# Nsswitch.conf problems
25cp /usr/share/base-files/nsswitch.conf /etc/nsswitch.conf
26[ ! -e /etc/ldap.conf ] || rm -f /etc/ldap.conf
27[ ! -e /etc/ldap/ldap.conf ] || rm -f /etc/ldap/ldap.conf
28
29
30# Some problems with GRUB
31dpkg-reconfigure lliurex-grub-custom
32
33
34# Client
35rc=0
36lliurex-version -t client || rc=1
37if [ $rc -eq 0 ] ; then
38        # Sanity operations
39        mkdir -p /etc/apt/
40
41        # Now Write the sources.list
42        echo "# LliureX Net-Installation Client" > /etc/apt/sources.list
43        echo "deb http://mirror/llx1605 xenial main universe restricted multiverse" >> /etc/apt/sources.list
44        echo "deb http://mirror/llx1605 xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list
45        echo "deb http://mirror/llx1605 xenial-security main universe restricted multiverse" >> /etc/apt/sources.list
46        IS_A_CLIENT="True"
47       
48fi
49
50# Server
51rc=0
52lliurex-version -t server || rc=1
53if [ $rc -eq 0 ] ; then
54        # Sanity operations
55        mkdir -p /etc/apt/
56
57        # Now Write the sources.list
58        echo "# LliureX Net-Installation Server" >> /etc/apt/sources.list
59        echo "# Uncomment the next line to enable the local mirror" >> /etc/apt/sources.list
60        echo "#deb file:///net/mirror/llx1605 xenial main universe restricted multiverse" >> /etc/apt/sources.list
61        echo "#deb file:///net/mirror/llx1605 xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list
62        echo "#deb file:///net/mirror/llx1605 xenial-security main universe restricted multiverse" >> /etc/apt/sources.list
63        IS_A_SERVER="True"
64
65fi
66
67
68if [ -z "$IS_A_CLIENT" -a -z "$IS_A_SERVER" ]; then
69
70        # Is a desktop machine
71        echo "# LliureX Net-Installation Desktop" > /etc/apt/sources.list
72        echo "deb http://lliurex.net/xeniai xenial main universe restricted multiverse" >> /etc/apt/sources.list
73        echo "deb http://lliurex.net/xenial xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list
74        echo "deb http://lliurex.net/xenial xenial-security main universe restricted multiverse" >> /etc/apt/sources.list
75
76        # Removing apt conf settings (proxy)
77        : > /etc/apt/apt.conf || true
78
79fi
80
81# Fix the session:
82cp -f /usr/share/gnome-session/sessions/gnome-fallback.session /usr/share/gnome-session/sessions/ubuntu.session || true
83
84[ ! -f /usr/share/xsessions/ubuntu.desktop ] || rm -f /usr/share/xsessions/ubuntu.desktop
85[ ! -f /usr/share/xsessions/xterm.desktop ] || rm -f /usr/share/xsessions/xterm.desktop
86[ ! -f /usr/share/xsessions/ubuntu-2d.desktop ] || rm -f /usr/share/xsessions/ubuntu-2d.desktop
87[ ! -f /usr/share/gnome-session/sessions/ubuntu-2d.session ] || rm -f /usr/share/gnome-session/sessions/ubuntu-2d.session
88[ ! -f /usr/share/gnome-session/sessions/gnome.session ] || rm -f /usr/share/gnome-session/sessions/gnome.session
89[ ! -f /usr/share/gnome-session/sessions/ubuntu.session ] || rm -f /usr/share/gnome-session/sessions/ubuntu.session
90[ ! -f /var/lib/AccountsService/users/ubuntu ] || rm -f /var/lib/AccountsService/users/ubuntu
91
92
93# The mother of the lamb
94# Imported from lliurex-maker technology
95# Some values
96LIGHTDM_DM="/etc/lightdm/lightdm.conf"
97GNOME_DM="/etc/lightdm/gnome-fallback.conf"
98XFCE4_DM="/etc/lightdm/xfce.conf"
99
100if [ -f "$XFCE4_DM" ] ; then
101        cat "$XFCE4_DM" > "$LIGHTDM_DM"
102elif [ -f "$GNOME_DM" ] ; then
103        cat "$GNOME_DM" > "$LIGHTDM_DM"
104fi
105
106if [ "$1" = "--force" ] ; then
107        # Do the reboot
108        reboot
109fi
110
111exit 0
Note: See TracBrowser for help on using the repository browser.