linaro-media-create doesn't detach loop devices when it's done
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro Image Tools |
Fix Released
|
Undecided
|
Unassigned | ||
linaro-image-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Maverick |
Fix Released
|
Undecided
|
Unassigned | ||
Natty |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
If you use the linaro-media-create script's --image_file option to create the image to a file, the script uses losetup -f to set up two loopback mounts into the image file. However, it never cleans them up again, so they hang around indefinitely:
cam-vm-
/dev/loop0: [0801]:18049630 (/tmp/linaro-
/dev/loop1: [0801]:18049630 (/tmp/linaro-
/dev/loop2: [0801]:18049627 (/tmp/beagle_
/dev/loop3: [0801]:18049627 (/tmp/beagle_
/dev/loop4: [0801]:18049641 (/tmp/beagle_
/dev/loop5: [0801]:18049641 (/tmp/beagle_
/dev/loop6: [0801]:18049641 (/tmp/beagle_
/dev/loop7: [0801]:18049641 (/tmp/beagle_
and eventually if you run linaro-media-create often enough it will fail with "losetup: could not find any free loop device" because it's used them all up.
I think "losetup -d "$MMC1" $MMC2" somewhere suitable would fix this.
Related branches
- Steve Langasek (community): Needs Fixing
-
Diff: 167 lines (+103/-3)1 file modifiedlinaro-media-create (+103/-3)
tags: | added: linaro patch |
Changed in linaro-image-tools (Ubuntu Maverick): | |
status: | New → Fix Committed |
Changed in linaro-image-tools (Ubuntu Natty): | |
status: | New → Fix Committed |
Changed in linaro-image-tools: | |
status: | New → Fix Released |
Changed in linaro-image-tools (Ubuntu Maverick): | |
status: | Fix Released → Fix Committed |
Changed in linaro-image-tools (Ubuntu Natty): | |
status: | Fix Committed → Fix Released |
Changed in linaro-image-tools (Ubuntu Maverick): | |
status: | Fix Committed → Fix Released |
I'm attaching a patch which fixes this by making the script detach the loopback devices if it is using them.