Line | |
---|
1 | #!/bin/sh -e |
---|
2 | # Detects Mac OS X. I don't yet know how Mac OS <= 9 fits into this. |
---|
3 | . /usr/share/os-prober/common.sh |
---|
4 | |
---|
5 | partition="$1" |
---|
6 | mpoint="$2" |
---|
7 | type="$3" |
---|
8 | |
---|
9 | debug() { |
---|
10 | logger -t macosx-prober "debug: $@" |
---|
11 | } |
---|
12 | |
---|
13 | # Weed out stuff that doesn't apply to us |
---|
14 | case "$type" in |
---|
15 | hfsplus) debug "$1 is an HFS+ partition" ;; |
---|
16 | *) debug "$1 is not an HFS+ partition: exiting"; exit 1 ;; |
---|
17 | esac |
---|
18 | |
---|
19 | # Could use a better test than this. |
---|
20 | # /System/Library/CoreServices/SystemVersion.plist has version information, |
---|
21 | # but I don't think it exists on Mac OS <= 9, and it's XML so parsing in |
---|
22 | # shell will be nasty. |
---|
23 | |
---|
24 | if [ -e "$2/mach_kernel" ]; then |
---|
25 | label="$(count_next_label MacOSX)" |
---|
26 | result "$1:Mac OS X:$label:macosx" |
---|
27 | exit 0 |
---|
28 | else |
---|
29 | exit 1 |
---|
30 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.