From f025cecb8df05a91cc5988138ecdf13198811fc4 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 9 Nov 2012 22:54:35 -0500 Subject: shutdown: chdir to /sys/class/block earlier This gives the loop detach logic an actual chance of working. Signed-off-by: Dave Reisner --- shutdown | 6 +++--- 1 file 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%%/*}" -- cgit v1.2.3-24-g4f1b