diff options
-rwxr-xr-x | src/initrd/samizdat-eject.sh | 18 |
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 | ||
85 | remove "$@" | 85 | remove "$@" |
86 | 86 | ||
87 | echo 'Waiting while boot medium is freed...' >&2 | ||
87 | wait | 88 | wait |
88 | 89 | ||
89 | if [ "$(btrfs_subdevice_count /)" = 1 ] && md_ready; then | 90 | notified= |
90 | mdadm_copy_eject /dev/md55 "$target".part && | 91 | while true; do |
91 | mv "$target".part "$target" | 92 | if [ "$(btrfs_subdevice_count /)" = 1 ] && md_ready; then |
92 | fi | 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 | ||
102 | done | ||