Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: chromeos-setimage

Issue 5122002: installer: fix the "umount: XXX not mounted" error message during postinst (Closed) Base URL: http://git.chromium.org/git/installer.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos-setimage
diff --git a/chromeos-setimage b/chromeos-setimage
index d1be3321a64ccc6f4ffdede1fba95268a1ac3457..dbaadc399692572659aeb01419ec4d8fc32179c1 100755
--- a/chromeos-setimage
+++ b/chromeos-setimage
@@ -115,19 +115,23 @@ KERN_LOOP=
cleanup_loop() {
local dev="$1"
+ local cleanup_command="$2"
if [ -z "$dev" ]; then
return 0
fi
- (sudo umount "$dev" || true)
+ if [ -n "$cleanup_command" ]; then
+ (sudo "$cleanup_command" "$dev" || true)
+ fi
(sudo losetup -d "$dev" || true)
}
cleanup() {
- cleanup_loop "${ESP_LOOP}"
+ # Currently only ESP may be mounted. KERN and ROOT are never mounted.
+ cleanup_loop "${ESP_LOOP}" "umount"
ESP_LOOP=
- cleanup_loop "${KERN_LOOP}"
+ cleanup_loop "${KERN_LOOP}" ""
Will Drewry 2010/11/18 09:20:15 Do you need to specify empty $2s here?
Hung-Te 2010/11/18 09:49:02 Although it may be not necessary, I think an expli
KERN_LOOP=
- cleanup_loop "${ROOT_LOOP}"
+ cleanup_loop "${ROOT_LOOP}" ""
ROOT_LOOP=
# Failing to clean this up isn't the worst.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698