Merge lp://qastaging/~berolinux/linaro-image-tools/fix-linaro-android-media-create into lp://qastaging/linaro-image-tools/11.11

Proposed by Bernhard Rosenkraenzer
Status: Rejected
Rejected by: Данило Шеган
Proposed branch: lp://qastaging/~berolinux/linaro-image-tools/fix-linaro-android-media-create
Merge into: lp://qastaging/linaro-image-tools/11.11
Diff against target: 25 lines (+0/-8)
1 file modified
linaro_image_tools/media_create/android_boards.py (+0/-8)
To merge this branch: bzr merge lp://qastaging/~berolinux/linaro-image-tools/fix-linaro-android-media-create
Reviewer Review Type Date Requested Status
Loïc Minier (community) Disapprove
Review via email: mp+68980@code.qastaging.launchpad.net

Description of the change

Fix linaro-android-media-create after recent mount/umount changes

Without this, this traceback occurs:
mkfs.vfat 3.0.11 (24 Dec 2010)
mount: /dev/mmcblk0p1 already mounted or /tmp/tmp18MYEP/boot-disc busy
mount: according to mtab, /dev/mmcblk0p1 is already mounted on /tmp/tmp18MYEP/boot-disc
Traceback (most recent call last):
  File "./linaro-android-media-create", line 144, in <module>
    board_config.populate_boot_script(boot_partition, BOOT_DISK, args.consoles)
  File "/usr/src/repos/linaro/linaro-image-tools/linaro_image_tools/media_create/android_boards.py", line 82, in populate_boot_script
    as_root=True).wait()
  File "/usr/src/repos/linaro/linaro-image-tools/linaro_image_tools/cmd_runner.py", line 100, in wait
    raise SubcommandNonZeroReturnValue(self._my_args, returncode)
linaro_image_tools.cmd_runner.SubcommandNonZeroReturnValue: Sub process "['mount', '/dev/mmcblk0p1', '/tmp/tmp18MYEP/boot-disc']" returned a non-zero value: 32

The problem is that linaro-android-media-create assumed
populate_partition(... BOOT_DISK ...)
unmounts the boot filesystem after running (no longer true).

Furthermore, board_config.populate_boot_script used to umount
the boot filesystem, causing the umount in the atexit handler to fail.

To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

Doing the umount in an atexit handler is not going to work in all cases so I think that instead of relying on that we should provide a simple API for callsites that want to mount a partition, do something and umount it when done. My branch at https://code.launchpad.net/~salgado/linaro-image-tools/bug-815885/+merge/69133 has exactly that and it'd make this change unnecessary. I didn't use the new API in populate_boot_script() because of how close we are to the release time, but I've left a TODO there for it

Revision history for this message
Loïc Minier (lool) wrote :

Is it ok to close this mp now?

Revision history for this message
Loïc Minier (lool) wrote :

Closing

review: Disapprove
Revision history for this message
ramninder (kittu1313sran) wrote :

no

Revision history for this message
Данило Шеган (danilo) wrote :

No activity for a while, closing.

Unmerged revisions

387. By Bernhard Rosenkraenzer

Fix linaro-android-media-create after recent mount/umount changes

Without this, this traceback occurs:
mkfs.vfat 3.0.11 (24 Dec 2010)
mount: /dev/mmcblk0p1 already mounted or /tmp/tmp18MYEP/boot-disc busy
mount: according to mtab, /dev/mmcblk0p1 is already mounted on /tmp/tmp18MYEP/boot-disc
Traceback (most recent call last):
  File "./linaro-android-media-create", line 144, in <module>
    board_config.populate_boot_script(boot_partition, BOOT_DISK, args.consoles)
  File "/usr/src/repos/linaro/linaro-image-tools/linaro_image_tools/media_create/android_boards.py", line 82, in populate_boot_script
    as_root=True).wait()
  File "/usr/src/repos/linaro/linaro-image-tools/linaro_image_tools/cmd_runner.py", line 100, in wait
    raise SubcommandNonZeroReturnValue(self._my_args, returncode)
linaro_image_tools.cmd_runner.SubcommandNonZeroReturnValue: Sub process "['mount', '/dev/mmcblk0p1', '/tmp/tmp18MYEP/boot-disc']" returned a non-zero value: 32

The problem is that linaro-android-media-create assumes
populate_partition(... BOOT_DISK ...)
unmounts the boot filesystem after running (no longer true).

Furthermore, board_config.populate_boot_script used to umount
the boot filesystem, causing the umount in the atexit handler to fail.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches