From de5ba932e8ed8b7c2842d360ce14da609836609e Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 25 Jun 2023 21:53:39 -0400 Subject: new btrfs subvolume gets ownership/permissions from its parent dir --- fsmgr.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fsmgr.hs') diff --git a/fsmgr.hs b/fsmgr.hs index 8036734..f3d7af0 100644 --- a/fsmgr.hs +++ b/fsmgr.hs @@ -478,7 +478,10 @@ ioUnless :: MonadIO m => IO Bool -> m () -> m () ioUnless test act = liftIO test >>= (`unless` act) needSubvolume :: FilePath -> Action () -needSubvolume path = ioUnless (IO.doesDirectoryExist path) $ cmd_ "btrfs subvolume create" [path] +needSubvolume path = ioUnless (IO.doesDirectoryExist path) $ do + cmd_ "btrfs subvolume create" [path] + cmd_ "chmod" ["--reference="++path++"/.."] [path] + cmd_ "chown" ["--reference="++path++"/.."] [path] shakeRules :: Rules () shakeRules = do -- cgit v1.2.3