Blame os-probes/mounted/powerpc/20macosx
|
Packit |
d86cd3 |
#!/bin/sh -e
|
|
Packit |
d86cd3 |
# Detects Mac OS X. I don't yet know how Mac OS <= 9 fits into this.
|
|
Packit |
d86cd3 |
. /usr/share/os-prober/common.sh
|
|
Packit |
d86cd3 |
|
|
Packit |
d86cd3 |
partition="$1"
|
|
Packit |
d86cd3 |
mpoint="$2"
|
|
Packit |
d86cd3 |
type="$3"
|
|
Packit |
d86cd3 |
|
|
Packit |
d86cd3 |
debug() {
|
|
Packit |
d86cd3 |
if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then
|
|
Packit |
d86cd3 |
logger -t macosx-prober "debug: $@"
|
|
Packit |
d86cd3 |
fi
|
|
Packit |
d86cd3 |
}
|
|
Packit |
d86cd3 |
|
|
Packit |
d86cd3 |
# Weed out stuff that doesn't apply to us
|
|
Packit |
d86cd3 |
case "$type" in
|
|
Packit |
d86cd3 |
hfsplus) debug "$1 is an HFS+ partition" ;;
|
|
Packit |
d86cd3 |
*) debug "$1 is not an HFS+ partition: exiting"; exit 1 ;;
|
|
Packit |
d86cd3 |
esac
|
|
Packit |
d86cd3 |
|
|
Packit |
d86cd3 |
# Could use a better test than this.
|
|
Packit |
d86cd3 |
# /System/Library/CoreServices/SystemVersion.plist has version information,
|
|
Packit |
d86cd3 |
# but I don't think it exists on Mac OS <= 9, and it's XML so parsing in
|
|
Packit |
d86cd3 |
# shell will be nasty.
|
|
Packit |
d86cd3 |
|
|
rpm-build |
bd33da |
if [ -e "$2/mach_kernel" ] && ! dd if="$2/mach_kernel" count=1 bs=5 2>/dev/null | grep -aq Dummy ; then
|
|
Packit |
d86cd3 |
label="$(count_next_label MacOSX)"
|
|
Packit |
d86cd3 |
result "$1:Mac OS X:$label:macosx"
|
|
Packit |
d86cd3 |
exit 0
|
|
Packit |
d86cd3 |
else
|
|
Packit |
d86cd3 |
exit 1
|
|
Packit |
d86cd3 |
fi
|