File: postinst

package info (click to toggle)
mac-fdisk 0.1-18.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 612 kB
  • sloc: ansic: 10,495; makefile: 170; sh: 35
file content (50 lines) | stat: -rw-r--r-- 1,009 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh
set -e

Arch=`dpkg --print-architecture`

#
# make symlink /sbin/fdisk point to the native fdisk
#

# This is also true if /sbin/fdisk is a dangling symlink; in that case we
# want to update the link, too.
if [ ! -e /sbin/fdisk ]; then
	machine=""
	if [ "$Arch" = "m68k" ]; then
		case `awk '$1 == "Model:" { print $2 }' /proc/hardware` in
			Atari)
				machine=atari
				;;
			Amiga)
				machine=amiga
				;;
			Macintosh)
				machine=mac
				;;
			Motorola) # MVME
				;;
		esac
	elif [ "$Arch" = "powerpc" ]; then
		# case `awk '$1 == "motherboard" { print $6 }' /proc/cpuinfo` in
		# case `cat /proc/cpuinfo | grep -E "^motherboard" | sed -e 's/.* \([a-zA-Z]*\)$/\1/'` in
		case `awk '$1 == "motherboard" { print $NF }' /proc/cpuinfo` in
			Macintosh)
				machine=mac
				;;
			*)
				machine=pmac
				;;
		esac

	fi
	if [ -n "$machine" ] && [ -f /sbin/$machine-fdisk ]; then
		ln -sf $machine-fdisk /sbin/fdisk
	else
		echo "No native fdisk for this machine type!"
	fi
fi

#DEBHELPER#

exit 0