From ada611d597c935f95a807db8ac7bf01e386937fa Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 7 Dec 2017 08:56:15 -0800 Subject: Go ahead and load kext so MacOS High Sierra users will see kext auth dialog right away. --- ext/installfiles/mac/ZeroTier One.pkgproj | 22 +++++++++++++++++++++- ext/installfiles/mac/launch.sh | 6 +----- ext/installfiles/mac/postinst.sh | 14 ++++++++++---- make-mac.mk | 2 +- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/ext/installfiles/mac/ZeroTier One.pkgproj b/ext/installfiles/mac/ZeroTier One.pkgproj index 96b1338a..59c22dde 100755 --- a/ext/installfiles/mac/ZeroTier One.pkgproj +++ b/ext/installfiles/mac/ZeroTier One.pkgproj @@ -613,6 +613,12 @@ PAYLOAD_TYPE 0 + SHOW_INVISIBLE + + SPLIT_FORKS + + TREAT_MISSING_FILES_AS_WARNING + VERSION 3 @@ -641,12 +647,24 @@ 1 CONCLUSION_ACTION 0 + FOLLOW_SYMBOLIC_LINKS + IDENTIFIER com.zerotier.pkg.ZeroTierOne + LOCATION + 0 + NAME + OVERWRITE_PERMISSIONS + PAYLOAD_SIZE + -1 + RELOCATABLE + + USE_HFS+_COMPRESSION + VERSION - 1.2.4 + 1.2.6 PROJECT_COMMENTS @@ -862,6 +880,8 @@ NAME ZeroTier One + PAYLOAD_ONLY + TYPE diff --git a/ext/installfiles/mac/launch.sh b/ext/installfiles/mac/launch.sh index 41c4b9c8..b02a6670 100755 --- a/ext/installfiles/mac/launch.sh +++ b/ext/installfiles/mac/launch.sh @@ -1,7 +1,3 @@ #!/bin/bash - -zthome="/Library/Application Support/ZeroTier/One" -export PATH="$zthome:/bin:/usr/bin:/sbin:/usr/sbin" - -# Launch ZeroTier One (not as daemon... launchd monitors it) +export PATH="/Library/Application Support/ZeroTier/One:/bin:/usr/bin:/sbin:/usr/sbin" exec zerotier-one diff --git a/ext/installfiles/mac/postinst.sh b/ext/installfiles/mac/postinst.sh index 4f5a50c2..b4ea2ee2 100755 --- a/ext/installfiles/mac/postinst.sh +++ b/ext/installfiles/mac/postinst.sh @@ -5,7 +5,7 @@ export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin OSX_RELEASE=`sw_vers -productVersion | cut -d . -f 1,2` launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 -sleep 1 +sleep 0.5 cd "/Library/Application Support/ZeroTier/One" @@ -23,29 +23,35 @@ if [ "$OSX_RELEASE" = "10.7" ]; then fi rm -rf node.log node.log.old root-topology shutdownIfUnreadable autoupdate.log updates.d ui peers.save + chown -R 0 tap.kext chgrp -R 0 tap.kext + if [ ! -f authtoken.secret ]; then - head -c 4096 /dev/urandom | md5 | head -c 24 >authtoken.secret + head -c 1024 /dev/urandom | md5 | head -c 24 >authtoken.secret chown 0 authtoken.secret chgrp 0 authtoken.secret chmod 0600 authtoken.secret fi + rm -f zerotier-cli zerotier-idtool ln -sf zerotier-one zerotier-cli ln -sf zerotier-one zerotier-idtool - mkdir -p /usr/local/bin cd /usr/local/bin rm -f zerotier-cli zerotier-idtool ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" zerotier-cli ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" zerotier-idtool +cd "/Library/Application Support/ZeroTier/One" +kextload -r . tap.kext >>/dev/null 2>&1 & +disown %1 + launchctl load /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 sleep 1 -if [ -f /tmp/zt1-gui-restart.tmp ]; +if [ -f /tmp/zt1-gui-restart.tmp ]; then for u in `cat /tmp/zt1-gui-restart.tmp`; do su $u -c '/Applications/ZeroTier\ One.app/Contents/MacOS/ZeroTier\ One &' >>/dev/null 2>&1 & done diff --git a/make-mac.mk b/make-mac.mk index 196b17cb..4184792f 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -111,7 +111,7 @@ mac-dist-pkg: FORCE # For ZeroTier, Inc. to build official signed packages official: FORCE make clean - make ZT_OFFICIAL_RELEASE=1 -j 4 one + make ZT_OFFICIAL_RELEASE=1 -j 8 one make ZT_OFFICIAL_RELEASE=1 macui make ZT_OFFICIAL_RELEASE=1 mac-dist-pkg -- cgit v1.2.3