From 160ccc9e93284ad567f476beb32620bb1e0e33b7 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Tue, 27 Mar 2012 14:25:16 +0000 Subject: Add a few btrfs filesystem sync calls for debugging. --- tb-switch/tb-switch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tb-switch') diff --git a/tb-switch/tb-switch b/tb-switch/tb-switch index 79568d5..d9e0ad6 100755 --- a/tb-switch/tb-switch +++ b/tb-switch/tb-switch @@ -17,7 +17,6 @@ # vi:set ts=8 sw=8 noet ai nocindent: set -e -set -x # read input parameters device="$1" @@ -49,12 +48,14 @@ fi if [ -e "$target_subvolume-run" ]; then echo "Deleting existing snapshot \"$target_subvolume-run\"" btrfs subvolume delete "$target_subvolume-run" + btrfs filesystem sync . fi echo "Creating snapshot \"$target_subvolume-run\" from \"$target_subvolume\"" # create a a new -run snapshot for the target subvolume btrfs subvolume snapshot "$target_subvolume" "$target_subvolume-run" +btrfs filesystem sync . echo "Copying boot files to the root file system" @@ -62,10 +63,12 @@ echo "Copying boot files to the root file system" busybox cp "$target_subvolume/boot/vmlinuz" "boot/vmlinuz" busybox cp "$target_subvolume/boot/System.map" "boot/System.map" busybox cp "$target_subvolume/extlinux.conf" "extlinux.conf" +btrfs filesystem sync . echo "Configuring extlinux to boot from \"$target_subvolume-run\"" busybox sed -i -e "s,factory-run,$target_subvolume-run,g" "extlinux.conf" +btrfs filesystem sync . # clear the traps trap - EXIT SIGINT SIGTERM -- cgit v1.2.1