tags 439283 patch
thanks

On Thu, Aug 23, 2007 at 05:27:54PM -0400, Daniel Schepler wrote:
> Package: mbr
> Version: 1.1.9-2
> Severity: serious
[...]
> +Unexpected event 255, code 0xffffffff at 0000:7c00
> FAIL: tests/mbr-2
> ...
> =====================
> 12 of 13 tests failed
> =====================
> make[1]: *** [check-TESTS] Error 1
> rm table.s86
> make[1]: Leaving directory `/tmp/buildd/mbr-1.1.9'
> make: *** [build] Error 2
> 
> It may be relevant that this build was run under an amd64 kernel, on a
> dual core processor.

Yes. This is because the x86-64 kernel architecture doesn't support the
vm86() syscall and so returns -1 (a.k.a. the "255" above, when cast to
unsigned char). debian/rules actually already tries to detect this and
disable the tests in question, but it fails because the use of the
'linux32' personality-switching program causes 'uname -m' to return
i686.

It turns out that 'linux64' reverses this, and is safe to use even on
32-bit kernels:

  <slangasek> soren: linux64... a... no-op on 32-bit? <twith>
  <slangasek> <twitch>
  <cjwatson> yeah, it's, er, a bit odd
  <lamont> slangasek: "linux64" == "make my personality my native one.  kthxbye"
  <slangasek> lamont: <twitch>
  <lamont> it's not a no-op.  it changes your personality back to the native 
one... the fact that you didn't change it to something else beforehand is the 
strange part....
  <slangasek> right... :)
  <lamont> I didn't write it, I just accidentally hijacked it.
  <lamont> it was maybe an unfortunate choice of name... but remember that the 
author was kinda focused on 64-bit architectures
  <lamont>         PER_LINUX =             0x0000,
  <lamont>         PER_LINUX_32BIT =       0x0000 | ADDR_LIMIT_32BIT,
  <lamont> including in the kernel...
  <slangasek> right
  <lamont> and you'd give us different crap if we called the command 
/usr/bin/linux :)

Thus, as discussed in this Ubuntu bug:

  https://bugs.launchpad.net/ubuntu/+source/mbr/+bug/134404

... the following patch fixes this bug. Depending on your religion, you
may prefer to build-depend on util-linux (>= 2.13) | linux32 rather than
the (now) mixed virtual package linux32.

diff -u mbr-1.1.9/debian/rules mbr-1.1.9/debian/rules
--- mbr-1.1.9/debian/rules
+++ mbr-1.1.9/debian/rules
@@ -3,7 +3,7 @@
 package = mbr
 docdir = debian/tmp/usr/share/doc/$(package)
 
-KERNEL_ARCH := $(shell uname -m)
+KERNEL_ARCH := $(shell linux64 uname -m)
 
 CC = gcc -m32
 LD = ld -melf_i386
diff -u mbr-1.1.9/debian/control mbr-1.1.9/debian/control
--- mbr-1.1.9/debian/control
+++ mbr-1.1.9/debian/control
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Santiago Garcia Mantinan <[EMAIL PROTECTED]>
 Standards-Version: 3.7.2
-Build-Depends: bin86, libc6-dev-i386 [amd64], ia32-libs [amd64]
+Build-Depends: bin86, libc6-dev-i386 [amd64], ia32-libs [amd64], linux32
 
 Package: mbr
 Architecture: i386 amd64

Cheers,

-- 
Colin Watson                                       [EMAIL PROTECTED]



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to