summaryrefslogtreecommitdiff
path: root/btrfs-receive-root.sh
diff options
context:
space:
mode:
Diffstat (limited to 'btrfs-receive-root.sh')
-rw-r--r--btrfs-receive-root.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/btrfs-receive-root.sh b/btrfs-receive-root.sh
index 175dd49..62504bf 100644
--- a/btrfs-receive-root.sh
+++ b/btrfs-receive-root.sh
@@ -22,9 +22,14 @@ create_layer_filesystem()
22 22
23finish() 23finish()
24{ 24{
25 btrfs_replace_default_subvolume_with "$mountpoint"/"$receive_subv" && 25 local subv_id
26 umount "$mountpoint" && 26 mv "$mountpoint"/ROOT "$mountpoint"/ROOT.old || return
27 sex btrfstune -S1 "$layer_file" && 27 btrfs subvolume snapshot "$mountpoint"/"$receive_subv" "$mountpoint"/ROOT || return
28 subv_id=$(btrfs_show_subvolume_id "$mountpoint"/ROOT) || return
29 btrfs subvolume set-default "$subv_id" "$mountpoint" || return
30 btrfs subvolume delete "$mountpoint"/ROOT.old || return
31 umount "$mountpoint" || return
32 sex btrfstune -S1 "$layer_file" || return
28 losetup -d "$layer_dev" 33 losetup -d "$layer_dev"
29} 34}
30 35