[arch-projects] [devtools] [PATCH] makechrootpkg: Delete subvolumes recursively

Luke Shumaker lukeshu at sbcglobal.net
Fri Feb 10 08:43:18 UTC 2017


> Some packages end up creating subvolumes through systemd-tmpfiles, (e.g.
> systemd-nspawn,) so we need to delete those as well, but there's no way
> to reliably list subvolumes under a certain subvolume relative to the
> filesystem, so we need a hard-coded list.

Actually there is, it just turns out to be really tricky.

Now, it is impossible to correctly deal with spaces in the paths
(thanks to the not-quite machine readable output from `btrfs subvolume
list`); so Dave's comments about safe xargs use are moot.  In my
solution I used a `while read -r` loop, to make exiting on error
easier; xargs only terminates early if the process fails with 255.

-- 
Happy hacking,
~ Luke Shumaker


More information about the arch-projects mailing list