summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-22 22:44:21 -0400
committerAndrew Cady <d@jerkface.net>2016-04-22 22:45:17 -0400
commit34ed3df8b210461ae217424c089d917fb300a824 (patch)
treeb513781de301c77c01e07963bf02a36b8c4a5b10
parentaf63aae1fdeb8c6456614b840b055aef02b64395 (diff)
fix btrfs receive script to properly set up seed subvolumes
-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