From df4fc212a8b8b320bc43f69e0d768d279ee14618 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Thu, 18 Nov 2010 17:27:17 +0800 Subject: [PATCH] crosutils: fix "umount: /tmp/XXX: not mounted" in build_image The update_bootloaders needs to unmount file system first for syslinux to manipulate the raw device file, but the real "umount+losetup -d" in cleanup stage would cause failure. This CL remounts partition again so that cleanup can be executed successfully. BUG=chromium-os:9278 TEST=Manually executed ./build_image; Before fix: seeing "umount: /tmp/esp.2q8fSn: not mounted" in last page. After fix: no such error. The output image is verified to be bootable successfully. Change-Id: I19e2e062ad814e7bcd54777b5c3cee31f2b92e81 Review URL: http://codereview.chromium.org/5165001 --- update_bootloaders.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update_bootloaders.sh b/update_bootloaders.sh index 63faaceec8..2dbc138bbb 100755 --- a/update_bootloaders.sh +++ b/update_bootloaders.sh @@ -180,6 +180,8 @@ if [[ "${FLAGS_arch}" = "x86" ]]; then if [[ ${FLAGS_install_syslinux} -eq ${FLAGS_TRUE} ]]; then sudo umount "${ESP_FS_DIR}" sudo syslinux -d /syslinux "${ESP_DEV}" + # mount again for cleanup to free resource gracefully + sudo mount -o ro "${ESP_DEV}" "${ESP_FS_DIR}" fi elif [[ "${FLAGS_arch}" = "arm" ]]; then # Copy u-boot script to ESP partition