diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 464: In l-m-c, stop before trying to install hwpacks if we detect that we can't execute anything in th...

Message ID 20111121135112.14050.98499.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Guilherme Salgado Nov. 21, 2011, 1:51 p.m. UTC
Merge authors:
  Guilherme Salgado (salgado)
Related merge proposals:
  https://code.launchpad.net/~salgado/linaro-image-tools/bug-814671/+merge/82454
  proposed by: Guilherme Salgado (salgado)
  review: Approve - Mattias Backman (mabac)
------------------------------------------------------------
revno: 464 [merge]
committer: Guilherme Salgado <guilherme.salgado@linaro.org>
branch nick: trunk
timestamp: Mon 2011-11-21 10:49:14 -0300
message:
  In l-m-c, stop before trying to install hwpacks if we detect that we can't execute anything in the chroot
modified:
  linaro_image_tools/media_create/chroot_utils.py
  linaro_image_tools/media_create/tests/test_media_create.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/chroot_utils.py'
--- linaro_image_tools/media_create/chroot_utils.py	2011-07-25 16:48:37 +0000
+++ linaro_image_tools/media_create/chroot_utils.py	2011-11-16 21:09:18 +0000
@@ -57,6 +57,21 @@ 
 
     try:
         mount_chroot_proc(chroot_dir)
+        try:
+            # Sometimes the host will have qemu-user-static installed but
+            # another package (i.e. scratchbox) will have mangled its config
+            # and thus we won't be able to chroot and install the hwpack, so
+            # we fail here and tell the user to ensure qemu-arm-static is
+            # setup before trying again.
+            cmd_runner.run(['true'], as_root=True, chroot=chroot_dir).wait()
+        except:
+            print ("Cannot proceed with hwpack installation because "
+                   "there doesn't seem to be a binfmt interpreter registered "
+                   "to execute armel binaries in the chroot. Please check "
+                   "that qemu-user-static is installed and properly "
+                   "configured before trying again.")
+            raise
+
         for hwpack_file in hwpack_files:
             hwpack_verified = False
             if os.path.basename(hwpack_file) in verified_files:

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2011-11-17 09:03:31 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2011-11-21 13:49:14 +0000
@@ -2716,6 +2716,7 @@ 
             'prepare_chroot %(chroot_dir)s %(tmp_dir)s',
             'cp %(linaro_hwpack_install)s %(chroot_dir)s/usr/bin',
             'mount proc %(chroot_dir)s/proc -t proc',
+            'chroot %(chroot_dir)s true',
             'cp hwpack1.tgz %(chroot_dir)s',
             ('%(chroot_args)s %(chroot_dir)s linaro-hwpack-install '
              '--force-yes /hwpack1.tgz'),