--- /dev/null
+mac-fdisk for DEBIAN
+----------------------
+
+Comments regarding mac-fdisk
+
+mac-fdisk provides Apple partition format utilities required for
+installation of Debian/68k on Apple Macintosh computers. The Debian version
+of mac-fdisk is derived from pdisk 0.4a2 (pdisk.970115.tar) by Eryk Vershen
+(eryk@apple.com).
+pmac-fdisk is a version of the PC partition format utilities for PowerPC
+computers, taken from the same pdisk source version and can be used for
+installation of Debian/68k on PC partition format disks on Macintosh.
+
+Modifications have been made to the pdisk partition table output code to permit
+parsing the output of 'mac-fdisk -l' in a manner consistent with other Linux
+fdisk utilities. (Christiaan Welvaart, <>)
+
+Michael Schmitz <schmitz@lcbvax.cchem.berkeley.edu>, Sat, 28 Feb 1998 12:58:07 -0800
--- /dev/null
+mac-fdisk (0.1-16) unstable; urgency=low
+
+ * Fix udeb shlib dependencies - patch by Frans Pop <elendil@planet.nl>
+ Closes: #562190.
+
+ -- Michael Schmitz <schmitz@debian.org> Sun, 03 Jan 2010 13:47:27 +1200
+
+mac-fdisk (0.1-15) unstable; urgency=low
+
+ * Rebuild against current glibc to get rid of sys_errlist type size
+ warning (bug reported by Rick Thomas).
+ Closes: #451386.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Mon, 25 Sep 2005 14:50:13 +0100
+
+mac-fdisk (0.1-14) unstable; urgency=low
+
+ * Fix dpme.h u32 typedef which caused a mismatch between disk and memory
+ partition map format.
+ Closes: #389379.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Mon, 25 Sep 2005 14:50:13 +0100
+
+mac-fdisk (0.1-13) unstable; urgency=low
+
+ * Add patch for broken dpkg --print-gnu-build-architecture (patch by
+ Andreas Jochens <aj@andaco.de>).
+ Closes: #328102.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Wed, 14 Sep 2005 17:25:23 +0100
+
+mac-fdisk (0.1-12) unstable; urgency=low
+
+ * Add makefile support for ppc64 arch (patch by Andreas Jochens
+ <aj@andaco.de>).
+ Closes: #307897.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Mon, 09 May 2005 12:58:47 +0100
+
+mac-fdisk (0.1-11) unstable; urgency=low
+
+ * Big fat overdue cleanup - back in business after replacing my stolen
+ Powerbook.
+ * fixes as suggested in proposed NMU: changes mostly by Frank Lichtenheld
+ <djpig@debian.org>, with subarchitecture modifications by Colin Watson
+ <cjwatson@debian.org>.
+ * Copy needed kernel definitions from kernel-headers 2.4.25 (powerpc) and
+ 2.4.26-m68k (cjwatson; Closes: #262457).
+ * Add Subarchitecture: fields in DEBIAN/control of the udebs. "mac" for
+ mac-fdisk-udeb on m68k, "powermac_oldworld powermac_newworld" for
+ mac-fdisk-udeb on powerpc, and "chrp chrp_pegasos prep iseries" for
+ pmac-fdisk-udeb on powerpc (djpig; Closes: #250581).
+ * Remove XSI:sms in debian/rules and debian/postinst, patch by David
+ Weinehall (djpig; Closes: #254918).
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Thu, 26 Aug 2004 14:23:13 +0200
+
+mac-fdisk (0.1-10) unstable; urgency=high
+
+ * Added .udeb magic to rules (kudos to Gaudenz Steinlin
+ <gaudenz@soziologie.ch>); kept mac-fdisk in /sbin though).
+ Closes: #188420.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Wed, 04 Jun 2003 17:06:02 +0200
+
+mac-fdisk (0.1-9) unstable; urgency=high
+
+ * Rebuilt with woody binutils to allow for prelinking. Closes: #176353.
+
+ * Set 'automagically mount on boot' flag when creating HFS partitions
+ (thanks to Derrick Pates <dpates@dsdk12.net> for finding the
+ undocumented bit!). Experimental, but this is unstable, right?
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Fri, 24 Jan 2003 16:20:20 +0200
+
+mac-fdisk (0.1-8) unstable; urgency=high
+
+ * Update mac-fdisk man page (kudos to Chris Tillman). Closes: #121928.
+
+ * Remove mac-fdisk-cross from control file; remove Sparc from Arch: entries
+ (to get rid of outdated mac-fdisk-cross 0.1-1 in the archive). Change
+ package descrption line for pmac-fdisk to emphasize it's a fdisk clone.
+
+ * Change sync() to ioctl(fd, BLKFLSBUF) to flush partition table to disk
+ on write - hopefully work around a kernel bug on new machines.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Fri, 07 Dec 2001 13:38:10 +0200
+
+mac-fdisk (0.1-7) unstable; urgency=high
+
+ * Bugfix: mac-fdisk didn't properly handle devfs device names. Mangle disk
+ name (.../disc) in dump routine to end in .../part%d (patch by Colin
+ Walters <walters@verbum.org>). Closes: #110056.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Mon, 04 Sep 2001 16:02:45 +0200
+
+mac-fdisk (0.1-6.0potato1) stable; urgency=high
+
+ * Feature added: menu option to create bootstrap partition needed for
+ powerpc NewWorld machines with the proper type and size (patch supplied
+ by Ethan Benson). This should help newbies that won't read the docs
+ anyway. Closes: #99660.
+
+ * Bugfix: mac-fdisk used to get the disk size wrong when brute force
+ probing for end-of-disk by seek&read. Turns out gcc did not cope with
+ arithmetics on long long types without explicit cast. Closes: #99700.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Fri, 15 Jun 2001 12:16:35 +0200
+
+mac-fdisk (0.1-6) unstable; urgency=high
+
+ * Feature added: menu option to create bootstrap partition needed for
+ powerpc NewWorld machines with the proper type and size (patch supplied
+ by Ethan Benson). This should help newbies that won't read the docs
+ anyway. Closes: #99660.
+
+ * Bugfix: mac-fdisk used to get the disk size wrong when brute force
+ probing for end-of-disk by seek&read. Turns out gcc did not cope with
+ arithmetics on long long types without explicit cast. Closes: #99700.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Mon, 04 Jun 2001 13:54:21 +0200
+
+mac-fdisk (0.1-5) unstable; urgency=low
+
+ * Bugfix: fix build problems for glibc 2.2 (remove string.h includes,
+ use lseek64 for llseek, fix some petty gcc warnings)
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Wed, 02 Mar 2001 19:42:01 +0200
+
+mac-fdisk (0.1-4) unstable; urgency=low
+
+ * Bugfix: correct off-by-one error on moving a partition downwards in the
+ partition map. Clarification of various program messages and prompts
+ (closes #69148, #69149 and #69152). Update of mac-fdisk man page.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Wed, 08 Oct 2000 17:49:07 +0200
+
+mac-fdisk (0.1-3) unstable; urgency=low
+
+ * PowerPC install fixes (work around lack of /proc/hardware), rename pmac-fdisk
+ package (previously pmac-fdisk-cross). Add pmac-fdisk man page.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Wed, 08 Mar 2000 18:29:07 +0200
+
+mac-fdisk (0.1-2) unstable; urgency=low
+
+ * Change man page name and install location, changed man page, rebuild for 2.2.
+
+ -- Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Fri, 22 Oct 1999 20:29:07 +0200
+
+mac-fdisk (0.1-1) unstable; urgency=low
+
+ * Initial Release. (built from previous pdisk-0.4a2 with fixes by Roman Hodek)
+
+ -- Michael Schmitz <schmitz@lcbvax.cchem.berkeley.edu> Sat, 28 Feb 1998 21:58:07 -0800
+
+Local variables:
+mode: debian-changelog
+add-log-mailing-address: "schmitz@biophys.uni-duesseldorf.de"
+End:
--- /dev/null
+This package was forked from the Debian mac-fdisk 0.1-16 package by
+Michael McMaster <michael@codesrc.com> 2013.
+
+This package was debianized by Michael Schmitz schmitz@lcbvax.cchem.berkeley.edu on
+Sun, 11 Jan 1998 22:58:07 -0800.
+
+It was downloaded from ftp.mklinux.apple.com:/pub/Other_Tools/
+
+Copyright:
+
+ * Copyright 1996,1997 by Apple Computer, Inc.
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and
+ * that both the copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
+ * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--- /dev/null
+/* from asm/types.h */
+typedef unsigned short __u16;
+typedef unsigned int __u32;
+
+/* from linux/hdreg.h */
+#define HDIO_GETGEO 0x0301 /* get device geometry */
+
+struct hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
+
+/* from asm/ioctl.h */
+#define _IOC_NRBITS 8
+#define _IOC_TYPEBITS 8
+#define _IOC_SIZEBITS 13
+#define _IOC_DIRBITS 3
+
+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT 0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+#ifdef __powerpc__
+#define _IOC_NONE 1U
+#define _IOC_READ 2U
+#define _IOC_WRITE 4U
+#else
+#define _IOC_NONE 0U
+#define _IOC_READ 2U
+#define _IOC_WRITE 1U
+#endif
+
+#define _IOC(dir,type,nr,size) \
+ (((dir) << _IOC_DIRSHIFT) | \
+ ((type) << _IOC_TYPESHIFT) | \
+ ((nr) << _IOC_NRSHIFT) | \
+ ((size) << _IOC_SIZESHIFT))
+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
+
+/* from linux/fs.h */
+#define BLKRRPART _IO(0x12,95) /* re-read partition table */
+#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
+
+/* from linux/genhd.h */
+struct partition {
+ unsigned char boot_ind; /* 0x80 - active */
+ unsigned char head; /* starting head */
+ unsigned char sector; /* starting sector */
+ unsigned char cyl; /* starting cylinder */
+ unsigned char sys_ind; /* What partition type */
+ unsigned char end_head; /* end head */
+ unsigned char end_sector; /* end sector */
+ unsigned char end_cyl; /* end cylinder */
+ unsigned int start_sect; /* starting sector counting from 0 */
+ unsigned int nr_sects; /* nr of sectors in partition */
+} __attribute__((packed));
--- /dev/null
+.TH MAC-FDISK 8 "1 December 2001" "Debian" "Apple Disk Partitioning Manual"
+.SH NAME
+mac-fdisk \- Apple partition table editor for Linux
+.SH SYNOPSIS
+.B mac-fdisk
+.B "[ \-h | \--help ] [ \-v | \--version ] [ \-l | \--list device ... ]"
+.br
+.B mac-fdisk
+.B "[ \-r | \--readonly ] device ... "
+.SH DESCRIPTION
+.B mac-fdisk
+is a command line type program which partitions disks using the standard Apple
+disk partitioning scheme described in "Inside Macintosh: Devices".
+The
+.I device
+is usually one of the following:
+
+.nf
+.RS
+/dev/sda
+/dev/sdb
+/dev/sdc
+/dev/sdd
+/dev/sde
+/dev/sdf
+/dev/sdg
+/dev/hda
+/dev/hdb
+
+.RE
+.fi
+/dev/sda is the first hard disk on the SCSI bus (i.e. the
+one with the lowest id), /dev/sdb is the second hard disk, and so on.
+The
+.I partition
+is a
+.I device
+name followed by a partition number.
+The partition number is the index (starting from one) of the partition
+map entry in the partition map (and the partition map itself occupies the
+first entry).
+For example,
+.B /dev/sda2
+is the partition described by the second entry in the partiton map on /dev/sda.
+
+.SH OPTIONS
+.TP
+.B \-v | \--version
+Prints version number of the
+.B mac-fdisk
+program.
+.TP
+.B \-h | \--help
+Prints a list of available commands for the
+.B mac-fdisk
+program.
+.TP
+.B \-l | \--list
+Lists the partition tables for the specified
+.IR device(s).
+With no
+.IR device(s)
+given, lists all SCSI and IDE devices found in the system.
+.TP
+.B \-r | \--readonly
+Prevents
+.B mac-fdisk
+from writing to the device.
+.SH "Editing Partition Tables"
+An argument which is simply the name of a
+.I device
+indicates that
+.B mac-fdisk
+should edit the partition table of that device. Once started,
+.B mac-fdisk
+presents an interactive command prompt to edit the partition table.
+The partition editing commands are:
+
+.nf
+.RS
+h list available commands
+p print (list) the current edited partition table status
+P print ordered by base address
+i initialize the partition map
+s change size of partition map
+b create new 800K Apple_Bootstrap partition (used by yaboot)
+c create new standard Linux type partition
+C create new partition, specifying the partition type
+d delete a partition
+r reorder partition entry
+w write the partition table to disk
+q quit
+
+.RE
+.fi
+Commands which take arguments prompt for each argument in turn.
+You can also type the arguments separated by spaces
+and those prompts will be skipped. The
+.B i
+and
+.B w
+commands will prompt for confirmation. None of the editing you do will
+actually affect the state of the disk you are partitioning until the
+.B w
+command is issued. Then the map in its edited state will be
+permanently written to the disk.
+
+Partitions are always specified by their number, the index of the
+partition entry in the partition map. Many commands will change the
+index numbers of partitions which follow the affected partition; you are
+encouraged to use the
+.B p
+command to print the partition table as frequently as necessary. For SCSI
+disks, the partition table should not contain more than fifteen partitions
+(partition map excluded). IDE disks have a limit of 31 partitions.
+
+Here is a more-or-less typical output for the print command:
+
+.nf
+.RS
+Command (? for help): p
+/dev/sdb
+ # type name length base ( size ) system
+/dev/sdb1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
+/dev/sdb2 Apple_Driver43 Macintosh 54 @ 64 ( 27.0k) Driver 4.3
+/dev/sdb3 Apple_Driver43 Macintosh 74 @ 118 ( 37.0k) Driver 4.3
+/dev/sdb4 Apple_Driver_IOKit Macintosh 512 @ 192 (256.0k) Unknown
+/dev/sdb5 Apple_Patches Patch Partition 512 @ 704 (256.0k) Unknown
+/dev/sdb6 Apple_HFS untitled 3072000 @ 1216 ( 1.5G) HFS
+/dev/sdb7 Apple_HFS untitled 2 333026 @ 3073216 (162.6M) HFS
+/dev/sdb8 Apple_Free Extra 10 @ 3406242 ( 5.0k) Free space
+
+Block size=512, Number of Blocks=3406252
+DeviceType=0x0, DeviceId=0x0
+Drivers-
+1: @ 64 for 22, type=0x1
+2: @ 118 for 36, type=0xffff
+
+.RE
+.fi
+
+The
+.B i
+(initialize) command prompts for the size of the device. You can just
+type Return to accept the offered size, which should be correct.
+
+The
+.B b
+command is a shortcut to create the bootstrap partition used on PowerPC
+NewWorld machines. It is equivalent to creating an 800k
+.B Apple_Bootstrap
+type partition using the
+.B C
+command described below. The sole purpose of this partition is to
+store the boot loader. In multiboot environments, the first bootable
+partition found on the disk takes precedence unless a specific boot
+partition is set in OpenFirmware, so it's best to create the bootstrap
+partition first, or move it to a position before any
+.B Apple_HFS
+or
+.B Apple_Boot
+partitions using the
+.B r
+command described below. Then you will still able to boot Linux after
+the occasional OpenFirmware reset.
+
+The
+.B c
+(create new partition) command has three arguments. As mentioned
+above you can type the arguments following the command, separated by
+spaces, or respond to prompts for each argument:
+
+ 1) The base address of the start of the partition.
+
+ You can specify a number in blocks (most likely reading from the
+ existing partition map) or you can also type a partition number
+ followed by the letter 'p' to indicate that the new partition
+ should take the place of that existing free space partition.
+
+ 2) The length of the partition.
+
+ Again, you can specify a number in blocks or type a partition
+ number followed by the letter 'p' to indicate use of the entire
+ partition. You can also type a number followed by 'k', 'm', or
+ 'g' to indicate the size in kilobytes, megabytes, or gigabytes
+ respectively. (These are powers of 1024, of course, not powers
+ of 1000.)
+
+ 3) The name of the partition.
+
+ This can be a single word without quotes, or a string surrounded
+ by single or double quotes. It is best to name any swap partition
+ you create `swap'; other partition names are up to you. The names
+ are not visible to Linux.
+
+The
+.B C
+command is identical to the
+.B c
+command, with the addition of a partition type argument after the
+other arguments. The partition type used for Linux swap and data partitons
+is
+.B APPLE_UNIX_SVR2
+(this is the partition type created by the
+.B c
+command). Under normal circumstances, you should not need to use this
+command.
+
+The
+.B d
+command deletes the partition number specified, replacing that partition
+with partitionable free space.
+
+The
+.B r
+(reorder) command allows the index number of partitions to be changed.
+The index numbers are constrained to be a contiguous sequence.
+.B mac-fdisk
+will enforce this constraint by recalculating the partition numbers
+after each insert, delete or reorder operation. OpenFirmware looks for
+bootable partitions in the order specified by the index. The
+partitions are not moved on the disk. This command takes two
+arguments, the number of the partition to be moved and the partition
+number it should become.
+
+The
+.B w
+command writes the partition map out to disk. Note that partition
+maps for disks with mounted partitions cannot immediately be
+reinterpreted by the kernel. In order to use the new partition map you
+must reboot. Within the Debian installer system,
+.B mac-fdisk
+is normally invoked before any partitions are mounted, thus a reboot is not
+necessary before continuing the installation.
+
+The
+.B q
+command terminates the program. If there was no
+.B w
+command issued during the program run, then there will be no effect on the disk.
+
+.SH BUGS
+Some people believe there should really be just one disk partitioning utility.
+
+.B mac-fdisk
+should be able to create HFS partitions that work. Currently, if a
+pre-existing HFS partition is resized, MacOS will continue to use the
+partition size stored in the HFS 'superblock' instead of using the size from
+the partition table (the MacOS volume on the partition remains valid even
+though the sizes don't match anymore). This can have undesired side effects
+especially when creating a smaller HFS partition followed by a few Linux
+partitions in place of the previous HFS partition space. To avoid this
+issue, create MacOS partitions within MacOS and then don't resize them
+in
+.B mac-fdisk.
+
+.SH "SEE ALSO"
+.BR fdisk (8),
+.BR mkswap (8),
+.BR mkfs (8)
+.SH AUTHOR
+Eryk Vershen (eryk@apple.com), man page revised by Chris Tillman (tillman@azstarnet.com)