Skip to content

Draft: feat: modularize support for snapshotting file systems

Thomas Eberhardt requested to merge ed209/devtools:modular_fs into master

Move the support for snapshotting file systems into separate modules. archroot.sh now includes three functions fs_create_chroot, fs_sync_chroot, and fs_delete_chroot which are used instead of the previously hard-coded support for btrfs.

File system modules must implement four functions and add themselves to the DEVTOOLS_FS_MODULE array. For example, for btrfs.sh these are is_btrfs, btrfs_create_chroot, btrfs_sync_chroot, btrfs_delete_chroot, and the file system name "btrfs".

simplefs.sh implements the functions for non-snapshotting file systems.

Also included is a module for ZFS.

A new tool deletechroots is added with the intend that it be used in the AUR package clean-chroot-manager, which currently has custom code for deleting all chroots. The custom code would be replaced with a call to deletechroots, and make clean-chroot-manager support the same file systems as devtools. This tool is now also used by archbuild and makerepropkg.

This feature makes it easy to add support for new snapshotting file systems (like bcachefs) in the future.

Merge request reports

Loading