macos: next version support
authorDerrick Brashear <shadow@dementix.org>
Sun, 15 Jul 2012 07:03:00 +0000 (03:03 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 16 Jul 2012 16:29:49 +0000 (09:29 -0700)
support things beyond 10.7

Change-Id: I7a50f569fd43e0e1ed3c74f0480a8e2521df1bc5
Reviewed-on: http://gerrit.openafs.org/7763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

acinclude.m4
src/afs/DARWIN/osi_module.c
src/cf/osconf.m4
src/config/afs_sysnames.h
src/libafs/MakefileProto.DARWIN.in
src/libafs/afs.x86_darwin_120.plist.in [new file with mode: 0644]
src/packaging/MacOS/InstallationCheck.12 [new file with mode: 0644]
src/packaging/MacOS/InstallationCheck.strings.12 [new file with mode: 0644]
src/packaging/MacOS/ReadMe.rtf.12 [new file with mode: 0644]
src/packaging/MacOS/buildpkg.sh.in

index f3ccfe0..ff4ea92 100644 (file)
@@ -581,6 +581,14 @@ else
                        AFS_SYSNAME="x86_darwin_110"
                        OSXSDK="macosx10.7"
                        ;;
+               x86_64-apple-darwin12.*)
+                       AFS_SYSNAME="x86_darwin_120"
+                       OSXSDK="macosx10.8"
+                       ;;
+               i?86-apple-darwin12.*)
+                       AFS_SYSNAME="x86_darwin_120"
+                       OSXSDK="macosx10.8"
+                       ;;
                sparc-sun-solaris2.8)
                        AFS_SYSNAME="sun4x_58"
                        ;;
index f254ccf..9029253 100644 (file)
@@ -56,7 +56,7 @@ afs_modload(struct kmod_info *kmod_info, void *data)
     afs_global_lock = lck_mtx_alloc_init(openafs_lck_grp, 0);
 
     if (ret = vfs_fsadd(&afs_vfsentry, &afs_vfstable)) {
-       printf("AFS: vfs_fsadd failed. aborting: %d\n", ret);
+       afs_warn("AFS: vfs_fsadd failed. aborting: %d\n", ret);
        afs_vfstable = NULL;
        goto fsadd_out;
     }
@@ -65,14 +65,14 @@ afs_modload(struct kmod_info *kmod_info, void *data)
     afs_cdev.d_ioctl = &afs_cdev_ioctl;
     afs_cdev_major = cdevsw_add(-1, &afs_cdev);
     if (afs_cdev_major == -1) {
-       printf("AFS: cdevsw_add failed. aborting\n");
+       afs_warn("AFS: cdevsw_add failed. aborting\n");
        goto cdevsw_out;
     }
     afs_cdev_devfs_handle = devfs_make_node(makedev(afs_cdev_major, 0),
                                             DEVFS_CHAR, UID_ROOT, GID_WHEEL,
                                             0666, "openafs_ioctl", 0);
     if (!afs_cdev_devfs_handle) {
-       printf("AFS: devfs_make_node failed. aborting\n");
+       afs_warn("AFS: devfs_make_node failed. aborting\n");
        cdevsw_remove(afs_cdev_major, &afs_cdev);
     cdevsw_out:
        vfs_fsremove(afs_vfstable);
@@ -88,11 +88,11 @@ afs_modload(struct kmod_info *kmod_info, void *data)
     afs_vfsconf.vfc_typenum = maxvfsconf++;    /* oddly not VT_AFS */
     afs_vfsconf.vfc_flags = MNT_NODEV;
     if (vfsconf_add(&afs_vfsconf)) {
-       printf("AFS: vfsconf_add failed. aborting\n");
+       afs_warn("AFS: vfsconf_add failed. aborting\n");
        return KERN_FAILURE;
     }
     if (sysent[AFS_SYSCALL].sy_call != nosys) {
-       printf("AFS_SYSCALL in use. aborting\n");
+       afs_warn("AFS_SYSCALL in use. aborting\n");
        return KERN_FAILURE;
     }
     sysent[SYS_setgroups].sy_call = Afs_xsetgroups;
@@ -103,7 +103,7 @@ afs_modload(struct kmod_info *kmod_info, void *data)
     sysent[AFS_SYSCALL].sy_funnel = KERNEL_FUNNEL;
 #endif
 #endif
-    printf("%s kext loaded; %u pages at 0x%lx (load tag %u).\n",
+    afs_warn("%s kext loaded; %u pages at 0x%lx (load tag %u).\n",
           kmod_info->name, (unsigned)kmod_info->size / PAGE_SIZE,
           (unsigned long)kmod_info->address, (unsigned)kmod_info->id);
 
@@ -135,7 +135,7 @@ afs_modunload(struct kmod_info * kmod_info, void *data)
     MUTEX_FINISH();
     lck_mtx_free(afs_global_lock, openafs_lck_grp);
 #endif
-    printf("%s kext unloaded; (load tag %u).\n",
+    afs_warn("%s kext unloaded; (load tag %u).\n",
           kmod_info->name, (unsigned)kmod_info->id);
     return KERN_SUCCESS;
 }
index f97bbc9..29e1c8e 100644 (file)
@@ -357,7 +357,7 @@ case $AFS_SYSNAME in
                XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
                ;;
 
-       *_darwin_100 | *_darwin_110 )
+       *_darwin_100 | *_darwin_110 | *_darwin_120 )
                AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
                MT_CFLAGS="-D_REENTRANT"
                MT_LIBS='${XLIBS}'
