Subversion Repositories ALCASAR

Rev

Rev 3088 | Rev 3099 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3088 Rev 3093
Line 19... Line 19...
19
# "lsscsi" & nvme-cli" & "php-dom" : needed by phpsysinfo
19
# "lsscsi" & nvme-cli" & "php-dom" : needed by phpsysinfo
20
# "socat" : avoid a warning when run the install script of letsencrypt ("acme.sh")
20
# "socat" : avoid a warning when run the install script of letsencrypt ("acme.sh")
21
# "sudo" : needed after a reinstallation (to be investigated)
21
# "sudo" : needed after a reinstallation (to be investigated)
22
# "clamav" + "clamav-db" : needed because of a lack of mutual dependance
22
# "clamav" + "clamav-db" : needed because of a lack of mutual dependance
23
# "postfix" + "cyrus-sasl" + "lib64sasl2-plug-plain" : email registration method
23
# "postfix" + "cyrus-sasl" + "lib64sasl2-plug-plain" : email registration method
24
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli php-dom unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamav clamav-db clamd fail2ban gnupg2 ulogd ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware-nonfree dnsmasq dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat postfix cyrus-sasl lib64sasl2-plug-plain iftop"
24
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli php-dom unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamav clamav-db clamd fail2ban gnupg2 ulogd ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware kernel-firmware-nonfree dnsmasq dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat postfix cyrus-sasl lib64sasl2-plug-plain iftop"
25
 
25
 
26
rpm_repository_sync ()
26
rpm_repository_sync ()
27
{
27
{
28
cat <<EOF > /etc/urpmi/urpmi.cfg
28
cat <<EOF > /etc/urpmi/urpmi.cfg
29
{
29
{
Line 120... Line 120...
120
		then
120
		then
121
			exit 1
121
			exit 1
122
		fi
122
		fi
123
	fi
123
	fi
124
done
124
done
-
 
125
 
-
 
126
# At this time, we only skip Kernel update
-
 
127
echo "/^kernel/" > /etc/urpmi/skip.list
-
 
128
if [ `egrep '^exclude=' /etc/dnf/dnf.conf |wc -l` -eq "1" ]; then
-
 
129
	$SED "s?^exclude=.*?exclude=kernel\*?g" /etc/dnf/dnf.conf
-
 
130
else
-
 
131
	echo "exclude=kernel*" >> /etc/dnf/dnf.conf
-
 
132
fi
-
 
133
 
-
 
134
# Remove some RPMs in order to avoid error and automatic update
-
 
135
urpme wkhtmltopdf freeradius-ldap
-
 
136
 
125
# download the kernel used by ALCASAR
137
# download the kernel used by ALCASAR
126
if [ $Lang == "fr" ]
138
if [ $Lang == "fr" ]
127
then
139
then
128
	echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..."
140
	echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..."
129
else
141
else
130
	echo "Download the Linux kernel used by ALCASAR. Please wait ..."
142
	echo "Download the Linux kernel used by ALCASAR. Please wait ..."
131
fi
143
fi
132
urpmi --auto --quiet $KERNEL
144
urpmi --auto --quiet $KERNEL
133
# Remove some RPMs in order to avoid error (or automatic update of "home made" RPM)
-
 
134
urpme wkhtmltopdf freeradius-ldap
-
 
135
# At this time, only skip Kernel update
-
 
136
echo "/^kernel/" > /etc/urpmi/skip.list
-
 
137
if [ `egrep '^exclude=' /etc/dnf/dnf.conf |wc -l` -eq "1" ]; then
-
 
138
	$SED "s?^exclude=.*?exclude=kernel\*?g" /etc/dnf/dnf.conf
-
 
139
else
-
 
140
	echo "exclude=kernel*" >> /etc/dnf/dnf.conf
-
 
141
fi
145
 
142
# download updated RPM in cache
146
# download updated RPM in cache
143
if [ $Lang == "fr" ]
147
if [ $Lang == "fr" ]
144
then
148
then
145
	echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
149
	echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
146
	echo "Il est temps d'aller prendre un café (ou une bonne bière) ;-)"
150
	echo "Il est temps d'aller prendre un café (ou une bonne bière) ;-)"
Line 221... Line 225...
221
do
225
do
222
	if [ $i != $KERNEL ];then
226
	if [ $i != $KERNEL ];then
223
		urpme --auto $i
227
		urpme --auto $i
224
	fi
228
	fi
225
done
229
done
-
 
230
 
226
# delete unused RPMs
231
# delete unused RPMs
227
if [ $Lang == "fr" ]
232
if [ $Lang == "fr" ]
228
then
233
then
229
	echo "Cleaning the system : "
234
	echo "Cleaning the system : "
230
else
235
else
231
	echo "Nettoyage du système : "
236
	echo "Nettoyage du système : "
232
fi
237
fi
233
unused_rpm="shorewall mandi plymouth squid polkit pm-utils"
238
unused_rpm="shorewall mandi plymouth squid polkit pm-utils"
234
/usr/sbin/urpme --auto -a $unused_rpm
239
/usr/sbin/urpme --auto -a $unused_rpm
-
 
240
for rpm in `rpm -qa|grep mga7`; do urpme --auto $rpm; done
235
/usr/sbin/urpme --auto --auto-orphans
241
/usr/sbin/urpme --auto --auto-orphans
236
 
242
 
237
# Save chilli launch script (erase with new rpm one)
243
# Save chilli launch script (erase with new rpm one)
238
[ -e /etc/chilli.conf ] && cp /etc/chilli.conf /tmp/
244
[ -e /etc/chilli.conf ] && cp /etc/chilli.conf /tmp/
239
# Install home made RPMs
245
# Install home made RPMs
Line 241... Line 247...
241
do
247
do
242
    urpmi --no-verify --auto $pkg
248
    urpmi --no-verify --auto $pkg
243
done
249
done
244
# restore chilli launch script
250
# restore chilli launch script
245
[ -e /tmp/chilli.conf ] && mv /tmp/chilli.conf /etc/
251
[ -e /tmp/chilli.conf ] && mv /tmp/chilli.conf /etc/
-
 
252
 
246
# Clean the RPM cache
253
# Clean the RPM cache
247
urpmi --clean
254
urpmi --clean
248
# the ipt-netflow RPM add the kernel module ipt_NETFLOW (the modules dependance tree need to be updated). "2>/dev/null" in order not to display a error (the running kernel is not the ALCASAR one during the installation process)
255
# the ipt-netflow RPM add the kernel module ipt_NETFLOW (the modules dependance tree need to be updated). "2>/dev/null" in order not to display a error (the running kernel is not the ALCASAR one during the installation process)
249
/sbin/depmod -a 2>/dev/null
256
/sbin/depmod -a 2>/dev/null
250
# test if all needed rpms are correctly installed
257
# test if all needed rpms are correctly installed
Line 260... Line 267...
260
done
267
done
261
if [ $count_pkg -ne $nb_pkg ]
268
if [ $count_pkg -ne $nb_pkg ]
262
then
269
then
263
	exit 1
270
	exit 1
264
fi
271
fi
-
 
272
 
265
# test if all custom rpms are correctly installed
273
# test if all custom rpms are correctly installed
266
count_pkg=0; nb_pkg=0;
274
count_pkg=0; nb_pkg=0;
267
for pkg in `ls rpms/$ARCH/|sed 's/.x86_64.rpm//'`
275
for pkg in `ls rpms/$ARCH/|sed 's/.x86_64.rpm//'`
268
do
276
do
269
	nb_pkg=`expr $nb_pkg + 1`
277
	nb_pkg=`expr $nb_pkg + 1`