]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - config/rootfiles/core/172/update.sh
c6e518070f2dbc43b5212ca0052b240718aea0ca
[people/pmueller/ipfire-2.x.git] / config / rootfiles / core / 172 / update.sh
1 #!/bin/bash
2 ############################################################################
3 # #
4 # This file is part of the IPFire Firewall. #
5 # #
6 # IPFire is free software; you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation; either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # IPFire is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with IPFire; if not, write to the Free Software #
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
19 # #
20 # Copyright (C) 2022 IPFire-Team <info@ipfire.org>. #
21 # #
22 ############################################################################
23 #
24 . /opt/pakfire/lib/functions.sh
25 /usr/local/bin/backupctrl exclude >/dev/null 2>&1
26
27 core=172
28
29 # Remove old core updates from pakfire cache to save space...
30 for (( i=1; i<=$core; i++ )); do
31 rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
32 done
33
34 # Stop services
35 /etc/rc.d/init.d/ipsec stop
36 /usr/local/bin/openvpnctrl -k
37 /usr/local/bin/openvpnctrl -kn2n
38 /etc/rc.d/init.d/sshd stop
39 /etc/rc.d/init.d/unbound stop
40
41 # Remove files
42 rm -rvf \
43 /etc/strongswan.d/scepclient.conf \
44 /lib/firmware/cnm/wave521c_j721s2_codec_fw.bin \
45 /lib/firmware/cxgb4/t4fw-1.26.6.0.bin \
46 /lib/firmware/cxgb4/t5fw-1.26.6.0.bin \
47 /lib/firmware/cxgb4/t6fw-1.26.6.0.bin \
48 /lib/firmware/mediatek/sof/sof-mt8186-mt6366-da7219-max98357.tplg \
49 /lib/firmware/mediatek/sof/sof-mt8186-mt6366-rt1019-rt5682s.tplg \
50 /lib/firmware/qcom/a530_zap.b00 \
51 /lib/firmware/qcom/a530_zap.b01 \
52 /lib/firmware/qcom/a530_zap.b02 \
53 /lib/firmware/qcom/venus-1.8/venus.b* \
54 /lib/firmware/qcom/venus-4.2/venus.b* \
55 /lib/firmware/qcom/venus-5.2/venus.b* \
56 /lib/firmware/qcom/venus-5.4/venus.b* \
57 /lib/firmware/qcom/vpu-1.0/venus.b* \
58 /lib/firmware/qcom/vpu-2.0/venus.b* \
59 /lib/firmware/qcom/vpu-2.0/venus.mdt \
60 /lib/firmware/rtl_bt \
61 /lib/libz.so.1.2.12 \
62 /usr/lib/libbind9-9.16.33.so \
63 /usr/lib/libdns-9.16.33.so \
64 /usr/lib/libexpat.so.1.8.9 \
65 /usr/lib/libhistory.so.8.1 \
66 /usr/lib/libirs-9.16.33.so \
67 /usr/lib/libisc-9.16.33.so \
68 /usr/lib/libisccc-9.16.33.so \
69 /usr/lib/libisccfg-9.16.33.so \
70 /usr/lib/libnetfilter_conntrack.so.3.7.0 \
71 /usr/lib/libns-9.16.33.so \
72 /usr/lib/libreadline.so.8.1 \
73 /usr/lib/libunbound.so.8.1.1* \
74 /usr/lib/libxml2.so.2.9.* \
75 /usr/lib/python3.10/ensurepip/_bundled/pip-21* \
76 /usr/lib/python3.10/ensurepip/_bundled/setuptools-5* \
77 /usr/lib/python3.10/lib2to3/Grammar3.10.* \
78 /usr/lib/python3.10/lib2to3/PatternGrammar3.10.* \
79 /usr/lib/python3.10/site-packages/pip-21.* \
80 /usr/lib/python3.10/site-packages/pip/_internal/utils/parallel.py \
81 /usr/lib/python3.10/site-packages/pip/_internal/utils/pkg_resources.py \
82 /usr/lib/python3.10/site-packages/pip/_vendor/appdirs.py \
83 /usr/lib/python3.10/site-packages/pip/_vendor/chardet/compat.py \
84 /usr/lib/python3.10/site-packages/pip/_vendor/distlib/_backport \
85 /usr/lib/python3.10/site-packages/pip/_vendor/distro.py \
86 /usr/lib/python3.10/site-packages/pip/_vendor/html5lib \
87 /usr/lib/python3.10/site-packages/pip/_vendor/msgpack/_version.py \
88 /usr/lib/python3.10/site-packages/pip/_vendor/progress \
89 /usr/lib/python3.10/site-packages/pip/_vendor/pyparsing.py \
90 /usr/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname \
91 /usr/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_compat.py \
92 /usr/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_typing.py \
93 /usr/lib/python3.10/site-packages/pkg_resources/_vendor/pyparsing.py \
94 /usr/lib/python3.10/site-packages/pkg_resources/tests/data \
95 /usr/lib/python3.10/site-packages/setuptools-5* \
96 /usr/lib/python3.10/site-packages/setuptools/_distutils/py35compat.py \
97 /usr/lib/python3.10/site-packages/setuptools/_vendor/packaging/_compat.py \
98 /usr/lib/python3.10/site-packages/setuptools/_vendor/packaging/_typing.py \
99 /usr/lib/python3.10/site-packages/setuptools/_vendor/pyparsing.py \
100 /usr/lib/python3.10/site-packages/setuptools/config.py \
101 /usr/lib/python3.10/site-packages/setuptools_rust/utils.py \
102 /usr/libexec/ipsec/scepclient \
103 /var/ipfire/ca/dh1024.pem
104
105 # Remove powertop add-on, if installed
106 if [ -e "/opt/pakfire/db/installed/meta-powertop" ]; then
107 for i in $(</opt/pakfire/db/rootfiles/powertop); do
108 rm -rfv "/${i}"
109 done
110 fi
111 rm -vf \
112 /opt/pakfire/db/installed/meta-powertop \
113 /opt/pakfire/db/meta/meta-powertop \
114 /opt/pakfire/db/rootfiles/powertop
115
116 # Extract files
117 extract_files
118
119 # update linker config
120 ldconfig
121
122 # Update Language cache
123 /usr/local/bin/update-lang-cache
124
125 # Filesytem cleanup
126 /usr/local/bin/filesystem-cleanup
127
128 # Apply local configuration to sshd_config
129 /usr/local/bin/sshctrl
130
131 # Correct permissions of some library files
132 chown -Rv root:root /var/ipfire/connscheduler/lib.pl /var/ipfire/updatexlrator/updxlrator-lib.pl /var/ipfire/menu.d/*
133
134 # Replace existing OpenVPN Diffie-Hellman parameter by ffdhe4096, as specified in RFC 7919
135 if [ -f /var/ipfire/ovpn/server.conf ]; then
136 sed -i 's|/var/ipfire/ovpn/ca/dh1024.pem|/etc/ssl/ffdhe4096.pem|' /var/ipfire/ovpn/server.conf
137 fi
138
139 if [ -f "/var/ipfire/ovpn/n2nconf/*/*.conf" ]; then
140 sed -i 's|/var/ipfire/ovpn/ca/dh1024.pem|/etc/ssl/ffdhe4096.pem|' /var/ipfire/ovpn/n2nconf/*/*.conf
141 fi
142
143 # Start services
144 /etc/init.d/unbound start
145 if grep -q "ENABLE_SSH=on" /var/ipfire/remote/settings; then
146 /etc/init.d/sshd start
147 fi
148 if grep -q "ENABLED=on" /var/ipfire/ovpn/settings; then
149 /usr/local/bin/openvpnctrl -s
150 /usr/local/bin/openvpnctrl -sn2n
151 fi
152 if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then
153 /etc/init.d/ipsec start
154 fi
155
156 # This update needs a reboot...
157 touch /var/run/need_reboot
158
159 # Finish
160 /etc/init.d/fireinfo start
161 sendprofile
162
163 # Update grub config to display new core version
164 if [ -e /boot/grub/grub.cfg ]; then
165 grub-mkconfig -o /boot/grub/grub.cfg
166 fi
167
168 sync
169
170 # Don't report the exitcode last command
171 exit 0