X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fpackaging%2FMacOS%2FOpenAFS.post_install;h=ad6e70429dd60024f4b0dd146ef27c2d5598608a;hp=182b393e8b8c104258d144545bb1dfe6e0d59432;hb=6d6a28720f4eae4652f2628fdfcc30983916f39d;hpb=30f65085f7a53ae073e2c4649a462a3a555ebb61 diff --git a/src/packaging/MacOS/OpenAFS.post_install b/src/packaging/MacOS/OpenAFS.post_install index 182b393..ad6e704 100644 --- a/src/packaging/MacOS/OpenAFS.post_install +++ b/src/packaging/MacOS/OpenAFS.post_install @@ -4,7 +4,12 @@ if [ -d /afs -a ! -h /afs ]; then rmdir /afs fi majorvers=`uname -r | sed 's/\..*//'` -if [ $majorvers -ge 7 ]; then +if [ $majorvers -ge 19 ]; then + # Root mount point is read-only. To workaround this restriction, add a + # synthetic entity for afs into /etc/synthetic.conf. For more information, + # please read man synthetic.conf(5). + grep -qs '^afs$' /etc/synthetic.conf || echo 'afs' >> /etc/synthetic.conf +elif [ $majorvers -ge 7 ]; then # /Network is now readonly, so put AFS in /afs; make sure /afs is a directory if [ -e /afs ]; then if [ -h /afs -o ! -d /afs ]; then @@ -32,6 +37,19 @@ if [ `grep /Network/afs cacheinfo` ]; then mv cacheinfo.new cacheinfo fi +# if the installer plugin generated ThisCell and/or CellAlias +# files, copy them in here +tmpthiscell=/private/tmp/org.OpenAFS.Install.ThisCell.$USER +tmpcellalias=/private/tmp/org.OpenAFS.Install.CellAlias.$USER +if [ -f $tmpthiscell ]; then + cp $tmpthiscell ThisCell + rm -f $tmpthiscell +fi +if [ -f $tmpcellalias ]; then + cp $tmpcellalias CellAlias + rm -f $tmpcellalias +fi + if [ ! -f ThisCell -a -f ThisCell.sample ]; then cp ThisCell.sample ThisCell fi @@ -103,12 +121,41 @@ if [ $majorvers -ge 7 ]; then # make config/settings.plist if it doesn't exist if [ ! -e config/settings.plist -a -e config/settings.plist.orig ]; then cp config/settings.plist.orig config/settings.plist + else + /usr/libexec/PlistBuddy -c "Add :Darwin:All:FSEvents bool" config/settings.plist && /usr/libexec/PlistBuddy -c "Set :Darwin:All:FSEvents true" config/settings.plist fi elif [ -e config/afssettings ]; then # turn off execution of afssettings chmod a-x config/afssettings fi +# properly, we should acquire a certificate from a real CA and ship +# signed binaries. for now, make Application Firewall (Security prefs pane) +# happy like this. See TN2206 +if [ $majorvers -lt 14 ]; then + if [ -f /usr/bin/codesign ]; then + codesign -s - /usr/sbin/afsd + fi +fi + #here we should run tools which configure the client, and then if it's enabled: -/Library/StartupItems/OpenAFS/OpenAFS start +#start the new launchd daemon +launchctl load -w /Library/LaunchDaemons/org.openafs.filesystems.afs.plist +if [ $majorvers -ge 19 ]; then + # Assume that, if /afs is not present, either OpenAFS is being installed for + # the first time or the system was not rebooted after the installation. + # If so, inform what needs to be done to load the client. This procedure is + # unnecessary if OpenAFS is being reinstalled. + if [ ! -d /afs ]; then + osascript -e 'display alert "OpenAFS successfully installed" message ¬ + "If OpenAFS is being installed for the first time on this machine, " & ¬ + "follow the steps below:\n\n" & ¬ + "1. Navigate to System Preferences > Security & Privacy;\n\n" & ¬ + "2. Under the General tab towards the bottom of the window, allow " & ¬ + "the OpenAFS kernel extension to load by clicking on Allow;\n\n" & ¬ + "3. Reboot the machine;\n\n" & ¬ + "Note: An entry for /afs was added in /etc/synthetic.conf. This " & ¬ + "change takes effect only after rebooting the system."' + fi +fi