Bug#408341: mac-fdisk: fails to build on x86

2007-02-04 Thread Scott Edwards
Michael Schmitz writes: 


Now, the fact that the package builds (except for the pmac-fdisk-cross
failure at the end, which is a consequence of ARCH being neither m68k now
powerpc) and the binaries actually run is not too surprising. I would be
amazed, however, if mac-fdisk does read and write correct Apple partition
tables on x86 (or any other little endian architecture, for that matter).
Did you successfully read a Mac-generated partition table, or generate on
that's properly recognized by a Mac? 


Last I looked, the partition table entries would have to be converted to
host endianness before manipulating them in-core, and back-converted
before writing a changed table out to disk. 


If you're interested in testing this, I can send you a copy of a partition
table in raw format which you can dump to a blank disk (or a loopback
device).


My use was on a Tivo2 series PVR with a usb-storage (to ide) adapter.  I was 
inspecting the drive for backup/restore options.  This all started when I 
used file(1) to see it uses a mac partition table.  I have etch installed on 
a dual booting iBook to.  mac-fdisk appears to print the same partition 
information regardless of what machine I ran it from (x86,ppc).  Tigers' 
disk utility sees these partitiions to (but not Linux, even with apple 
partition support - odd).  I used the offsets provided by mac-fdisk with 
losetup -o offset to mount some of the ext2 file systems.  Cool, tivo runs 
Linux. How cool is that?. 

