Re: install-mbr on amd64?
tag 330190 + patch
thanks
Kilian <kil@gnu.ch> writes:
> Dear All,
>
> I'm trying to set up a software RAID 1 (two disks) with Debian on a
> system with an AMD x86_64 Athlon processor. To install the MBR on both
> discs, I need install-mbr (http://packages.debian.org/stable/base/mbr)
> if I'm correct, but this package does not exist in the amd64 port... I
> then tried to compile it myself, which fails, obviously, because the
> package has not been ported to x86_64 yet as it seems (and I lack the
> knowledge to do so...).
>
> I'm a bit stuck now.. what other tools can I use?
>
> Thanks for any hint!
>
> Greetz,
> Kilian
I went ahead and fixed mbr up for amd64. Apart from the obvious
(Build-depends, gcc -m32) I also fixed up some of the more serious
warnings and included running the testsuite as much as possible.
The package compiles but someone has to risk his/her system and
install the mbr now.
MfG
Goswin
PS: Dear maintainer, consider this a notification of intent to NMU
your package.
----------------------------------------------------------------------
diff -u mbr-1.1.5/debian/control mbr-1.1.5/debian/control
--- mbr-1.1.5/debian/control
+++ mbr-1.1.5/debian/control
@@ -3,10 +3,10 @@
Priority: optional
Maintainer: Santiago Garcia Mantinan <manty@debian.org>
Standards-Version: 3.6.1
-Build-Depends: bin86
+Build-Depends: bin86, libc6-dev-i386 [amd64], ia32-libs [amd64]
Package: mbr
-Architecture: i386
+Architecture: i386 amd64
Depends: ${shlibs:Depends}
Description: Master Boot Record for IBM-PC compatible computers.
This is used in booting Linux from the hard disk.
diff -u mbr-1.1.5/debian/changelog mbr-1.1.5/debian/changelog
--- mbr-1.1.5/debian/changelog
+++ mbr-1.1.5/debian/changelog
@@ -1,3 +1,24 @@
+mbr (1.1.5-2.1) unstable; urgency=low
+
+ * NMU: Port to amd64 (closes: #330190)
+ + debian/rules: set CC and LD
+ + debian/rules: add -W to CFLAGS for proper warnings
+ + debian/control: Build-Depend on libc6-dev-i386 [amd64] and
+ (temporary) on ia32-libs [amd64] for dpkg-shlibdeps to work
+ * Fix potentialy harmfull warnings
+ + harness/args.c:57: warning: suggest parentheses around arithmetic in operand of ^
+ + harness/output.c:22: warning: comparison between signed and unsigned
+ + harness/process.c:25: warning: implicit declaration of function 'exit'
+ + install-mbr.c:617: warning: return type defaults to 'int'
+ + install-mbr.c:702: warning: comparison between signed and unsigned
+ + install-mbr.c:1357: warning: format '%d' expects type 'int', but argument 4 has type 'char *'
+ * Enable testsuite partialy
+ + remove tests for non existing old mbrs
+ + conditionaly remove runtime test that fail on amd64
+ * Fix typo in manpage found by A Costa <agcosta@gis.net> (Closes: #311235)
+
+ -- Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de> Thu, 18 May 2006 18:43:42 +0000
+
mbr (1.1.5-2) unstable; urgency=low
* The "we are no longer required for anything" release.
diff -u mbr-1.1.5/debian/rules mbr-1.1.5/debian/rules
--- mbr-1.1.5/debian/rules
+++ mbr-1.1.5/debian/rules
@@ -3,8 +3,12 @@
package = mbr
docdir = debian/tmp/usr/share/doc/$(package)
-CC = gcc
-CFLAGS = -g -Wall
+KERNEL_ARCH := $(shell uname -m)
+
+CC = gcc -m32
+LD = ld -melf_i386
+
+CFLAGS = -g -Wall -W
INSTALL_PROGRAM = install
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -17,7 +21,13 @@
build:
$(checkdir)
./configure --prefix=/
- $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
+ $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)"
+ifneq (,$(findstring x86_64,$(KERNEL_ARCH)))
+ # Limit the tests on x86_64 kernels
+ $(MAKE) TESTS="tests/inst-1 tests/inst-3 tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8" check-TESTS
+else
+ $(MAKE) check-TESTS
+endif
touch build
clean:
only in patch2:
unchanged:
--- mbr-1.1.5.orig/Makefile.in
+++ mbr-1.1.5/Makefile.in
@@ -71,7 +71,7 @@
man_MANS = install-mbr.8
-TESTS = tests/version tests/inst-1 tests/inst-2 tests/inst-3 tests/inst-4 tests/inst-5 tests/inst-6 tests/inst-7 tests/inst-8 tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 tests/mbr-5 tests/mbr-6
+TESTS = tests/inst-1 tests/inst-3 tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8 tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 tests/mbr-5 tests/mbr-6
TESTS_ENVIRONMENT = sh ${srcdir}/wraptest
@@ -478,13 +478,7 @@
check-TESTS: \
table.b \
- mbr.b \
- mbr-1.1.3.b \
- mbr-1.1.2.b \
- mbr-1.1.1.b \
- mbr-1.1.0.b \
- mbr-1.0.1.b \
- mbr-1.0.0.b
+ mbr.b
.PRECIOUS: mbr.b
only in patch2:
unchanged:
--- mbr-1.1.5.orig/Makefile.am
+++ mbr-1.1.5/Makefile.am
@@ -7,21 +7,15 @@
man_MANS = install-mbr.8
-TESTS = tests/version tests/inst-1 tests/inst-2 tests/inst-3 \
- tests/inst-4 tests/inst-5 tests/inst-6 tests/inst-7 tests/inst-8 \
+TESTS = tests/inst-1 tests/inst-3 \
+ tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8 \
tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 \
tests/mbr-5 tests/mbr-6
TESTS_ENVIRONMENT = sh ${srcdir}/wraptest
check-TESTS: \
table.b \
- mbr.b \
- mbr-1.1.3.b \
- mbr-1.1.2.b \
- mbr-1.1.1.b \
- mbr-1.1.0.b \
- mbr-1.0.1.b \
- mbr-1.0.0.b
+ mbr.b
EXTRA_DIST = table.S86 historic,v wraptest ${TESTS} ${man_MANS}
only in patch2:
unchanged:
--- mbr-1.1.5.orig/install-mbr.c
+++ mbr-1.1.5/install-mbr.c
@@ -613,7 +613,7 @@
}
}
-static show_params(const struct change_params *cp)
+static void show_params(const struct change_params *cp)
{
printf("Version: %d\n", cp->version);
printf("Compatible: %d\n", cp->compat_version);
@@ -687,7 +687,7 @@
do_io(io_func *fn, const struct file_desc *dsc, int fd, size_t min_size)
{
int res;
- int done=0;
+ size_t done=0;
while(done<BUFFER_SIZE)
{
res=fn(fd, dsc->data, BUFFER_SIZE-done);
@@ -1353,7 +1353,7 @@
to_do=1;
if(optarg[0]==0 || optarg[1]!=0)
{
- fprintf(stderr, "%s: Invalid partition number: %d\n",
+ fprintf(stderr, "%s: Invalid partition number: %s\n",
prog_name, optarg);
exit(1);
}
only in patch2:
unchanged:
--- mbr-1.1.5.orig/install-mbr.8
+++ mbr-1.1.5/install-mbr.8
@@ -47,7 +47,7 @@
.RB " [" --interrupt
.RI < keys >]
.RB " [" --partition
-.RI < parition >]
+.RI < partition >]
.RB " [" --timeout
.RI < timeout >]
..
only in patch2:
unchanged:
--- mbr-1.1.5.orig/harness/args.c
+++ mbr-1.1.5/harness/args.c
@@ -54,7 +54,7 @@
unsigned long month = strtoul(*next-'-'?"0":next+1, &next, 0);
unsigned long day = strtoul(*next-'-'?"0":next+1, &next, 0);
if (year-1970>129 || month-1>11 || *next ||
- day-1>27+(month^2?2+(month>>3^month&1):!(year&3)))
+ day-1>27+(month^2?2+((month>>3)^(month&1)):!(year&3)))
{
fprintf(stderr, "Failed to parse date or out of range: %s\n"
"Use format: YYYY-MM-DD. Year must be 1970-2099.\n",
only in patch2:
unchanged:
--- mbr-1.1.5.orig/harness/output.c
+++ mbr-1.1.5/harness/output.c
@@ -4,7 +4,7 @@
#include <ctype.h>
static int available_width = 0;
-static int output_time = 0;
+static unsigned long output_time = 0;
static void new_line(void)
{
only in patch2:
unchanged:
--- mbr-1.1.5.orig/harness/process.c
+++ mbr-1.1.5/harness/process.c
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
#include "harness.h"
void process_init()
Reply to: