mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 05:56:58 +02:00
remove second call to free up loop device
Change-Id: Ibf52597f01b7868f8472d2042e4d335442b82597 TEST=manually build a dev recovery image and verified no loop device warning was outputted by losetup call Review URL: http://codereview.chromium.org/3439024
This commit is contained in:
parent
5137a74e90
commit
29d962035e
@ -176,7 +176,7 @@ create_dev_recovery_image() {
|
||||
# Mount resized stateful FS and copy payload content to its root directory
|
||||
local temp_mnt=$(mktemp -d "/tmp/temp_mnt.XXXXXX")
|
||||
local loop_dev=$(get_loop_dev)
|
||||
trap "umount_from_loop_dev ${temp_mnt} && cleanup_loop_dev ${loop_dev}" EXIT
|
||||
trap "umount_from_loop_dev ${temp_mnt} && rm -f \"${temp_state}\"" EXIT
|
||||
mkdir -p "${temp_mnt}"
|
||||
sudo mount -o loop=${loop_dev} "${temp_state}" "${temp_mnt}"
|
||||
sudo cp -R "${FLAGS_payload_dir}" "${temp_mnt}"
|
||||
@ -189,7 +189,6 @@ create_dev_recovery_image() {
|
||||
# TODO(tgao): handle install script (for default and custom cases)
|
||||
local temp_img=$(update_partition_table $temp_state $resized_sectors)
|
||||
|
||||
rm -f "${temp_state}"
|
||||
# trap handler will clean up loop device and temp mount point
|
||||
echo ${temp_img}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user