require "/opt/pakfire/etc/pakfire.conf";
require "/var/ipfire/general-functions.pl";
+require "${General::swroot}/filesystem-functions.pl";
use File::Basename;
use File::Copy;
foreach $release (@seq) {
chomp($release);
+
+ # Create a snapshot on systems with BTRFS on root.
+ if (&Filesystem::is_btrfs("/")) {
+ # Generate snapshot name.
+ my $snapshotname = "auto-update-to-core-" . "$release";
+
+ # Log a message.
+ message("CORE UPGR: Creating automatic BTRFS snapshot (\"$snapshotname\")");
+
+ # Create the snapshot.
+ &Filesystem::btrfs_create_snapshot("$snapshotname");
+ }
+
+ # Install the core update.
upgradepak("core-upgrade-$release");
}