Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#34749 - [devtools] makechrootpkg: btrfs subvol logic fails if $copydir is mountpoint

Attached to Project: Arch Linux
Opened by WorMzy Tykashi (WorMzy) - Friday, 12 April 2013, 13:37 GMT
Last edited by Pierre Schmitz (Pierre) - Saturday, 02 November 2013, 07:37 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No


Description: There is logic in place to detect whether the root chroot's $chroottype is btrfs, and if it is, make use of the btrfs subvol delete/snapshot features to create a clean copy. This erroneously assumes that, if the root chroot (e.g. /var/lib/archbuild/extra-x86_64/root) is a btrfs subvolume, then the user chroot (e.g. /var/lib/archbuild/extra-x86_64/user), if it exists, will be a btrfs subvolume too. It may actually be a mount point, as is the case in my situation, where it is a 15G tmpfs. Other users may have a similar set up due to HDD space limitations, worries about excessive reading/writing wearing out a HDD, the voices in their head telling them to do it, etc.

Currently the script dies, complaining that $copydir is not a subvolume, when it should (in my opinion) fall back on the traditional/non-btrfs rsync command, which works fine.

Attached is a tiny patch that adds in an additional check to the initial btrfs check. It also includes a typo fix (directoy => directory) which I forgot to remove from the patch and don't think is worth opening a separate bug report for.

Additional info:

extra-x86_64-build output:
==> Building in chroot for [extra] (x86_64)...
==> Creating clean working copy [user]...ERROR: '/var/lib/archbuild/extra-x86_64/user' is not a subvolume
==> ERROR: Unable to delete subvolume /var/lib/archbuild/extra-x86_64/user

Steps to reproduce:
Have a filesystem mounted at a user chroot location, then run a helper script (e.g. extra-x86_64-build) in a directory with a PKGBUILD, etc.
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Saturday, 02 November 2013, 07:37 GMT
Reason for closing:  Fixed
Comment by Jelle van der Waa (jelly) - Sunday, 15 September 2013, 11:21 GMT
It might help to rebase the patch and send it to using for example this script
./git-archprojects devtools master
git send-mail patch
Comment by Dave Reisner (falconindy) - Sunday, 15 September 2013, 14:19 GMT
Please drop the subshell around the mountpoint call -- it's quite useless. You can also use the -q flag instead of dumping output to /dev/null.
Comment by WorMzy Tykashi (WorMzy) - Sunday, 15 September 2013, 23:30 GMT
@Dave: Thanks for those suggestions, I've made the changes.

@Jelle: I don't have permission to post to the arch-projects mailing list, so my message was automatically rejected. I've attached the prepared patch here instead. :)

Comment by Dave Reisner (falconindy) - Sunday, 15 September 2013, 23:32 GMT
arch-projects is an open mailing list, you only need to subscribe to it....
Comment by WorMzy Tykashi (WorMzy) - Sunday, 15 September 2013, 23:37 GMT
Oh, oops.

I've submitted it now. Thanks for pointing that out.