summaryrefslogtreecommitdiffstats
path: root/shutdown
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-11-10 04:54:35 +0100
committerDave Reisner <dreisner@archlinux.org>2012-11-11 02:30:44 +0100
commitf025cecb8df05a91cc5988138ecdf13198811fc4 (patch)
treea6c5b7b60bbe9a277eade88b75c1cb2ed8bab266 /shutdown
parent2c801db8ed74dbea5e86fb0fbc77906c32ed1258 (diff)
downloadmkinitcpio-f025cecb8df05a91cc5988138ecdf13198811fc4.tar.gz
mkinitcpio-f025cecb8df05a91cc5988138ecdf13198811fc4.tar.xz
shutdown: chdir to /sys/class/block earlier0.11.1
This gives the loop detach logic an actual chance of working. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'shutdown')
-rw-r--r--shutdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/shutdown b/shutdown
index 2b2bcca..d43376c 100644
--- a/shutdown
+++ b/shutdown
@@ -62,6 +62,9 @@ disassemble() {
# might be in a useful state. FS#30995.
rm -rf /run/udev
+# chdir, so that we can avoid a lot of path chopping
+cd /sys/class/block
+
printf '%s\n' 'Detaching loop devices.'
for loop in loop*/loop; do
@@ -88,9 +91,6 @@ done
printf '%s\n' "Disassembling stacked devices."
-# chdir, so that we can avoid a lot of path chopping
-cd /sys/class/block
-
# iterate over devices with holders
for part in */holders/*; do
[ -e "$part" ] && disassemble "${part%%/*}"