mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
Merge branch 'next'
This commit is contained in:
35
config/rootfiles/oldcore/183/exclude
Normal file
35
config/rootfiles/oldcore/183/exclude
Normal file
@@ -0,0 +1,35 @@
|
||||
boot/config.txt
|
||||
boot/grub/grub.cfg
|
||||
boot/grub/grubenv
|
||||
boot/uEnv.txt
|
||||
etc/alternatives
|
||||
etc/collectd.custom
|
||||
etc/default/grub
|
||||
etc/ipsec.conf
|
||||
etc/ipsec.secrets
|
||||
etc/ipsec.user.conf
|
||||
etc/ipsec.user.secrets
|
||||
etc/localtime
|
||||
etc/shadow
|
||||
etc/snort/snort.conf
|
||||
etc/ssl/openssl.cnf
|
||||
etc/sudoers
|
||||
etc/sysconfig/firewall.local
|
||||
etc/sysconfig/rc.local
|
||||
etc/udev/rules.d/30-persistent-network.rules
|
||||
srv/web/ipfire/html/proxy.pac
|
||||
var/ipfire/dma
|
||||
var/ipfire/time
|
||||
var/ipfire/firewall/locationblock
|
||||
var/ipfire/fwhosts/customlocationgrp
|
||||
var/ipfire/ovpn
|
||||
var/ipfire/urlfilter/blacklist
|
||||
var/ipfire/urlfilter/settings
|
||||
var/lib/alternatives
|
||||
var/lib/location/database.db
|
||||
var/lib/location/ipset
|
||||
var/log/cache
|
||||
var/log/dhcpcd.log
|
||||
var/log/messages
|
||||
var/state/dhcp/dhcpd.leases
|
||||
var/updatecache
|
||||
1
config/rootfiles/oldcore/183/filelists/aarch64/glibc
Symbolic link
1
config/rootfiles/oldcore/183/filelists/aarch64/glibc
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/aarch64/glibc
|
||||
1
config/rootfiles/oldcore/183/filelists/aarch64/grub
Symbolic link
1
config/rootfiles/oldcore/183/filelists/aarch64/grub
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/aarch64/grub
|
||||
1
config/rootfiles/oldcore/183/filelists/aarch64/linux
Symbolic link
1
config/rootfiles/oldcore/183/filelists/aarch64/linux
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/aarch64/linux
|
||||
1
config/rootfiles/oldcore/183/filelists/apache2
Symbolic link
1
config/rootfiles/oldcore/183/filelists/apache2
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/apache2
|
||||
1
config/rootfiles/oldcore/183/filelists/bash
Symbolic link
1
config/rootfiles/oldcore/183/filelists/bash
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/bash
|
||||
1
config/rootfiles/oldcore/183/filelists/bind
Symbolic link
1
config/rootfiles/oldcore/183/filelists/bind
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/bind
|
||||
5
config/rootfiles/oldcore/183/filelists/core-files
Normal file
5
config/rootfiles/oldcore/183/filelists/core-files
Normal file
@@ -0,0 +1,5 @@
|
||||
etc/system-release
|
||||
etc/issue
|
||||
etc/os-release
|
||||
srv/web/ipfire/cgi-bin/credits.cgi
|
||||
var/ipfire/langs
|
||||
1
config/rootfiles/oldcore/183/filelists/cpio
Symbolic link
1
config/rootfiles/oldcore/183/filelists/cpio
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/cpio
|
||||
1
config/rootfiles/oldcore/183/filelists/dracut
Symbolic link
1
config/rootfiles/oldcore/183/filelists/dracut
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/dracut
|
||||
10
config/rootfiles/oldcore/183/filelists/files
Normal file
10
config/rootfiles/oldcore/183/filelists/files
Normal file
@@ -0,0 +1,10 @@
|
||||
etc/rc.d/init.d/firewall
|
||||
etc/rc.d/init.d/mountfs
|
||||
etc/rc.d/init.d/networking/red.up/60-collectd
|
||||
srv/web/ipfire/cgi-bin/dhcp.cgi
|
||||
srv/web/ipfire/cgi-bin/proxy.cgi
|
||||
srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat
|
||||
srv/web/ipfire/cgi-bin/vpnmain.cgi
|
||||
usr/local/bin/backupiso
|
||||
var/ipfire/backup/bin/backup.pl
|
||||
var/ipfire/header.pl
|
||||
1
config/rootfiles/oldcore/183/filelists/fontconfig
Symbolic link
1
config/rootfiles/oldcore/183/filelists/fontconfig
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/fontconfig
|
||||
1
config/rootfiles/oldcore/183/filelists/gnutls
Symbolic link
1
config/rootfiles/oldcore/183/filelists/gnutls
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/gnutls
|
||||
1
config/rootfiles/oldcore/183/filelists/iptables
Symbolic link
1
config/rootfiles/oldcore/183/filelists/iptables
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/iptables
|
||||
1
config/rootfiles/oldcore/183/filelists/iputils
Symbolic link
1
config/rootfiles/oldcore/183/filelists/iputils
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/iputils
|
||||
1
config/rootfiles/oldcore/183/filelists/kbd
Symbolic link
1
config/rootfiles/oldcore/183/filelists/kbd
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/kbd
|
||||
1
config/rootfiles/oldcore/183/filelists/kmod
Symbolic link
1
config/rootfiles/oldcore/183/filelists/kmod
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/kmod
|
||||
1
config/rootfiles/oldcore/183/filelists/lcms2
Symbolic link
1
config/rootfiles/oldcore/183/filelists/lcms2
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/lcms2
|
||||
1
config/rootfiles/oldcore/183/filelists/libgcrypt
Symbolic link
1
config/rootfiles/oldcore/183/filelists/libgcrypt
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/libgcrypt
|
||||
1
config/rootfiles/oldcore/183/filelists/libhtp
Symbolic link
1
config/rootfiles/oldcore/183/filelists/libhtp
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/libhtp
|
||||
1
config/rootfiles/oldcore/183/filelists/libnl-3
Symbolic link
1
config/rootfiles/oldcore/183/filelists/libnl-3
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/libnl-3
|
||||
1
config/rootfiles/oldcore/183/filelists/libssh
Symbolic link
1
config/rootfiles/oldcore/183/filelists/libssh
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/libssh
|
||||
1
config/rootfiles/oldcore/183/filelists/libxml2
Symbolic link
1
config/rootfiles/oldcore/183/filelists/libxml2
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/libxml2
|
||||
1
config/rootfiles/oldcore/183/filelists/lmdb
Symbolic link
1
config/rootfiles/oldcore/183/filelists/lmdb
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/lmdb
|
||||
1
config/rootfiles/oldcore/183/filelists/lsof
Symbolic link
1
config/rootfiles/oldcore/183/filelists/lsof
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/lsof
|
||||
1
config/rootfiles/oldcore/183/filelists/openssh
Symbolic link
1
config/rootfiles/oldcore/183/filelists/openssh
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/openssh
|
||||
1
config/rootfiles/oldcore/183/filelists/openssl
Symbolic link
1
config/rootfiles/oldcore/183/filelists/openssl
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/openssl
|
||||
1
config/rootfiles/oldcore/183/filelists/p11-kit
Symbolic link
1
config/rootfiles/oldcore/183/filelists/p11-kit
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/p11-kit
|
||||
1
config/rootfiles/oldcore/183/filelists/qpdf
Symbolic link
1
config/rootfiles/oldcore/183/filelists/qpdf
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/qpdf
|
||||
1
config/rootfiles/oldcore/183/filelists/riscv64/glibc
Symbolic link
1
config/rootfiles/oldcore/183/filelists/riscv64/glibc
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/riscv64/glibc
|
||||
1
config/rootfiles/oldcore/183/filelists/riscv64/grub
Symbolic link
1
config/rootfiles/oldcore/183/filelists/riscv64/grub
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/riscv64/grub
|
||||
1
config/rootfiles/oldcore/183/filelists/riscv64/linux
Symbolic link
1
config/rootfiles/oldcore/183/filelists/riscv64/linux
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/riscv64/linux
|
||||
1
config/rootfiles/oldcore/183/filelists/strongswan
Symbolic link
1
config/rootfiles/oldcore/183/filelists/strongswan
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/strongswan
|
||||
1
config/rootfiles/oldcore/183/filelists/sudo
Symbolic link
1
config/rootfiles/oldcore/183/filelists/sudo
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/sudo
|
||||
1
config/rootfiles/oldcore/183/filelists/suricata
Symbolic link
1
config/rootfiles/oldcore/183/filelists/suricata
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/suricata
|
||||
1
config/rootfiles/oldcore/183/filelists/tzdata
Symbolic link
1
config/rootfiles/oldcore/183/filelists/tzdata
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/tzdata
|
||||
1
config/rootfiles/oldcore/183/filelists/web-user-interface
Symbolic link
1
config/rootfiles/oldcore/183/filelists/web-user-interface
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../common/web-user-interface
|
||||
1
config/rootfiles/oldcore/183/filelists/x86_64/glibc
Symbolic link
1
config/rootfiles/oldcore/183/filelists/x86_64/glibc
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/x86_64/glibc
|
||||
1
config/rootfiles/oldcore/183/filelists/x86_64/grub
Symbolic link
1
config/rootfiles/oldcore/183/filelists/x86_64/grub
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/x86_64/grub
|
||||
1
config/rootfiles/oldcore/183/filelists/x86_64/linux
Symbolic link
1
config/rootfiles/oldcore/183/filelists/x86_64/linux
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../common/x86_64/linux
|
||||
186
config/rootfiles/oldcore/183/update.sh
Normal file
186
config/rootfiles/oldcore/183/update.sh
Normal file
@@ -0,0 +1,186 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# #
|
||||
# This file is part of the IPFire Firewall. #
|
||||
# #
|
||||
# IPFire is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPFire is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPFire; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Copyright (C) 2024 IPFire-Team <info@ipfire.org>. #
|
||||
# #
|
||||
############################################################################
|
||||
#
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
/usr/local/bin/backupctrl exclude >/dev/null 2>&1
|
||||
|
||||
core=183
|
||||
|
||||
exit_with_error() {
|
||||
# Set last succesfull installed core.
|
||||
echo $(($core-1)) > /opt/pakfire/db/core/mine
|
||||
# force fsck at next boot, this may fix free space on xfs
|
||||
touch /forcefsck
|
||||
# don't start pakfire again at error
|
||||
killall -KILL pak_update
|
||||
/usr/bin/logger -p syslog.emerg -t ipfire \
|
||||
"core-update-${core}: $1"
|
||||
exit $2
|
||||
}
|
||||
|
||||
# Remove old core updates from pakfire cache to save space...
|
||||
for (( i=1; i<=$core; i++ )); do
|
||||
rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
|
||||
done
|
||||
|
||||
# Stop services
|
||||
/etc/rc.d/init.d/ipsec stop
|
||||
/etc/rc.d/init.d/apache stop
|
||||
/etc/rc.d/init.d/sshd stop
|
||||
|
||||
KVER="xxxKVERxxx"
|
||||
|
||||
# Backup uEnv.txt if exist
|
||||
if [ -e /boot/uEnv.txt ]; then
|
||||
cp -vf /boot/uEnv.txt /boot/uEnv.txt.org
|
||||
fi
|
||||
|
||||
# Do some sanity checks prior to the kernel update
|
||||
case $(uname -r) in
|
||||
*-ipfire*)
|
||||
# Ok.
|
||||
;;
|
||||
*)
|
||||
exit_with_error "ERROR cannot update. No IPFire Kernel." 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check diskspace on root and size of boot
|
||||
ROOTSPACE=$( df / -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1 )
|
||||
if [ $ROOTSPACE -lt 200000 ]; then
|
||||
exit_with_error "ERROR cannot update because not enough free space on root." 2
|
||||
fi
|
||||
BOOTSIZE=$( df /boot -Pk | sed "s| * | |g" | cut -d" " -f2 | tail -n 1 )
|
||||
if [ $BOOTSIZE -lt 100000 ]; then
|
||||
exit_with_error "ERROR cannot update. BOOT partition is to small." 3
|
||||
fi
|
||||
|
||||
# Remove the old kernel
|
||||
rm -rvf \
|
||||
/boot/System.map-* \
|
||||
/boot/config-* \
|
||||
/boot/ipfirerd-* \
|
||||
/boot/initramfs-* \
|
||||
/boot/vmlinuz-* \
|
||||
/boot/uImage-* \
|
||||
/boot/zImage-* \
|
||||
/boot/uInit-* \
|
||||
/boot/dtb-* \
|
||||
/lib/modules
|
||||
|
||||
# Extract files
|
||||
extract_files
|
||||
|
||||
# Remove files
|
||||
rm -rvf \
|
||||
/etc/fonts/conf.d/10-sub-pixel-rgb.conf \
|
||||
/srv/web/ipfire/html/themes/ipfire/images \
|
||||
/usr/lib/libbind9-9.16.44.so \
|
||||
/usr/lib/libdns-9.16.44.so \
|
||||
/usr/lib/libirs-9.16.44.so \
|
||||
/usr/lib/libisc-9.16.44.so \
|
||||
/usr/lib/libisccc-9.16.44.so \
|
||||
/usr/lib/libisccfg-9.16.44.so \
|
||||
/usr/lib/libns-9.16.44.so \
|
||||
/usr/lib/libxml2.so.2.11*
|
||||
|
||||
# update linker config
|
||||
ldconfig
|
||||
|
||||
# Update Language cache
|
||||
/usr/local/bin/update-lang-cache
|
||||
|
||||
# Filesytem cleanup
|
||||
/usr/local/bin/filesystem-cleanup
|
||||
|
||||
# Relaunch init
|
||||
telinit u
|
||||
|
||||
# Apply local configuration to sshd_config
|
||||
/usr/local/bin/sshctrl
|
||||
|
||||
# Fix permissions of /etc/sudoers.d/
|
||||
chmod -v 750 /etc/sudoers.d
|
||||
chmod -v 640 /etc/sudoers.d/*
|
||||
|
||||
# Check apache rsa key and replace if it is too small
|
||||
KEYSIZE=$(openssl rsa -in /etc/httpd/server.key -text -noout | sed -n 's/Private-Key:\ (\(.*\)\ bit.*/\1/p')
|
||||
if [ $KEYSIZE \< 2048 ]; then
|
||||
echo "Generating new HTTPS RSA server key (this will take a moment)..."
|
||||
openssl genrsa -out /etc/httpd/server.key 4096 &>/dev/null
|
||||
chmod 600 /etc/httpd/server.key
|
||||
sed "s/HOSTNAME/`hostname -f`/" < /etc/certparams | \
|
||||
openssl req -new -key /etc/httpd/server.key \
|
||||
-out /etc/httpd/server.csr &>/dev/null
|
||||
openssl x509 -req -days 999999 -sha256 \
|
||||
-in /etc/httpd/server.csr \
|
||||
-signkey /etc/httpd/server.key \
|
||||
-out /etc/httpd/server.crt &>/dev/null
|
||||
fi
|
||||
|
||||
# Start services
|
||||
/etc/rc.d/init.d/apache start
|
||||
if grep -q "ENABLE_SSH=on" /var/ipfire/remote/settings; then
|
||||
/etc/init.d/sshd start
|
||||
fi
|
||||
if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then
|
||||
/etc/rc.d/init.d/ipsec start
|
||||
fi
|
||||
/etc/init.d/suricata restart
|
||||
|
||||
# Rebuild initial ramdisks
|
||||
dracut --regenerate-all --force
|
||||
KVER="xxxKVERxxx"
|
||||
case "$(uname -m)" in
|
||||
aarch64)
|
||||
mkimage -A arm64 -T ramdisk -C lzma -d /boot/initramfs-${KVER}-ipfire.img /boot/uInit-${KVER}-ipfire
|
||||
# dont remove initramfs because grub need this to boot.
|
||||
;;
|
||||
esac
|
||||
|
||||
# Upadate Kernel version in uEnv.txt
|
||||
if [ -e /boot/uEnv.txt ]; then
|
||||
sed -i -e "s/KVER=.*/KVER=${KVER}/g" /boot/uEnv.txt
|
||||
fi
|
||||
|
||||
# Call user update script (needed for some ARM boards)
|
||||
if [ -e /boot/pakfire-kernel-update ]; then
|
||||
/boot/pakfire-kernel-update ${KVER}
|
||||
fi
|
||||
|
||||
# This update needs a reboot...
|
||||
touch /var/run/need_reboot
|
||||
|
||||
# Finish
|
||||
/etc/init.d/fireinfo start
|
||||
sendprofile
|
||||
|
||||
# Update grub config to display new core version
|
||||
if [ -e /boot/grub/grub.cfg ]; then
|
||||
/usr/bin/install-bootloader
|
||||
fi
|
||||
|
||||
sync
|
||||
|
||||
# Don't report the exitcode last command
|
||||
exit 0
|
||||
Reference in New Issue
Block a user