+
+# Save Debian configuration:
+DPKG_CONFIG="/tmp/$(hostname)-dpkg-config"
+
+# List of files/directories to backup:
+BKP_FILES_LIST="\
+ /etc \
+ /root \
+ /opt \
+ /usr/local/bin \
+ ${DPKG_CONFIG} \
+"
+
+# Additional translations: example /mnt/projets --> archive_label/projets
+DIR_OPTS="--transform "s@/mnt/projets/@${archive_label}/projets/@" ${DIR_OPTS}"
+
+# DPKG_CONFIG: Translate /tmp --> archive_label
+DIR_OPTS="--transform "s@/tmp/@${archive_label}/@" ${DIR_OPTS}"
+
+# Files to exclude from backup:
+cat >> ${EXC_LIST} << "EOF"
+ /opt/brave*
+ /opt/containerd
+EOF
+
+hvbackup_pre_script()
+{
+ dpkg --list > ${DPKG_CONFIG}
+
+ # Special case for linux and u-boot repos:
+ for d in linux u-boot; do
+ log_dbg "Clean repos: ${d}"
+ cd ${d}
+ make mrproper 1> /dev/null 2>&1
+ done
+}
+
+hvbackup_post_script()
+{
+ rm -f ${DPKG_CONFIG}
+}