On Sun, Nov 28, 2010 at 02:11:43AM -0800, Vagrant Cascadian wrote:
> On Fri, Nov 26, 2010 at 03:14:19PM -0800, Vagrant Cascadian wrote:
> > considering that the x86_64 emulation doesn't really work with 
> > qemu-user-static
> > on i386 yet, it may be best to disble that... 
> 
> the previous patch wasn't quite complete, as it left it enabled when upgrading
> from the old version. the following patch should fix this, by having the
> update-binfmt remove all the possible targets (the postinst handles supported
> ones). the following patch seems to address this, although spits out extra
> noise on targets that aren't present:

this patch also addresses those issues too:

diff --git a/debian/qemu-user-static.postinst b/debian/qemu-user-static.postinst
index 86fb450..951be8d 100644
--- a/debian/qemu-user-static.postinst
+++ b/debian/qemu-user-static.postinst
@@ -4,7 +4,14 @@ BINFMT_TARGETS= # list of architectures is autogenerated from 
debian/rules
 
 if [ configure = "$1" ] && [ -x /usr/sbin/update-binfmts ]; then
        for target in $BINFMT_TARGETS ; do
-               update-binfmts --import qemu-$target
+               if [ -f /var/lib/binfmts/qemu-$target ]; then
+                       # remove format, in case the current version no longer 
supports it.
+                       update-binfmts --package qemu-user-static --remove 
qemu-$target /usr/bin/qemu-$target-static
+               fi
+               if [ -f /usr/share/binfmts/qemu-$target ]; then
+                       # install currently supported format.
+                       update-binfmts --import qemu-$target
+               fi
        done
 fi
 
diff --git a/debian/qemu-user-static.prerm b/debian/qemu-user-static.prerm
index 7e4863b..d21fbfc 100644
--- a/debian/qemu-user-static.prerm
+++ b/debian/qemu-user-static.prerm
@@ -4,7 +4,9 @@ BINFMT_TARGETS= # list of architectures is autogenerated from 
debian/rules
 
 if [ "$1" = remove ] && [ -x /usr/sbin/update-binfmts ]; then
        for target in $BINFMT_TARGETS ; do
-               update-binfmts --package qemu-user-static --remove qemu-$target 
/usr/bin/qemu-$target-static
+               if [ -f /var/lib/binfmts/qemu-"$target" ]; then
+                       update-binfmts --package qemu-user-static --remove 
qemu-$target /usr/bin/qemu-$target-static
+               fi
        done
 fi
 
diff --git a/debian/rules b/debian/rules
index cc906c9..3c9137e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,7 +42,10 @@ ifneq (,$(findstring $(DEB_HOST_ARCH), arm armel))
 BINFMT_TARGETS=$(filter-out arm, $(ALL_BINFMT_TARGETS))
 endif
 ifeq ($(DEB_HOST_ARCH),i386)
-BINFMT_TARGETS=$(filter-out i386, $(ALL_BINFMT_TARGETS))
+# Drop support for emulating amd64 on i386, as it is broken and including it
+# interferes with environments capable of running amd64 natively.
+# http://bugs.debian.org/604712
+BINFMT_TARGETS=$(filter-out i386 x86_64, $(ALL_BINFMT_TARGETS))
 endif
 ifeq ($(DEB_HOST_ARCH),powerpc)
 BINFMT_TARGETS=$(filter-out ppc, $(ALL_BINFMT_TARGETS))
@@ -162,7 +165,7 @@ ifeq ($(DEB_HOST_ARCH_OS),linux)
        done
 
        # binfmt support
-       sed -i -e 's/^BINFMT_TARGETS=.*/BINFMT_TARGETS=\"$(BINFMT_TARGETS)\"/g' 
\
+       sed -i -e 
's/^BINFMT_TARGETS=.*/BINFMT_TARGETS=\"$(ALL_BINFMT_TARGETS)\"/g' \
                $(CURDIR)/debian/qemu-user-static.prerm \
                $(CURDIR)/debian/qemu-user-static.postinst
 

live well,
  vagrant



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to