-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall-ubuntu-22
289 lines (265 loc) · 9.12 KB
/
install-ubuntu-22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
#! /bin/bash
clear
# Variables
#
ROJO="\033[1;31m"
NORMAL="\033[0m"
AZUL="\033[1;34m"
DISTRO=$(lsb_release -cs)
DESKTOP=$XDG_CURRENT_DESKTOP
# Copia el script en el sistema que comprueba que existe la extensión gnome appindicator
# En caso contrario la descarga y la instala en el usuario local
if [[ $DESKTOP = ubuntu:GNOME || $DESKTOP = ubuntu || $DESKTOP = GNOME || $DESKTOP = UBUNTU || $DESKTOP = gnome ]]
then
echo ""
echo -e "${ROJO}Escritorio basado en GNOME${NORMAL}"
echo ""
echo -e "${ROJO}Desktop based on GNOME${NORMAL}"
echo ""
echo -e "${ROJO}Instalando extensión de GNOME appindicatorsupportrgcjonas${NORMAL}"
echo ""
echo -e "${ROJO}Installing appindicatorsupportrgcjonas GNOME EXTENSION${NORMAL}"
echo ""
sleep 3
sudo cp check-appindicator-gnome-extension /usr/bin
sudo chmod +x /usr/bin/check-appindicator-gnome-extension
sudo cp check-appindicator-gnome-extension.desktop /etc/xdg/autostart/
else
echo ""
echo -e "${ROJO}Escritorio no basado en GNOME${NORMAL}"
echo ""
echo -e "${ROJO}Desktop not-based on GNOME${NORMAL}"
echo ""
echo ""
echo -e "${AZUL}Desktop environment $XDG_CURRENT_DESKTOP${NORMAL}"
sleep 4
fi
# Establecer la distribución en la que se basa el sistema host.
#
if [[ $DISTRO = focal || $DISTRO = ulyana || $DISTRO = ulyssa || $DISTRO = uma || $DISTRO = una ]]
then
BASED=focal
elif
[[ $DISTRO = bionic || $DISTRO = tricia || $DISTRO = tina || $DISTRO = tessa || $DISTRO = tara ]]
then
BASED=bionic
elif
[[ $DISTRO = jammy || $DISTRO = vanessa || $DISTRO = vera || $DISTRO = victoria || $DISTRO = virginia ]]
then
BASED=jammy
else
echo ""
echo -e "${ROJO}Esta instalación no es compatible con tu sistema${NORMAL}"
echo ""
echo -e "${ROJO}This install process is not compatible with your system${NORMAL}"
echo ""
sleep 4
exit
fi
echo ""
echo System codename $DISTRO
echo ""
echo System based on Ubuntu $BASED
echo ""
sleep 2
# Este script funciona en Ubuntu 18.04, bionic, Ubuntu 20.04 y Ubuntu 22.04, así como las derivadas en linux Mint.
#
echo ""
echo -e "${ROJO}Solicitando contraseña del usuario con derechos de administrador${NORMAL}"
echo ""
echo -e "${ROJO}Asking password of the user with administrations rights${NORMAL}"
echo ""
sudo echo ""
# Borrando antiguos archivos de smartdre o lliurex-smart
#
echo ""
echo -e "${ROJO}Borrando si existen archivos de anteriores instalaciones${NORMAL}"
echo ""
echo -e "${ROJO} Deleting if there are files from previous installations${NORMAL}"
echo ""
sudo chmod +x uninstall-smartdre
sudo ./uninstall-smartdre
#Instalación paquetes/drivers nwfermi en el sistema host
#
if [[ $BASED = focal ]]
then
echo ""
echo -e "${AZUL}Tu sistema Linux está basado en Ubuntu focal, instalando drivers...${NORMAL}"
echo ""
echo -e "${AZUL}Your system is based on Ubuntu Focal, installing drivers...${NORMAL}"
echo ""
sleep 4
sudo apt-get install git -y
sudo apt-get install dkms -y
git clone https://github.com/aosucas499/nwfermi
cd nwfermi
chmod +x nwfermi-focal.sh
sudo ./nwfermi-focal.sh
cd ..
sudo rm -r nwfermi
elif [[ $BASED = bionic ]]
then
echo ""
echo -e "${AZUL}Tu sistema Linux está basado en Ubuntu bionic, instalando drivers...${NORMAL}"
echo ""
echo -e "${AZUL}Your system is based on Ubuntu Bionic, installing drivers...${NORMAL}"
echo ""
sleep 4
sudo apt-get install git -y
sudo apt-get install dkms -y
git clone https://github.com/aosucas499/nwfermi
cd nwfermi
chmod +x nwfermi-host-bionic.sh
sudo ./nwfermi-host-bionic.sh
cd ..
sudo rm -r nwfermi
elif [[ $BASED = jammy ]]
then
echo ""
echo -e "${AZUL}Tu sistema Linux está basado en Ubuntu Jammy, instalando drivers...${NORMAL}"
echo ""
echo -e "${AZUL}Your system is based on Ubuntu Jammy, installing drivers...${NORMAL}"
echo ""
sleep 4
sudo apt update -y
sudo apt-get install git -y
sudo apt-get install dkms build-essential autoconf xutils-dev libtool xserver-xorg-dev libc6-i386 pkg-config evtest -y
sudo cp custom.conf /etc/gdm3/
git clone https://github.com/aosucas499/nwfermi-ubuntu22.04
cd nwfermi*
sudo dkms unbuild nwfermi/0.6.5.0 --all
sudo cp -p -r usr/src/nwfermi-0.7.0.1 /usr/src
sudo dkms build nwfermi/0.7.0.1
sudo dkms install nwfermi/0.7.0.1
sudo cp etc/X11/xorg.conf.d/10-nwfermi.conf /etc/X11/xorg.conf.d/
sudo cp usr/sbin/nwfermi_daemon /usr/sbin
sudo cp etc/udev/rules.d/40-nw-fermi.rules /etc/udev/rules.d/
sudo cp etc/systemd/system/[email protected] /etc/systemd/system/
sudo systemctl daemon-reload
cd usr/src/xf86-input-nextwindow-0.3.4
chmod +x autogen.sh ; ./autogen.sh
sudo make
sudo make install
sudo cp /usr/local/lib/xorg/modules/input/nextwindow_drv.* /usr/lib/xorg/modules/input/
sudo groupadd input
sudo useradd gdm
#sudo passwd gdm
sudo usermod -a -G gdm gdm
sudo usermod -a -G input gdm
sudo usermod -a -G input $USER
sudo usermod -a -G input usuario
cd ../../../..
sudo rm -r nwfermi*
# Notificaciones al terminar
#
echo ""
echo -e "${ROJO}Reinicie el equipo para que se ejecute la aplicación${NORMAL}"
echo ""
sudo notify-send "Reinicie el equipo para que se ejecute la aplicación"
# Borrar los repositorios de git y archivos de instalación
#
cd ..
sudo rm -r smartdre
sleep 3
exit
else
echo ""
echo -e "${ROJO}Esta instalación no es compatible con tu sistema${NORMAL}"
echo ""
echo -e "${ROJO}This install process is not compatible with your system${NORMAL}"
echo ""
sleep 4
exit
fi
echo ""
echo -e "${AZUL}continúa el script...${NORMAL}"
echo ""
echo -e "${AZUL}the script continues...${NORMAL}"
echo ""
# Instalar docker por repositorio
#
# echo ""
# echo -e "${AZUL}Instalando Docker...${NORMAL}"
# echo ""
# echo -e "${AZUL}Instaling Docker...${NORMAL}"
# echo ""
# sudo apt update
# sudo apt install -f
# sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
# sudo apt install -f
# sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $DISTRO stable"
# touch docker.list
# echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $BASED stable" > docker.list
# sudo mv docker.list /etc/apt/sources.list.d/docker.list
# sudo apt-key fingerprint 0EBFCD88
# sudo apt update
# sudo apt install docker-ce docker-ce-cli containerd.io -y
#sudo usermod -aG docker $USER
# sudo rm /etc/apt/sources.list.d/docker.list
# Instalar docker por paquetes
#
echo ""
echo -e "${AZUL}Instalando Docker...${NORMAL}"
echo ""
echo -e "${AZUL}Instaling Docker...${NORMAL}"
echo ""
sudo apt update
sudo apt install -f
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/containerd.io_1.5.11-1_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce-cli_20.10.17~3-0~ubuntu-focal_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce_20.10.17~3-0~ubuntu-focal_amd64.deb
sudo dpkg -i *.deb
sudo apt install -f
sudo rm *.deb
# Descarga la imagen docker
#
echo ""
echo -e "${AZUL}Descargando la imagen docker que contiene los drivers de la pizarra...${NORMAL}"
echo ""
echo -e "${AZUL}Downloading the docker image with the board drivers...${NORMAL}"
echo ""
sudo docker pull aosucas499/smartdre
# Hacer la aplicación iniciable en cada reinicio y usable para cualquier usuario sin "sudo"
#
echo ""
echo -e "${AZUL}Configurando la app para que arranque en cada inicio de sesión...${NORMAL}"
echo ""
echo -e "${AZUL}Settings up the app to boot at init...${NORMAL}"
echo ""
sudo cp smartdre /usr/bin
sudo chmod +x /usr/bin/smartdre
sudo chown root:root zz-smartdre
sudo chmod 0440 zz-smartdre
sudo cp zz-smartdre /etc/sudoers.d/
sudo cp smartdre.desktop /etc/xdg/autostart/
sudo cp smartdre.desktop /usr/share/applications/
# Crear apps y links para orientar y el panel de control de la pizarra en sistemas sin el icono en la barra de tareas
# Por ejemplo Ubuntu Focal y EducaAndOS
#
sudo cp orient /usr/bin
sudo chmod +x /usr/bin/orient
sudo chown root:root zz-orient
sudo chmod 0440 zz-orient
sudo cp zz-orient /etc/sudoers.d/
sudo cp smartdre-orient.desktop /usr/share/applications/
sudo cp controlpanel /usr/bin
sudo chmod +x /usr/bin/controlpanel
sudo chown root:root zz-controlpanel
sudo chmod 0440 zz-controlpanel
sudo cp zz-controlpanel /etc/sudoers.d/
sudo cp smartdre-controlpanel.desktop /usr/share/applications/
# Añadir iconos originales al sistema
#
sudo cp icons/* /usr/share/icons
# Notificaciones al terminar
#
echo ""
echo -e "${ROJO}Reinicie el equipo para que se ejecute la aplicación${NORMAL}"
echo ""
sudo notify-send "Reinicie el equipo para que se ejecute la aplicación"
# Borrar los repositorios de git y archivos de instalación
#
cd ..
sudo rm -r smartdre