diff options
-rw-r--r-- | fsmgr.hs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -88,7 +88,7 @@ buildRoot DiskImageConfig{..} finalOut = do | |||
88 | {- 5. create a backup snapshot -} | 88 | {- 5. create a backup snapshot -} |
89 | cmd_ "umount" [mountpoint] | 89 | cmd_ "umount" [mountpoint] |
90 | cmd_ "mount -t btrfs -o subvol=/" [out, mountpoint] | 90 | cmd_ "mount -t btrfs -o subvol=/" [out, mountpoint] |
91 | flip actionCatch (\(SomeException _) -> return ()) $ cmd_ "btrfs subvolume delete" [mountpoint </> "root~orig"] | 91 | ignoreErrors $ cmd_ "btrfs subvolume delete" [mountpoint </> "root~orig"] |
92 | cmd_ "btrfs subvolume snapshot -r" [mountpoint </> "root", mountpoint </> "root~orig"] | 92 | cmd_ "btrfs subvolume snapshot -r" [mountpoint </> "root", mountpoint </> "root~orig"] |
93 | 93 | ||
94 | -- cleanup | 94 | -- cleanup |
@@ -97,6 +97,9 @@ buildRoot DiskImageConfig{..} finalOut = do | |||
97 | cmd_ "btrfstune -S1" [out] | 97 | cmd_ "btrfstune -S1" [out] |
98 | cmd_ "mv" [out, finalOut] | 98 | cmd_ "mv" [out, finalOut] |
99 | 99 | ||
100 | ignoreErrors :: Action () -> Action () | ||
101 | ignoreErrors = flip actionCatch (\(SomeException _) -> return ()) | ||
102 | |||
100 | partitionPackages :: [String] -> ([String], [String]) | 103 | partitionPackages :: [String] -> ([String], [String]) |
101 | partitionPackages = partition (elem '/') | 104 | partitionPackages = partition (elem '/') |
102 | 105 | ||