Ubuntu

Doesn't cleanup tempdir if copying fails

Reported by Loïc Minier on 2010-08-26
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: flash-kernel

Hi

in omap_flash_kernel(), if the cp fails (as it did for me before 2.28ubuntu7 for instance), the tmpdir in which the uImage are generated wont be cleaned up.

The script should install a cleanup handler like:
cleanup() {
    if [ -n "$mnt_dir" ]; then
        $sudo umount "$mnt_dir"
        rmdir "$mnt_dir"
    fi
}

trap "cleanup" 0 1 2 3 9 11 13 15

Thanks,

Loïc Minier (lool) wrote :

(Oh and the partition wont be unmounted either)

Hervé Fache (h-fache) wrote :

This is still the case in precise and is in fact a double bug: not only is the partition not unmounted on failure, but would the user try again it is mounted again, which could lead to data loss.

The script should first test whether the partition is mounted (and find out where) before trying to mount it. If already mounted, then you need to block it mounted during the update (cd /mount/point comes to mind.)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers