]>
Commit | Line | Data |
---|---|---|
0f421901 PM |
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 | |
f6121180 | 35 | /etc/rc.d/init.d/ipsec stop |
e044bc24 PM |
36 | /usr/local/bin/openvpnctrl -k |
37 | /usr/local/bin/openvpnctrl -kn2n | |
4ddb1fda | 38 | /etc/rc.d/init.d/sshd stop |
5f1abe00 | 39 | /etc/rc.d/init.d/unbound stop |
78e0fef4 | 40 | /etc/rc.d/init.d/suricata stop |
0f421901 | 41 | |
819e5e08 PM |
42 | KVER="xxxKVERxxx" |
43 | ||
44 | # Backup uEnv.txt if exist | |
45 | if [ -e /boot/uEnv.txt ]; then | |
46 | cp -vf /boot/uEnv.txt /boot/uEnv.txt.org | |
47 | fi | |
48 | ||
eb9e29f9 PM |
49 | # Extract files |
50 | extract_files | |
51 | ||
52 | # update linker config | |
53 | ldconfig | |
54 | ||
0f421901 | 55 | # Remove files |
5f1abe00 | 56 | rm -rvf \ |
f07ddd93 | 57 | /etc/pcmcia \ |
c965daf6 | 58 | /etc/strongswan.d/scepclient.conf \ |
f07ddd93 | 59 | /etc/udev/rules.d/60-pcmcia.rules \ |
c932dcd7 PM |
60 | /lib/firmware/cnm/wave521c_j721s2_codec_fw.bin \ |
61 | /lib/firmware/cxgb4/t4fw-1.26.6.0.bin \ | |
62 | /lib/firmware/cxgb4/t5fw-1.26.6.0.bin \ | |
63 | /lib/firmware/cxgb4/t6fw-1.26.6.0.bin \ | |
64 | /lib/firmware/mediatek/sof/sof-mt8186-mt6366-da7219-max98357.tplg \ | |
65 | /lib/firmware/mediatek/sof/sof-mt8186-mt6366-rt1019-rt5682s.tplg \ | |
66 | /lib/firmware/qcom/a530_zap.b00 \ | |
67 | /lib/firmware/qcom/a530_zap.b01 \ | |
68 | /lib/firmware/qcom/a530_zap.b02 \ | |
69 | /lib/firmware/qcom/venus-1.8/venus.b* \ | |
70 | /lib/firmware/qcom/venus-4.2/venus.b* \ | |
71 | /lib/firmware/qcom/venus-5.2/venus.b* \ | |
72 | /lib/firmware/qcom/venus-5.4/venus.b* \ | |
73 | /lib/firmware/qcom/vpu-1.0/venus.b* \ | |
74 | /lib/firmware/qcom/vpu-2.0/venus.b* \ | |
75 | /lib/firmware/qcom/vpu-2.0/venus.mdt \ | |
28b9df01 | 76 | /lib/firmware/rtl_bt \ |
0a65d443 | 77 | /lib/libz.so.1.2.12 \ |
f07ddd93 PM |
78 | /sbin/lspcmcia \ |
79 | /sbin/pccardctl \ | |
80 | /sbin/pcmcia-check-broken-cis \ | |
81 | /sbin/pcmcia-socket-startup \ | |
cc7bd114 PM |
82 | /usr/lib/libbind9-9.16.33.so \ |
83 | /usr/lib/libdns-9.16.33.so \ | |
92cb2b55 | 84 | /usr/lib/libedit.so.0.0.6* \ |
4022e2f9 | 85 | /usr/lib/libexpat.so.1.8.9 \ |
cc7bd114 PM |
86 | /usr/lib/libirs-9.16.33.so \ |
87 | /usr/lib/libisc-9.16.33.so \ | |
88 | /usr/lib/libisccc-9.16.33.so \ | |
89 | /usr/lib/libisccfg-9.16.33.so \ | |
1545553c | 90 | /usr/lib/libnetfilter_conntrack.so.3.7.0 \ |
cc7bd114 | 91 | /usr/lib/libns-9.16.33.so \ |
4e3a5352 | 92 | /usr/lib/libpng16.so.16.37.0 \ |
c2eb7f25 PM |
93 | /usr/lib/libpoppler-cpp.so.0.9* \ |
94 | /usr/lib/libpoppler-glib.so.8.23.0 \ | |
95 | /usr/lib/libpoppler.so.120* \ | |
05dd992b | 96 | /usr/lib/libtasn1.so.6.6.2 \ |
8f591d72 PM |
97 | /usr/lib/libtiff.so.5.7* \ |
98 | /usr/lib/libtiffxx.so.5.7* \ | |
c965daf6 | 99 | /usr/lib/libunbound.so.8.1.1* \ |
0675d2a4 | 100 | /usr/lib/libxml2.so.2.9.* \ |
f9ab4c43 PM |
101 | /usr/lib/python3.10/ensurepip/_bundled/pip-21* \ |
102 | /usr/lib/python3.10/ensurepip/_bundled/setuptools-5* \ | |
103 | /usr/lib/python3.10/lib2to3/Grammar3.10.* \ | |
104 | /usr/lib/python3.10/lib2to3/PatternGrammar3.10.* \ | |
105 | /usr/lib/python3.10/site-packages/pip-21.* \ | |
106 | /usr/lib/python3.10/site-packages/pip/_internal/utils/parallel.py \ | |
107 | /usr/lib/python3.10/site-packages/pip/_internal/utils/pkg_resources.py \ | |
108 | /usr/lib/python3.10/site-packages/pip/_vendor/appdirs.py \ | |
109 | /usr/lib/python3.10/site-packages/pip/_vendor/chardet/compat.py \ | |
110 | /usr/lib/python3.10/site-packages/pip/_vendor/distlib/_backport \ | |
111 | /usr/lib/python3.10/site-packages/pip/_vendor/distro.py \ | |
112 | /usr/lib/python3.10/site-packages/pip/_vendor/html5lib \ | |
113 | /usr/lib/python3.10/site-packages/pip/_vendor/msgpack/_version.py \ | |
114 | /usr/lib/python3.10/site-packages/pip/_vendor/progress \ | |
115 | /usr/lib/python3.10/site-packages/pip/_vendor/pyparsing.py \ | |
116 | /usr/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname \ | |
117 | /usr/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_compat.py \ | |
118 | /usr/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_typing.py \ | |
119 | /usr/lib/python3.10/site-packages/pkg_resources/_vendor/pyparsing.py \ | |
120 | /usr/lib/python3.10/site-packages/pkg_resources/tests/data \ | |
121 | /usr/lib/python3.10/site-packages/setuptools-5* \ | |
122 | /usr/lib/python3.10/site-packages/setuptools/_distutils/py35compat.py \ | |
123 | /usr/lib/python3.10/site-packages/setuptools/_vendor/packaging/_compat.py \ | |
124 | /usr/lib/python3.10/site-packages/setuptools/_vendor/packaging/_typing.py \ | |
125 | /usr/lib/python3.10/site-packages/setuptools/_vendor/pyparsing.py \ | |
126 | /usr/lib/python3.10/site-packages/setuptools/config.py \ | |
127 | /usr/lib/python3.10/site-packages/setuptools_rust/utils.py \ | |
3a42eaa9 | 128 | /usr/lib/sudo/sample_approval.so \ |
e044bc24 PM |
129 | /usr/libexec/ipsec/scepclient \ |
130 | /var/ipfire/ca/dh1024.pem | |
0f421901 | 131 | |
e9062718 MT |
132 | # Remove gnu-netcat add-on, if installed |
133 | for addon in gnu-netcat; do | |
366cd034 PM |
134 | if [ -e "/opt/pakfire/db/installed/meta-${addon}" ]; then |
135 | for i in $(</opt/pakfire/db/rootfiles/${addon}); do | |
136 | rm -rfv "/${i}" | |
137 | done | |
138 | fi | |
139 | rm -vf \ | |
140 | /opt/pakfire/db/installed/meta-${addon} \ | |
141 | /opt/pakfire/db/meta/meta-${addon} \ | |
142 | /opt/pakfire/db/rootfiles/${addon} | |
143 | done | |
d3a4fcc7 | 144 | |
0f421901 PM |
145 | # Update Language cache |
146 | /usr/local/bin/update-lang-cache | |
147 | ||
148 | # Filesytem cleanup | |
149 | /usr/local/bin/filesystem-cleanup | |
150 | ||
4ddb1fda PM |
151 | # Apply local configuration to sshd_config |
152 | /usr/local/bin/sshctrl | |
153 | ||
eae0cb54 | 154 | # Correct permissions of some library files |
39d67050 | 155 | chown -Rv root:root /var/ipfire/connscheduler/lib.pl /var/ipfire/updatexlrator/updxlrator-lib.pl /var/ipfire/menu.d/* |
eae0cb54 | 156 | |
e044bc24 | 157 | # Replace existing OpenVPN Diffie-Hellman parameter by ffdhe4096, as specified in RFC 7919 |
ee7944fe | 158 | sed -i 's|/var/ipfire/ovpn/ca/dh1024.pem|/etc/ssl/ffdhe4096.pem|' /var/ipfire/ovpn/server.conf /var/ipfire/ovpn/n2nconf/*/*.conf |
e044bc24 | 159 | |
0f421901 | 160 | # Start services |
78e0fef4 PM |
161 | if grep -q "ENABLE_IDS=on" /var/ipfire/suricata/settings; then |
162 | /etc/rc.d/init.d/suricata start | |
163 | fi | |
5f1abe00 | 164 | /etc/init.d/unbound start |
4ddb1fda PM |
165 | if grep -q "ENABLE_SSH=on" /var/ipfire/remote/settings; then |
166 | /etc/init.d/sshd start | |
167 | fi | |
e044bc24 PM |
168 | if grep -q "ENABLED=on" /var/ipfire/ovpn/settings; then |
169 | /usr/local/bin/openvpnctrl -s | |
170 | /usr/local/bin/openvpnctrl -sn2n | |
171 | fi | |
f6121180 PM |
172 | if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then |
173 | /etc/init.d/ipsec start | |
174 | fi | |
0f421901 | 175 | |
819e5e08 PM |
176 | # Regenerate all initrds |
177 | dracut --regenerate-all --force | |
178 | case "$(uname -m)" in | |
179 | armv*) | |
180 | mkimage -A arm -T ramdisk -C lzma -d /boot/initramfs-${KVER}-ipfire.img /boot/uInit-${KVER}-ipfire | |
181 | rm /boot/initramfs-${KVER}-ipfire.img | |
182 | ;; | |
183 | aarch64) | |
184 | mkimage -A arm64 -T ramdisk -C lzma -d /boot/initramfs-${KVER}-ipfire.img /boot/uInit-${KVER}-ipfire | |
185 | # dont remove initramfs because grub need this to boot. | |
186 | ;; | |
187 | esac | |
188 | ||
189 | # Call user update script (needed for some ARM boards) | |
190 | if [ -e /boot/pakfire-kernel-update ]; then | |
191 | /boot/pakfire-kernel-update ${KVER} | |
192 | fi | |
193 | ||
0f421901 | 194 | # This update needs a reboot... |
4808c037 | 195 | touch /var/run/need_reboot |
0f421901 PM |
196 | |
197 | # Finish | |
198 | /etc/init.d/fireinfo start | |
199 | sendprofile | |
200 | ||
201 | # Update grub config to display new core version | |
202 | if [ -e /boot/grub/grub.cfg ]; then | |
203 | grub-mkconfig -o /boot/grub/grub.cfg | |
204 | fi | |
205 | ||
206 | sync | |
207 | ||
208 | # Don't report the exitcode last command | |
209 | exit 0 |