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 |
---|
12 | mkdir -p /etc/apt/ |
---|
13 | echo "# Net-Installer generated sources.list" > /etc/apt/sources.list |
---|
14 | echo "deb http://mirror/llx1605 xenial main universe restricted multiverse" >> /etc/apt/sources.list |
---|
15 | echo "deb http://mirror/llx1605 xenial-updates main universe restricted multiverse" >> /etc/apt/sources.list |
---|
16 | echo "deb http://mirror/llx1605 xenial-security main universe restricted multiverse" >> /etc/apt/sources.list |
---|
17 | IS_A_CLIENT="" |
---|
18 | IS_A_SERVER="" |
---|
19 | IS_A_MUSIC="" |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | |
---|
24 | # Nsswitch.conf problems |
---|
25 | cp /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 |
---|
31 | dpkg-reconfigure lliurex-grub-custom |
---|
32 | |
---|
33 | |
---|
34 | # Client |
---|
35 | rc=0 |
---|
36 | lliurex-version -t client || rc=1 |
---|
37 | if [ $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 | |
---|
48 | fi |
---|
49 | |
---|
50 | # Server |
---|
51 | rc=0 |
---|
52 | lliurex-version -t server || rc=1 |
---|
53 | if [ $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 | |
---|
65 | fi |
---|
66 | |
---|
67 | |
---|
68 | if [ -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 | |
---|
79 | fi |
---|
80 | |
---|
81 | # Fix the session: |
---|
82 | cp -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 |
---|
96 | LIGHTDM_DM="/etc/lightdm/lightdm.conf" |
---|
97 | GNOME_DM="/etc/lightdm/gnome-fallback.conf" |
---|
98 | XFCE4_DM="/etc/lightdm/xfce.conf" |
---|
99 | |
---|
100 | if [ -f "$XFCE4_DM" ] ; then |
---|
101 | cat "$XFCE4_DM" > "$LIGHTDM_DM" |
---|
102 | elif [ -f "$GNOME_DM" ] ; then |
---|
103 | cat "$GNOME_DM" > "$LIGHTDM_DM" |
---|
104 | fi |
---|
105 | |
---|
106 | if [ "$1" = "--force" ] ; then |
---|
107 | # Do the reboot |
---|
108 | reboot |
---|
109 | fi |
---|
110 | |
---|
111 | exit 0 |
---|