Anyway, AFAIT the reading is just fine.  If you want to torture test 
anything, you don't need a real disk if you're just comparing how the x86 
compiled binary does it, and the ppc one does. Just use a few MB file to 
play with (it's just blocks after all...). 

Thanks, 



Scott.



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



Bug#408341: mac-fdisk: fails to build on x86

2007-01-25 Thread Michael Schmitz
severity 408341 wishlist
thank you

> Package: mac-fdisk
> Version: mac-fdisk
> Severity: important
> Justification: fails to build from source
>
> Per #202019 it's suggested I (end user) build this from source
> if I want to use it on another arch.  It seems to build ok,
> and the binaries in the package seem to work (from what I see).
> Lots of warnings (My hunch there is no explicit include of
> required #include  for bzero etc etc.).  See included
> build typescript for more details.

Building mac-fdisk from unmodified source on any architecture save powerpc
and m68k is not supposed to work, hence your FTBFS bug is not really a
bug. I downgrade it to wishlist for that reason.

Your guess that includes may be missing is quite right - the original code
may have built on mklinux without warnings, but it's always been giving
warnings on Linux. The code worked so I didn't bother.

Now, the fact that the package builds (except for the pmac-fdisk-cross
failure at the end, which is a consequence of ARCH being neither m68k now
powerpc) and the binaries actually run is not too surprising. I would be
amazed, however, if mac-fdisk does read and write correct Apple partition
tables on x86 (or any other little endian architecture, for that matter).
Did you successfully read a Mac-generated partition table, or generate on
that's properly recognized by a Mac?

Last I looked, the partition table entries would have to be converted to
host endianness before manipulating them in-core, and back-converted
before writing a changed table out to disk.

If you're interested in testing this, I can send you a copy of a partition
table in raw format which you can dump to a blank disk (or a loopback
device).

> cc -O2 -g -Wall   -c -o pdisk.o pdisk.c
> In file included from pdisk.c:43:
> kernel-defs.h:18:1: warning: "_IOC_SIZEBITS" redefined
> In file included from /usr/include/asm-i486/ioctl.h:1,
>  from /usr/include/asm/ioctl.h:8,
>  from /usr/include/asm-i486/ioctls.h:4,
>  from /usr/include/asm/ioctls.h:8,
>  from /usr/include/bits/ioctls.h:24,
>  from /usr/include/sys/ioctl.h:27,
>  from pdisk.c:42:
> /usr/include/asm-generic/ioctl.h:24:1: warning: this is the location of the 
> previous definition

That's a bit worrying; I should disable these defines for Linux compiles
...

>   dpkg-gencontrol -pmac-fdisk-cross -ldebian/changelog -isp 
> -Tdebian/mac-fdisk-cross.substvars -Pdebian/mac-fdisk-cross
> dpkg-gencontrol: error: package mac-fdisk-cross not in control info
> dh_gencontrol: command returned error code 65280
> make: *** [binary-arch] Error 1
> [EMAIL PROTECTED]:~/mac-fdisk-0.1$ exit

That I need to fix; pmac-fdisk-cross is a partition table editor for
PowerPC (other than Mac, that is) to handle PC style partition tables
which were used on these PowerPC systems. fdisk/cfdisk had no endianness
fixes at that time. Perhaps it's best to not have this built anymore.

Michael


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



Bug#408341: mac-fdisk: fails to build on x86

2007-01-24 Thread supaplex
Package: mac-fdisk
Version: mac-fdisk
Severity: important
Justification: fails to build from source

Per #202019 it's suggested I (end user) build this from source
if I want to use it on another arch.  It seems to build ok,
and the binaries in the package seem to work (from what I see).
Lots of warnings (My hunch there is no explicit include of
required #include  for bzero etc etc.).  See included
build typescript for more details.

Script started on Wed 24 Jan 2007 08:42:45 PM MST
[EMAIL PROTECTED]:~/mac-fdisk-0.1$ fakeroot dpkg-buildpackage -uc -us
dpkg-buildpackage: source package is mac-fdisk
dpkg-buildpackage: source version is 0.1-14
dpkg-buildpackage: source changed by Michael Schmitz <[EMAIL PROTECTED]>
dpkg-buildpackage: host architecture i386
dpkg-buildpackage: source version without epoch 0.1-14
 debian/rules clean
test -f debian/rules
rm -f build
make clean
make[1]: Entering directory `/home/supaplex/mac-fdisk-0.1'
rm -f *.o pdisk fdisk mac-fdisk pmac-fdisk
make[1]: Leaving directory `/home/supaplex/mac-fdisk-0.1'
rm -f `find . -name "*~"`
rm -rf debian/tmp debian/mac-fdisk-cross debian/pmac-fdisk 
debian/pmac-fdisk-cross debian/mac-fdisk-udeb debian/pmac-fdisk-udeb 
debian/files* core debian/*substvars
 dpkg-source -b mac-fdisk-0.1
dpkg-source: building mac-fdisk using existing mac-fdisk_0.1.orig.tar.gz
dpkg-source: building mac-fdisk in mac-fdisk_0.1-14.diff.gz
dpkg-source: building mac-fdisk in mac-fdisk_0.1-14.dsc
 debian/rules build
test -f debian/rules
make CFLAGS="-O2 -g -Wall"
make[1]: Entering directory `/home/supaplex/mac-fdisk-0.1'
cc -O2 -g -Wall   -c -o pdisk.o pdisk.c
In file included from pdisk.c:43:
kernel-defs.h:18:1: warning: "_IOC_SIZEBITS" redefined
In file included from /usr/include/asm-i486/ioctl.h:1,
 from /usr/include/asm/ioctl.h:8,
 from /usr/include/asm-i486/ioctls.h:4,
 from /usr/include/asm/ioctls.h:8,
 from /usr/include/bits/ioctls.h:24,
 from /usr/include/sys/ioctl.h:27,
 from pdisk.c:42:
/usr/include/asm-generic/ioctl.h:24:1: warning: this is the location of the 
previous definition
In file included from pdisk.c:43:
kernel-defs.h:19:1: warning: "_IOC_DIRBITS" redefined
In file included from /usr/include/asm-i486/ioctl.h:1,
 from /usr/include/asm/ioctl.h:8,
 from /usr/include/asm-i486/ioctls.h:4,
 from /usr/include/asm/ioctls.h:8,
 from /usr/include/bits/ioctls.h:24,
 from /usr/include/sys/ioctl.h:27,
 from pdisk.c:42:
/usr/include/asm-generic/ioctl.h:25:1: warning: this is the location of the 
previous definition
pdisk.c: In function 'main':
pdisk.c:156: warning: implicit declaration of function 'exit'
pdisk.c:156: warning: incompatible implicit declaration of built-in function 
'exit'
pdisk.c: In function 'do_create_partition':
pdisk.c:469: warning: implicit declaration of function 'strncmp'
pdisk.c:439: warning: unused variable 'mult'
pdisk.c: In function 'do_reorder':
pdisk.c:601: warning: unused variable 'cur'
cc -O2 -g -Wall   -c -o dump.o dump.c
dump.c:66: warning: missing braces around initializer
dump.c:66: warning: (near initialization for 'plist[0]')
dump.c: In function 'dump_partition_entry':
dump.c:229: warning: format '%-4d' expects type 'int', but argument 3 has type 
'long int'
dump.c:233: warning: format '%-4d' expects type 'int', but argument 3 has type 
'long int'
dump.c:204: warning: unused variable 'bp'
dump.c: In function 'list_all_disks':
dump.c:362: warning: implicit declaration of function 'free'
dump.c:317: warning: unused variable 't'
dump.c: In function 'show_data_structures':
dump.c:385: warning: format '%u' expects type 'unsigned int', but argument 4 
has type 'long unsigned int'
dump.c:429: warning: format '%2d' expects type 'int', but argument 2 has type 
'long int'
dump.c:452: warning: format '%2d' expects type 'int', but argument 2 has type 
'long int'
dump.c:469: warning: format '%2d' expects type 'int', but argument 2 has type 
'long int'
dump.c:497: warning: format '%2d' expects type 'int', but argument 2 has type 
'long unsigned int'
cc -O2 -g -Wall   -c -o partition_map.o partition_map.c
In file included from partition_map.c:38:
kernel-defs.h:18:1: warning: "_IOC_SIZEBITS" redefined
In file included from /usr/include/asm-i486/ioctl.h:1,
 from /usr/include/asm/ioctl.h:8,
 from /usr/include/asm-i486/ioctls.h:4,
 from /usr/include/asm/ioctls.h:8,
 from /usr/include/bits/ioctls.h:24,
 from /usr/include/sys/ioctl.h:27,
 from partition_map.c:37:
/usr/include/asm-generic/ioctl.h:24:1: warning: this is the location of the 
previous definition
In file included from partition_map.c:38:
kernel-defs.h:19:1: warning: "_IOC_DIRBITS" redefined
In file included from /usr/include/asm-i486/ioctl.h:1,
 from /usr/include/asm/ioctl.h:8,