#!/bin/sh
#
# fdisk, a wrapper to use the right fdisk on Linux/PowerPC
# Copyright (C) 1998, Hartmut Koptein <koptein@debian.org>
# Copyright (C) 1996,1997, Michael Schlueter <schlue00@marvin.informatik.uni-dortmund.de>
# Copyright (C) 1997, James Troup <jjtroup@comp.brad.ac.uk> 
# Copyright (C) 1997, Sven Rudolph <sr1@os.inf.tu-dresden.de>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with your Debian GNU/Linux system, in
# /usr/doc/copyright/GPL.gz; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# 20 Aug 98 Hartmut Koptein <koptein@debian.org>
#            First version for the debian root disc on powerpc
#
# 26 May 99 Changed dos-fdisk into ddisk
#
# 11 Jun 99 Changed to not use awk <porter@debian.org>
#
# 06 Nov 1999 Changed pmac-fdisk to mac-fdisk <espy@debian.org>

if [ -f /proc/cpuinfo ]
then
	
	Arch=""
	Arch=`cat /proc/cpuinfo |
	(
	read line;
	set -- $line;
	while [ $1 != "machine" ]
	do
	  read line;
	  set -- $line;
	done
	echo $3;
	)`

	case "$Arch" in
		CHRP)
# if CHRP IBM,LongTrail-2 
			/sbin/ddisk $@
			exit 0
			;;
		Power*|iMac*|[Pp]ower[bB]ook*)	
# if Power Macintosh
			/sbin/mac-fdisk $@
			exit 0
			;;
		PReP)	
# if IBM/Mot PReP
                        /sbin/ddisk $@
                        exit 0
                        ;;
		Amiga)
			/sbin/amiga-fdisk $@
			exit 0
			;;
# else... mbx, bbox ????
		*)
			echo $0": Your system is not supported yet" 2>&1
			exit 1
			;;
	esac
else
	echo $0": Wrong architecture for this fdisk" 1>&2
	exit 1
fi

#end