index 81ec4c9..e42f519 100644 (file)
@@ -70,6 +70,9 @@
 #define SYS_NAME_ID_x86_darwin_110       517
 #define SYS_NAME_ID_amd64_darwin_110     518
 #define SYS_NAME_ID_arm_darwin_110       519
+#define SYS_NAME_ID_x86_darwin_120       520
+#define SYS_NAME_ID_amd64_darwin_120     521
+#define SYS_NAME_ID_arm_darwin_120       522
 
 #define SYS_NAME_ID_next_mach20                 601
 #define SYS_NAME_ID_next_mach30                 602
index 50f0e4b..46b04c2 100644 (file)
@@ -49,9 +49,9 @@ KOPTS_DBUG=-ggdb
 <x86_darwin_100 x86_darwin_110>
 KOPTS_DBUG=-gdwarf-2
 <ppc_darwin_80 x86_darwin_80 ppc_darwin_90 x86_darwin_90 x86_darwin_100 x86_darwin_110>
-KOPTS_ppc=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -mcpu=750 -mmultiple -fschedule-insns -force_cpusubtype_ALL
-KOPTS_x86=-static -nostdinc -nostdlib -fmessage-length=0 -pipe -nostdinc -fno-builtin -Wno-trigraphs -force_cpusubtype_ALL -msoft-float -O0 -fno-common -mkernel -finline -fno-keep-inline-functions -fasm-blocks -arch i386 -Di386 -DI386 -D__I386__ -DPAGE_SIZE_FIXED
-KOPTS_amd64=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch x86_64 -Damd64 -DAMD64 -D__AMD64__ -DPAGE_SIZE_FIXED -march=x86-64 -mpreferred-stack-boundary=4 -falign-functions=4 -m64 -mkernel -mno-red-zone
+KOPTS_ppc=-static -nostdinc -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -mcpu=750 -mmultiple -fschedule-insns -force_cpusubtype_ALL
+KOPTS_x86=-static -nostdinc -fmessage-length=0 -pipe -nostdinc -fno-builtin -Wno-trigraphs -force_cpusubtype_ALL -msoft-float -O0 -fno-common -mkernel -finline -fno-keep-inline-functions -fasm-blocks -arch i386 -Di386 -DI386 -D__I386__ -DPAGE_SIZE_FIXED
+KOPTS_amd64=-static -nostdinc -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch x86_64 -Damd64 -DAMD64 -D__AMD64__ -DPAGE_SIZE_FIXED -march=x86-64 -mpreferred-stack-boundary=4 -falign-functions=4 -m64 -mkernel -mno-red-zone
 ARCH_ppc=$(shell echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes || echo ${ARCHFLAGS} | egrep -q -w -v 'ppc|i386|x86_64' && arch | grep -q -w ppc && echo yes)
 ARCH_x86=$(shell echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes || echo ${ARCHFLAGS} | egrep -q -w -v 'ppc|i386|x86_64' && arch | grep -q -w i386 && echo yes)
 ARCH_amd64=$(shell echo "${ARCHFLAGS}" | grep -q -w x86_64 && echo yes || echo ${ARCHFLAGS} | egrep -q -w -v 'ppc|i386|x86_64' && arch | grep -q -w x86_64 && echo yes)
