Skip to content

fix(makechrootpkg): improve btrfs sanity checks

Christian Heusel requested to merge fix-subvolume-check into master

If the chroot was created in a way where it resides on a BTRFS file system but "$copydir/root" is not a snapshot an error like the following would be emitted:

$ makechrootpkg -r ~/chroot
==> Synchronizing chroot copy [/home/chris/chroot/root] -> [chris]...ERROR: Not a Btrfs subvolume: Invalid argument
==> ERROR: Unable to create subvolume /home/chris/chroot/chris

Fix this by adding an additional check, which detects if the folder is actually the root of a BTRFS snapshot before attempting to clone it.

Superseeds !259


cc @bboozzoo & @lahwaacz

Merge request reports