]>
git.ipfire.org Git - ipfire-2.x.git/blob - config/rootfiles/core/169/update.sh
2 ############################################################################
4 # This file is part of the IPFire Firewall. #
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. #
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. #
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 #
20 # Copyright (C) 2022 IPFire-Team <info@ipfire.org>. #
22 ############################################################################
24 .
/opt
/pakfire
/lib
/functions.sh
25 /usr
/local
/bin
/backupctrl exclude
>/dev
/null
2>&1
30 # Set last succesfull installed core.
31 echo $
(($core-1)) > /opt
/pakfire
/db
/core
/mine
32 # force fsck at next boot, this may fix free space on xfs
34 # don't start pakfire again at error
35 killall
-KILL pak_update
36 /usr
/bin
/logger
-p syslog.emerg
-t ipfire \
37 "core-update-${core}: $1"
41 # Remove old core updates from pakfire cache to save space...
42 for (( i
=1; i
<=$core; i
++ )); do
43 rm -f /var
/cache
/pakfire
/core-upgrade-
*-$i.ipfire
47 /etc
/init.d
/unbound stop
48 /etc
/init.d
/squid stop
49 /etc
/init.d
/apache stop
53 # Backup uEnv.txt if exist
54 if [ -e /boot
/uEnv.txt
]; then
55 cp -vf /boot
/uEnv.txt
/boot
/uEnv.txt.org
58 # Do some sanity checks prior to the kernel update
64 exit_with_error
"ERROR cannot update. No IPFire Kernel." 1
68 # Check diskspace on root
69 ROOTSPACE
=`df / -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1`
71 if [ $ROOTSPACE -lt 100000 ]; then
72 exit_with_error
"ERROR cannot update because not enough free space on root." 2
76 # Remove the old kernel
91 /etc
/rc.d
/init.d
/random \
92 /etc
/rc.d
/rcsysinit.d
/S66random \
93 /lib
/firmware
/ath10k
/QCA99X
0/hw2.0
/board.bin \
94 /lib
/firmware
/intel
/ice
/ddp
/ice-1.3
.26.0.pkg \
95 /lib
/firmware
/iwlwifi-3160-10.ucode \
96 /lib
/firmware
/iwlwifi-3160-12.ucode \
97 /lib
/firmware
/iwlwifi-3160-13.ucode \
98 /lib
/firmware
/iwlwifi-3160-16.ucode \
99 /lib
/firmware
/iwlwifi-3160-7.ucode \
100 /lib
/firmware
/iwlwifi-3160-8.ucode \
101 /lib
/firmware
/iwlwifi-3160-9.ucode \
102 /lib
/firmware
/iwlwifi-3168-21.ucode \
103 /lib
/firmware
/iwlwifi-7260-10.ucode \
104 /lib
/firmware
/iwlwifi-7260-12.ucode \
105 /lib
/firmware
/iwlwifi-7260-13.ucode \
106 /lib
/firmware
/iwlwifi-7260-16.ucode \
107 /lib
/firmware
/iwlwifi-7260-7.ucode \
108 /lib
/firmware
/iwlwifi-7260-8.ucode \
109 /lib
/firmware
/iwlwifi-7260-9.ucode \
110 /lib
/firmware
/iwlwifi-7265-10.ucode \
111 /lib
/firmware
/iwlwifi-7265-12.ucode \
112 /lib
/firmware
/iwlwifi-7265-13.ucode \
113 /lib
/firmware
/iwlwifi-7265-16.ucode \
114 /lib
/firmware
/iwlwifi-7265-8.ucode \
115 /lib
/firmware
/iwlwifi-7265-9.ucode \
116 /lib
/firmware
/iwlwifi-7265D-10.ucode \
117 /lib
/firmware
/iwlwifi-7265D-12.ucode \
118 /lib
/firmware
/iwlwifi-7265D-13.ucode \
119 /lib
/firmware
/iwlwifi-7265D-16.ucode \
120 /lib
/firmware
/iwlwifi-7265D-17.ucode \
121 /lib
/firmware
/iwlwifi-7265D-21.ucode \
122 /lib
/firmware
/iwlwifi-8000C-13.ucode \
123 /lib
/firmware
/iwlwifi-8000C-16.ucode \
124 /lib
/firmware
/iwlwifi-8000C-21.ucode \
125 /lib
/firmware
/iwlwifi-8265-21.ucode \
126 /lib
/libxtables.so
.12.4.0 \
127 /lib
/xtables
/libip6t_DNAT.so \
128 /lib
/xtables
/libip6t_REDIRECT.so \
129 /lib
/xtables
/libipt_DNAT.so \
130 /lib
/xtables
/libipt_REDIRECT.so \
131 /srv
/web
/ipfire
/cgi-bin
/entropy.cgi \
132 /usr
/lib
/libfuse3.so
.3.10.4 \
133 /usr
/lib
/libunbound.so
.8.1.14
134 /usr
/lib
/libxml2.so
.2.9.12 \
135 /usr
/lib
/libxslt.so
.1.1.34 \
136 /usr
/lib
/libyang.so
.2.1.4
141 # update linker config
144 # Update Language cache
145 /usr
/local
/bin
/update-lang-cache
148 /usr
/local
/bin
/filesystem-cleanup
150 # Apply sysctl changes
151 /etc
/init.d
/sysctl start
153 # Delete unused initrd on 32-bit ARM to save space in /boot
154 case "$(uname -m)" in
156 rm /boot
/initramfs-
${KVER}-ipfire.img
162 /etc
/init.d
/firewall restart
163 /etc
/init.d
/ntp restart
164 /etc
/init.d
/apache start
165 /etc
/init.d
/unbound start
166 /etc
/init.d
/squid start
168 # krb5 is now part of the core system, remove Pakfire metadata for it
169 if [ -e "/opt/pakfire/db/installed/meta-krb5" ] && [ -e "/opt/pakfire/db/meta/meta-krb5" ]; then
171 /opt
/pakfire
/db
/installed
/meta-krb5 \
172 /opt
/pakfire
/db
/meta
/meta-krb5 \
173 /opt
/pakfire
/db
/rootfiles
/krb5
176 # libtiff is now part of the core system, remove Pakfire metadata for it
177 if [ -e "/opt/pakfire/db/installed/meta-libtiff" ] && [ -e "/opt/pakfire/db/meta/meta-libtiff" ]; then
179 /opt
/pakfire
/db
/installed
/meta-libtiff \
180 /opt
/pakfire
/db
/meta
/meta-libtiff \
181 /opt
/pakfire
/db
/rootfiles
/libtiff
184 # This update needs a reboot...
185 touch /var
/run
/need_reboot
188 /etc
/init.d
/fireinfo start
191 # remove lm_sensor config after collectd was started
192 # to reserch sensors at next boot with updated kernel
193 rm -f /etc
/sysconfig
/lm_sensors
195 # Upadate Kernel version in uEnv.txt
196 if [ -e /boot
/uEnv.txt
]; then
197 sed -i -e "s/KVER=.*/KVER=${KVER}/g" /boot
/uEnv.txt
200 # Call user update script (needed for some ARM boards)
201 if [ -e /boot
/pakfire-kernel-update
]; then
202 /boot
/pakfire-kernel-update
${KVER}
205 # Update grub config to display new core version
206 if [ -e /boot
/grub
/grub.cfg
]; then
207 grub-mkconfig
-o /boot
/grub
/grub.cfg
212 # Don't report the exitcode last command