summaryrefslogtreecommitdiff
path: root/src/initrd/samizdat-eject.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/initrd/samizdat-eject.sh')
-rwxr-xr-xsrc/initrd/samizdat-eject.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/initrd/samizdat-eject.sh b/src/initrd/samizdat-eject.sh
index d95a49d..a950ec5 100755
--- a/src/initrd/samizdat-eject.sh
+++ b/src/initrd/samizdat-eject.sh
@@ -84,9 +84,19 @@ fi
84 84
85remove "$@" 85remove "$@"
86 86
87echo 'Waiting while boot medium is freed...' >&2
87wait 88wait
88 89
89if [ "$(btrfs_subdevice_count /)" = 1 ] && md_ready; then 90notified=
90 mdadm_copy_eject /dev/md55 "$target".part && 91while true; do
91 mv "$target".part "$target" 92 if [ "$(btrfs_subdevice_count /)" = 1 ] && md_ready; then
92fi 93 if [ -z "$notified" ]; then
94 echo 'Boot medium is free. It may be ejected now.' >&2
95 notified=y
96 fi
97 mdadm_copy_eject /dev/md55 "$target".part &&
98 mv "$target".part "$target"
99 exit
100 fi
101 sleep 5
102done