As the title said, during the tftpd
upgrade, the update script deleted /var/tftpboot
directory (iPXE scripts, pxelinux.cfg scripts, various GNU/Linux installations that are mounted via NFS, everything)
-bash-5.2$ ps -ef|grep tftp
root 32303 28676 0 23:33 pts/1 00:00:00 sh -c cd /opt/pakfire/tmp && NAME=tftpd ./update.sh >> /opt/pakfire/logs/update-tftpd.log 2>&1
-bash-5.2$ cd /opt/pakfire/tmp
-bash-5.2$ cat update.sh
#!/bin/bash
. /opt/pakfire/lib/functions.sh
extract_backup_includes
./uninstall.sh <---
./install.sh
-bash-5.2$ cat uninstall.sh
#!/bin/bash
. /opt/pakfire/lib/functions.sh
stop_service tftpd
make_backup ${NAME}
remove_files <---
rm -rf /etc/rc.d/rc*.d/*tftpd
-bash-5.2$ view /opt/pakfire/lib/functions.sh
. /etc/sysconfig/rc
. $rc_functions
TAR_OPTIONS=(
--acls
--xattrs
--xattrs-include='*'
--no-overwrite-dir
--no-delay-directory-restore
--preserve-permissions
--numeric-owner
)
extract_files() {
echo "Extracting files..."
tar -xavf /opt/pakfire/tmp/files* "${TAR_OPTIONS[@]}" -C /
sync
echo "...Finished."
}
extract_backup_includes() {
echo "Extracting backup includes..."
tar xavf /opt/pakfire/tmp/files* "${TAR_OPTIONS[@]}" -C / \
var/ipfire/backup/addons/includes
sync
echo "...Finished."
}
remove_files() { <---
echo "Removing files..."
for i in $(cat /opt/pakfire/db/rootfiles/${NAME}); do
rm -rfv /${i}
done
echo "...Finished."
}
-bash-5.2$ cat /opt/pakfire/db/rootfiles/tftp
etc/rc.d/init.d/tftpd
usr/bin/tftp
usr/sbin/tftpd
var/tftpboot
There’s nothing here that I cannot recover from because all scripts are in my self-hosted gitea instance and I can just debootstrap the GNU/Linux installs again anyway but there are a couple of issues here:
tftpd
addon doesn’t come with it’s own/var/ipfire/backup/addons/includes
file- If an
includes
file is made part of thetftpd
addon, should it even include the/var/tftpboot
? I ask this because themake_backup
function backs up everything from the includes file of an addon. Given that the/var/tftpboot
will potentially have lots of files and is ideally on a separate disk from the iPFire installation - in my case it’s on an NFS mount - which will not only prolong the upgrade but more importantly fill up the IPFire filesystem
And lastly, do changes done manually to files in /var/ipfire/backup/addons/includes
remain after an addon gets upgraded?