diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-09-22 10:58:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-22 10:58:02 +0200 |
commit | 3c1cd09109752e98b0a6958ead2e0c79a636b242 (patch) | |
tree | a1a67433817aacb2768b3d0bd76d350c5cdf4706 | |
parent | c81f9761ccb40865edc497321752503abc0da858 (diff) | |
parent | 033081aec29e33428b338cbe081e1df86337a3cd (diff) |
Merge pull request #5281 from abathur/install_macos_monterey
fix install on macOS monterey
-rw-r--r-- | scripts/install-darwin-multi-user.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/install-darwin-multi-user.sh b/scripts/install-darwin-multi-user.sh index a5166de64..32a12f2ee 100644 --- a/scripts/install-darwin-multi-user.sh +++ b/scripts/install-darwin-multi-user.sh @@ -13,11 +13,22 @@ NIX_BUILD_USER_NAME_TEMPLATE="_nixbld%d" read_only_root() { # this touch command ~should~ always produce an error # as of this change I confirmed /usr/bin/touch emits: + # "touch: /: Operation not permitted" Monterey # "touch: /: Read-only file system" Catalina+ and Big Sur # "touch: /: Permission denied" Mojave # (not matching prefix for compat w/ coreutils touch in case using # an explicit path causes problems; its prefix differs) - [[ "$(/usr/bin/touch / 2>&1)" = *"Read-only file system" ]] + case "$(/usr/bin/touch / 2>&1)" in + *"Read-only file system") # Catalina, Big Sur + return 0 + ;; + *"Operation not permitted") # Monterey + return 0 + ;; + *) + return 1 + ;; + esac # Avoiding the slow semantic way to get this information (~330ms vs ~8ms) # unless using touch causes problems. Just in case, that approach is: |