mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
adapt to apfs.util flag diff in catalina/big sur
Fixes #3957. Just runs both forms to minimize moving parts.
This commit is contained in:
parent
e736f8f6e4
commit
fe807904e5
1 changed files with 15 additions and 1 deletions
|
@ -26,6 +26,20 @@ test_synthetic_conf() {
|
||||||
grep -q "^nix$" /etc/synthetic.conf 2>/dev/null
|
grep -q "^nix$" /etc/synthetic.conf 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Create the paths defined in synthetic.conf, saving us a reboot.
|
||||||
|
create_synthetic_objects(){
|
||||||
|
# Big Sur takes away the -B flag we were using and replaces it
|
||||||
|
# with a -t flag that appears to do the same thing (but they
|
||||||
|
# don't behave exactly the same way in terms of return values).
|
||||||
|
# This feels a little dirty, but as far as I can tell the
|
||||||
|
# simplest way to get the right one is to just throw away stderr
|
||||||
|
# and call both... :]
|
||||||
|
{
|
||||||
|
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t || true # Big Sur
|
||||||
|
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -B || true # Catalina
|
||||||
|
} >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
test_nix() {
|
test_nix() {
|
||||||
test -d "/nix"
|
test -d "/nix"
|
||||||
}
|
}
|
||||||
|
@ -101,7 +115,7 @@ main() {
|
||||||
|
|
||||||
if ! test_nix; then
|
if ! test_nix; then
|
||||||
echo "Creating mountpoint for /nix..." >&2
|
echo "Creating mountpoint for /nix..." >&2
|
||||||
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -B || true
|
create_synthetic_objects # the ones we defined in synthetic.conf
|
||||||
if ! test_nix; then
|
if ! test_nix; then
|
||||||
sudo mkdir -p /nix 2>/dev/null || true
|
sudo mkdir -p /nix 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue