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
This commit is contained in:
Hung-Te Lin 2010-11-18 17:27:17 +08:00
parent 24f6e35428
commit df4fc212a8

View File

@ -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