-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
part4: config/, scripts/, contrib/* Signed-off-by: Jorgen Lundman <[email protected]>
- Loading branch information
Showing
28 changed files
with
1,995 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
dnl # | ||
dnl # macOS - attempt to find kernel headers. This is expected to | ||
dnl # only run on mac platforms (using xcrun command) to iterate | ||
dnl # through versions of xcode, and xnu kernel source locations | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MACOS_HEADERS], [ | ||
AM_COND_IF([BUILD_MACOS], [ | ||
AC_MSG_CHECKING([macOS kernel source directory]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
system_major_version=`sw_vers -productVersion | $AWK -F '.' '{ print $[]1 "." $[]2 }'` | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${system_major_version}.sdk/System/Library/Frameworks/Kernel.framework/Headers"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${system_major_version}.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/System/Library/Frameworks/Kernel.framework/Headers"], [ | ||
kernelsrc="/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
tmpdir=`xcrun --show-sdk-path` | ||
AS_IF([test -d "$tmpdir/System/Library/Frameworks/Kernel.framework/Headers"], [ | ||
kernelsrc="$tmpdir/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Kernel.framework"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AC_MSG_RESULT([$kernelsrc]) | ||
AC_MSG_CHECKING([macOS kernel build directory]) | ||
AS_IF([test -z "$kernelbuild"], [ | ||
kernelbuild=${kernelsrc} | ||
]) | ||
]) | ||
AC_MSG_RESULT([$kernelbuild]) | ||
AC_ARG_WITH([kernel-modprefix], | ||
AS_HELP_STRING([--with-kernel-modprefix=PATH], | ||
[Path to kernel module prefix]), | ||
[KERNEL_MODPREFIX="$withval"]) | ||
AC_MSG_CHECKING([macOS kernel module prefix]) | ||
AS_IF([test -z "$KERNEL_MODPREFIX"], [ | ||
KERNEL_MODPREFIX="/Library/Extensions" | ||
]) | ||
AC_MSG_RESULT([$KERNEL_MODPREFIX]) | ||
AC_DEFINE_UNQUOTED([KERNEL_MODPREFIX], | ||
["$KERNEL_MODPREFIX"], | ||
[Path where the kernel module is installed.] | ||
) | ||
AC_MSG_CHECKING([macOS kernel source version]) | ||
utsrelease1=$kernelbuild/Headers/libkern/version.h | ||
AS_IF([test -r $utsrelease1 && fgrep -q OSRELEASE $utsrelease1], [ | ||
kernverfile=libkern/version.h ]) | ||
AS_IF([test "$kernverfile"], [ | ||
kernsrcver=`(echo "#include <$kernverfile>"; | ||
echo "kernsrcver=OSRELEASE") | | ||
cpp -I$kernelbuild/Headers | | ||
grep "^kernsrcver=" | cut -d \" -f 2` | ||
AS_IF([test -z "$kernsrcver"], [ | ||
AC_MSG_RESULT([Not found]) | ||
AC_MSG_ERROR([*** Cannot determine kernel version.]) | ||
]) | ||
AC_MSG_RESULT([$kernsrcver]) | ||
]) | ||
AC_MSG_CHECKING([mach_kernel]) | ||
AS_IF([test -z "$machkernel"], [ | ||
AS_IF([test -e "/System/Library/Kernels/kernel"], [ | ||
machkernel="/System/Library/Kernels/kernel" ] ) | ||
AS_IF([test -e "/mach_kernel"], [ | ||
machkernel="/mach_kernel" ] ) | ||
AS_IF([test ! -f "$machkernel"], [ | ||
AC_MSG_ERROR([ | ||
*** mach_kernel file not found. For 10.9 and prior, this should be | ||
*** '/mach_kernel' and for 10.10 and following, this should be | ||
*** '/System/Library/Kernels/kernel']) | ||
]) | ||
]) | ||
AC_MSG_RESULT($machkernel) | ||
dnl More Generic names: | ||
MACH_KERNEL=${machkernel} | ||
KERNEL_HEADERS=${kernelsrc} | ||
KERNEL_VERSION=${kernsrcver} | ||
AC_SUBST(KERNEL_HEADERS) | ||
AC_SUBST(KERNEL_MODPREFIX) | ||
AC_SUBST(KERNEL_VERSION) | ||
AC_SUBST(MACH_KERNEL) | ||
]) | ||
]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
AC_DEFUN([ZFS_AC_MACOS_IMPURE_ENABLE], [ | ||
AC_ARG_ENABLE(macos_impure, | ||
AS_HELP_STRING([--enable-macos-impure], | ||
[Use XNU Private.exports [[default: no]]]), | ||
[CPPFLAGS="$CPPFLAGS -DMACOS_IMPURE"], | ||
[]) | ||
]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/perl | ||
|
||
$0 =~ m/.*\/(.*)$/; | ||
my $stage = $1; | ||
my $action = $ARGV[3]; | ||
my $wd = `pwd`; | ||
chomp($wd); | ||
my $actionsDir = $wd . "/" . 'postinstall' . "_actions/"; | ||
my $upgradeDir = $wd . "/" . 'postupgrade' . "_actions/"; | ||
my $upgrade = 0; | ||
my $debug = 1; | ||
|
||
if ( $0 =~ /postupgrade/ || $0 =~ /preupgrade/ || $action =~ /upgrade/) { | ||
system("logger -p install.info 'Upgrade scripts will be run.'") if ( $debug ); | ||
$upgrade = 1; | ||
} | ||
|
||
if ( $stage =~ /pre/ ) | ||
{ | ||
$actionsDir = $wd . "/" . 'preinstall' . "_actions/"; | ||
$upgradeDir = $wd . "/" . 'preupgrade' . "_actions/"; | ||
} | ||
|
||
if ( $upgrade == 1 && -e $upgradeDir ) { | ||
system("logger -p install.info 'Running Upgrade Scripts . . .'") if ( $debug ); | ||
$count = 0; | ||
foreach my $action (`/bin/ls \"$upgradeDir\"`) { | ||
chomp($action); | ||
system("logger -p install.info 'Begin script: $action'") if ( $debug ); | ||
system($upgradeDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3]) == 0 or die; | ||
system("logger -p install.info 'End script: $action'") if ( $debug ); | ||
$count++; | ||
} | ||
system("logger -p install.info '$count Upgrade Scripts run.'") if ( $debug ); | ||
} | ||
|
||
if ( -e $actionsDir ) { | ||
system("logger -p install.info 'Running Install Scripts . . .'") if ( $debug ); | ||
$count = 0; | ||
foreach my $action (`/bin/ls \"$actionsDir\"`) { | ||
chomp($action); | ||
system("logger -p install.info 'Begin script: $action'") if ( $debug ); | ||
system($actionsDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3],$upgrade) == 0 or die; | ||
system("logger -p install.info 'End script: $action'") if ( $debug ); | ||
$count++; | ||
} | ||
system("logger -p install.info '$count Install Scripts run.'") if ( $debug ); | ||
} | ||
|
||
exit(0); | ||
|
Oops, something went wrong.