]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
macos: add entry for afs into synthetic.conf
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Sun, 22 Dec 2019 03:56:41 +0000 (19:56 -0800)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 14 Feb 2020 19:33:13 +0000 (14:33 -0500)
The root mount point is read-only as of macOS 10.15. As a result, /afs
cannot be created at this location. To workaround this restriction,
macOS 10.15 provides an alternative way to create mount points at the
root. To make it possible, an entry for the mount point in question must
be added to /etc/synthetic.conf. The synthetic entities described in
this file are not physically present on the disk. Instead, they are
synthesized by the kernel during system boot.

This commit adds an entry for afs into the file mentioned above. Knowing
that this change only takes effect after reboot, also provide directions
to the user during the installation process.

Reviewed-on: https://gerrit.openafs.org/13928
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Yadavendra Yadav <yadayada@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit daf6616aab6732d6b417c15f6f401731ef8e44b5)

Change-Id: If990608d968061ac8ab0391dbd83d1c6a87d32a6
Reviewed-on: https://gerrit.openafs.org/14037
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/packaging/MacOS/OpenAFS.post_install

index b9ef27b40c359a58c5b075e795020240df0566c5..eb236bf497f553601f311516ad4692756c1abee3 100644 (file)
@@ -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 -wqs '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
@@ -136,3 +141,21 @@ fi
 #here we should run tools which configure the client, and then if it's enabled:
 #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