@@ -105,7 +105,6 @@ CRULE_OPT_amd64=$(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_amd64
 CRULE_OPT=$(shell echo "${ARCH_ppc}" | grep -q -w yes && echo "${CRULE_OPT_ppc} && "; echo "${ARCH_x86}" | grep -q -w yes && echo "${CRULE_OPT_x86} && "; echo "${ARCH_amd64}" | grep -q -w yes && echo "${CRULE_OPT_amd64} && ";echo "lipo -create ${OBJ_ppc} ${OBJ_x86} ${OBJ_amd64} -output $@ && true")
 
 <all -ppc_darwin_80 -x86_darwin_80 -ppc_darwin_90 -x86_darwin_90 -x86_darwin_100 -x86_darwin_110>
-MODLD=$(LD)
 CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
 <ppc_darwin_70>
 KOPTS=-static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch 
diff --git a/src/libafs/afs.x86_darwin_120.plist.in b/src/libafs/afs.x86_darwin_120.plist.in
new file mode 100644 (file)
index 0000000..a138571
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>afs</string>
+       <key>CFBundleIdentifier</key>
+       <string>org.openafs.filesystems.afs</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>8.0</string>
+       <key>CFBundleName</key>
+       <string>afs</string>
+       <key>CFBundlePackageType</key>
+       <string>KEXT</string>
+       <key>CFBundleShortVersionString</key>
+       <string>@MACOS_VERSION@</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>@MACOS_VERSION@</string>
+       <key>OSBundleLibraries</key>
+       <dict>
+               <key>com.apple.kpi.bsd</key>
+               <string>8.0.0</string>
+               <key>com.apple.kpi.mach</key>
+               <string>8.0.0</string>
+               <key>com.apple.kpi.libkern</key>
+               <string>8.0</string>
+       </dict>
+</dict>
+</plist>
diff --git a/src/packaging/MacOS/InstallationCheck.12 b/src/packaging/MacOS/InstallationCheck.12
new file mode 100644 (file)
index 0000000..28a6e1f
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+majorvers=`uname -r | sed 's/\..*//'`
+if [ $majorvers -ne 12 ]; then
+       exit 112
+fi
+
+# check for temporary versions of ThisCell and CellAlias
+# and move them aside
+tmpthiscell=/private/tmp/org.OpenAFS.Install.ThisCell.$USER
+tmpcellalias=/private/tmp/org.OpenAFS.Install.CellAlias.$USER
+date=`date +%Y%m%d%H%M`
+if [ -e $tmpthiscell ]; then
+    mv -f $tmpthiscell $tmpthiscell.$date
+fi
+if [ -e $tmpcellalias ]; then
+    mv -f $tmpcellalias $tmpcellalias.$date
+fi
+
+exit 0
diff --git a/src/packaging/MacOS/InstallationCheck.strings.12 b/src/packaging/MacOS/InstallationCheck.strings.12
new file mode 100644 (file)
index 0000000..f25b14d
--- /dev/null
@@ -0,0 +1 @@
+"16" = "This OpenAFS release requires Mountain Lion (10.8)";
diff --git a/src/packaging/MacOS/ReadMe.rtf.12 b/src/packaging/MacOS/ReadMe.rtf.12
new file mode 100644 (file)
index 0000000..3e8c9d6
--- /dev/null
@@ -0,0 +1,7 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww9000\viewh9000\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\fs24 \cf0 This release of OpenAFS is targeted at MacOS 10.8 (Mountain Lion) and is not recommended for use with any other version.}
\ No newline at end of file
index cdd9509..8de2041 100644 (file)
@@ -40,6 +40,9 @@ fi
 if [ $majorvers -eq 11 ]; then
   RELNAME="Lion"
 fi
+if [ $majorvers -eq 12 ]; then
+  RELNAME="MountainLion"
+fi
 
 PKGROOT=$CURDIR/pkgroot
 PKGRES=$CURDIR/pkgres