linaro_media_create.utils.UnableToFindPackageProvidingCommand: Cannot lookup a package which provides qemu-img

Bug #772264 reported by Marcin Juszkiewicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Image Tools
Fix Released
Medium
Loïc Minier

Bug Description

12:23 hrw@home:archive$ linaro-media-create --mmc /dev/sdh --dev panda --hwpack ./hwpack_linaro-panda_20110426-0_armel_supported.tar.gz --hwpack-force-yes --binary ./linaro-n-ubuntu-desktop-tar-20110428-0.tar.gz
Traceback (most recent call last):
  File "/usr/bin/linaro-media-create", line 105, in <module>
    ensure_required_commands(args)
  File "/usr/bin/linaro-media-create", line 89, in ensure_required_commands
    ensure_command(command)
  File "/usr/lib/pymodules/python2.7/linaro_media_create/utils.py", line 62, in ensure_command
    install_package_providing(command)
  File "/usr/lib/pymodules/python2.7/linaro_media_create/utils.py", line 38, in install_package_providing
    "Cannot lookup a package which provides %s" % command)
linaro_media_create.utils.UnableToFindPackageProvidingCommand: Cannot lookup a package which provides qemu-img

12:27 hrw@home:archive$ LC_ALL=C apt-cache policy linaro-image-tools
linaro-image-tools:
  Installed: 0.4.3-0ubuntu2
  Candidate: 0.4.3-0ubuntu2
  Version table:
 *** 0.4.3-0ubuntu2 0
        999 http://de.archive.ubuntu.com/ubuntu/ natty/universe amd64 Packages
        100 /var/lib/dpkg/status

Related branches

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Same happens with bzr332 version:

12:29 hrw@home:linaro-image-tools$ bzr log |head
------------------------------------------------------------
revno: 332
committer: Mattias Backman <email address hidden>
branch nick: trunk
timestamp: Wed 2011-04-27 15:54:39 +0200
message:
  Post-release version bump to 0.4.5.1
------------------------------------------------------------
revno: 331
tags: 0.4.5
12:30 hrw@home:linaro-image-tools$ ./linaro-media-create --mmc /dev/sdh --dev panda --hwpack ./archive/hwpack_linaro-panda_20110426-0_armel_supported.tar.gz --hwpack-force-yes --binary archive/linaro-n-ubuntu-desktop-tar-20110428-0.tar.gz
Traceback (most recent call last):
  File "./linaro-media-create", line 105, in <module>
    ensure_required_commands(args)
  File "./linaro-media-create", line 89, in ensure_required_commands
    ensure_command(command)
  File "/home/hrw/HDD/devel/canonical/linaro-image-tools/linaro_image_tools/utils.py", line 64, in ensure_command
    install_package_providing(command)
  File "/home/hrw/HDD/devel/canonical/linaro-image-tools/linaro_image_tools/utils.py", line 39, in install_package_providing
    "Cannot lookup a package which provides %s" % command)
linaro_image_tools.utils.UnableToFindPackageProvidingCommand: Cannot lookup a package which provides qemu-img

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Installation of qemu-kvm helps - so it looks like missing dependency.

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

The package Recommends qemu-kvm which provides qemu-img, and Recommends command-not-found which is needed to suggest which package to install.

Do you have command-not-found installed?

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

"command-not-found" package is one of those which got removed from my systems right after installation.

And if linaro-media-create needs qemu-img or command-not-found packages then it should depend on them as recommended packages can be removed from system at any time.

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 772264] Re: linaro_media_create.utils.UnableToFindPackageProvidingCommand: Cannot lookup a package which provides qemu-img

On Thu, 28 Apr 2011 11:11:58 -0000, Marcin Juszkiewicz <email address hidden> wrote:
> "command-not-found" package is one of those which got removed from my
> systems right after installation.
>
> And if linaro-media-create needs qemu-img or command-not-found packages
> then it should depend on them as recommended packages can be removed
> from system at any time.

command-not-found is optional, so that's fine.

It only needs qemu-img on !armel, so we should probably indicate that in
the packaging.

Thanks,

James

Changed in linaro-image-tools:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Westby (james-w) wrote :

But we can't do that given that we have a Architecture: all package.

Therefore I think Recommends is the correct thing while we have all commands
in one package.

If we have linaro-image-tools depend on a linaro-media-create package then
we could possibly have that depend on qemu-kvm.

We could change to Architecture: any, but I think that's a bit heavyweight
given this issue.

Thanks,

James

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

@James: qemu-img is actually needed when creating an image file, not specifically on !armel; it seems the code testing for qemu-img shouldn't be under "if not is_arm_host()". We could refactor the code to test for qemu-img once we know whether we're working on an image file. (Your backwards analysis of why Recommends are not arch-specific would be correct for qemu-user-static BTW :-)

@Marcin: once you remove Recommends, you're on your own; in this case, you removed a Recommends which is required for image files, but isn't required to write directly to a SD/MMC. I recommend you install Recommends. The lack of command-not-found on your system also renders the failure mode rather cryptic, but again, this is due to you chosing not to install Recommends (and living with the resulting failures).

In the future, linaro-image-tools might drop support for the --mmc mode of operation where it directly writes to a device, so it would make sense to bump qemu-kvm to a Depends for qemu-img or to use something else, it's actually not that great to require qemu-kvm for simple functionality that dd can provide.

Loïc Minier (lool)
Changed in linaro-image-tools:
status: Triaged → In Progress
assignee: nobody → Loïc Minier (lool)
Revision history for this message
Zach Pfeffer (pfefferz) wrote :

On 29 April 2011 05:38, Loïc Minier <email address hidden> wrote:
> @James: qemu-img is actually needed when creating an image file, not
> specifically on !armel; it seems the code testing for qemu-img shouldn't
> be under "if not is_arm_host()".  We could refactor the code to test for
> qemu-img once we know whether we're working on an image file.  (Your
> backwards analysis of why Recommends are not arch-specific would be
> correct for qemu-user-static BTW  :-)
>
> @Marcin: once you remove Recommends, you're on your own; in this case,
> you removed a Recommends which is required for image files, but isn't
> required to write directly to a SD/MMC.  I recommend you install
> Recommends.  The lack of command-not-found on your system also renders
> the failure mode rather cryptic, but again, this is due to you chosing
> not to install Recommends (and living with the resulting failures).
>
> In the future, linaro-image-tools might drop support for the --mmc mode
> of operation where it directly writes to a device, so it would make
> sense to bump qemu-kvm to a Depends for qemu-img or to use something
> else, it's actually not that great to require qemu-kvm for simple
> functionality that dd can provide.

What would replace --mmc? I've been using linaro-image-tools-android
and that option is pretty handy.

>
> --
> You received this bug notification because you are a member of Linaro
> Maintainers, which is subscribed to Linaro Image Tools.
> https://bugs.launchpad.net/bugs/772264
>
> Title:
>  linaro_media_create.utils.UnableToFindPackageProvidingCommand: Cannot
>  lookup a package which provides qemu-img
>

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

On Fri, Apr 29, 2011, Zach Pfeffer wrote:
> What would replace --mmc? I've been using linaro-image-tools-android
> and that option is pretty handy.

 It wouldn't partition a real device directly, but instead would
 generate an image file, and perhaps write it to a real device
 afterwards.

--
Loïc Minier

Revision history for this message
Mattias Backman (mabac) wrote :

The linked branch has been merged. Can this bug be closed?

Changed in linaro-image-tools:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.