From 5e30738231ced6bfbfb603742a40265e7eef1113 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Wed, 7 Nov 2012 21:13:45 +0100 Subject: [PATCH] updater: remove double files from backup. Add some missed files. --- config/rootfiles/core/65/filelists/files | 2 +- config/rootfiles/core/65/filelists/setup | 1 + config/rootfiles/core/65/update.sh | 33 +++++++++++++++++------- 3 files changed, 26 insertions(+), 10 deletions(-) create mode 120000 config/rootfiles/core/65/filelists/setup diff --git a/config/rootfiles/core/65/filelists/files b/config/rootfiles/core/65/filelists/files index 6d0030e782..62756fa6c5 100644 --- a/config/rootfiles/core/65/filelists/files +++ b/config/rootfiles/core/65/filelists/files @@ -15,6 +15,6 @@ srv/web/ipfire/cgi-bin/qos.cgi srv/web/ipfire/cgi-bin/services.cgi srv/web/ipfire/cgi-bin/updatexlrator.cgi srv/web/ipfire/cgi-bin/vpnmain.cgi -usr/local/sbin/setup var/ipfire/langs var/ipfire/qos/bin/makeqosscripts.pl +usr/local/bin/readhash diff --git a/config/rootfiles/core/65/filelists/setup b/config/rootfiles/core/65/filelists/setup new file mode 120000 index 0000000000..209374bbcf --- /dev/null +++ b/config/rootfiles/core/65/filelists/setup @@ -0,0 +1 @@ +../../../common/setup \ No newline at end of file diff --git a/config/rootfiles/core/65/update.sh b/config/rootfiles/core/65/update.sh index 6335e1dda5..0f1d4310ad 100644 --- a/config/rootfiles/core/65/update.sh +++ b/config/rootfiles/core/65/update.sh @@ -24,6 +24,15 @@ . /opt/pakfire/lib/functions.sh /usr/local/bin/backupctrl exclude >/dev/null 2>&1 +function add_to_backup () +{ + # Add path to ROOTFILES but remove old entries to prevent double + # files in the tar + grep -v "^$1" /opt/pakfire/tmp/ROOTFILES > /opt/pakfire/tmp/ROOTFILES.tmp + mv /opt/pakfire/tmp/ROOTFILES.tmp /opt/pakfire/tmp/ROOTFILES + echo $1 >> /opt/pakfire/tmp/ROOTFILES +} + # # Remove old core updates from pakfire cache to save space... core=65 @@ -52,12 +61,13 @@ fi echo First we made a backup of all files that was inside of the echo update archive. This may take a while ... # Add some files that are not in the package to backup -echo lib/modules >> /opt/pakfire/tmp/ROOTFILES -echo etc/udev >> /opt/pakfire/tmp/ROOTFILES -echo lib/udev >> /opt/pakfire/tmp/ROOTFILES -echo boot >> /opt/pakfire/tmp/ROOTFILES -echo etc/snort >> /opt/pakfire/tmp/ROOTFILES -echo usr/lib/snort_* >> /opt/pakfire/tmp/ROOTFILES +add_to_backup lib/modules +add_to_backup etc/udev +add_to_backup lib/udev +add_to_backup boot +add_to_backup etc/snort +add_to_backup usr/lib/snort_* +add_to_backup usr/share/zoneinfo # Backup the files tar cJvf /var/ipfire/backup/core-upgrade_$KVER.tar.xz \ @@ -76,12 +86,16 @@ rm -rf /lib/modules/*-ipfire # # Remove old udev rules. # -cp /etc/udev/rules.d/29-ct-server-network.rules /tmp/ +if [ -e /etc/udev/rules.d/29-ct-server-network.rules ]; then + cp /etc/udev/rules.d/29-ct-server-network.rules /tmp/ +fi cp /etc/udev/rules.d/30-persistent-network.rules /tmp/ rm -rf /etc/udev rm -rf /lib/udev mkdir -p /etc/udev/rules.d -mv /tmp/29-ct-server-network.rules /etc/udev/rules.d/ +if [ -e /tmp/rules.d/29-ct-server-network.rules ]; then + mv /tmp/29-ct-server-network.rules /etc/udev/rules.d/ +fi mv /tmp/30-persistent-network.rules /etc/udev/rules.d/ # @@ -95,9 +109,10 @@ cp -vf /boot/grub/grub.conf /boot/grub/grub.conf.org /etc/init.d/squid stop /etc/init.d/ipsec stop -#Remove old snort +#Remove old snort and zoneinfo rm -rf /etc/snort rm -rf /usr/lib/snort_* +rm -rf /usr/share/zoneinfo # #Extract files -- 2.39.5