Doesn't cleanup tempdir if copying fails

Bug #624956 reported by Loïc Minier on 2010-08-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)

Bug Description

Binary package hint: flash-kernel


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"

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


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