From f0fdbb1d83f04efac49bd0fe5e359be4291f5832 Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Sun, 20 Sep 2020 22:34:14 +0300 Subject: [PATCH] Meta: Fix build-root-filesystem.sh on macOS --- Meta/build-root-filesystem.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Meta/build-root-filesystem.sh b/Meta/build-root-filesystem.sh index ac637ccf92..a66a13e1b4 100755 --- a/Meta/build-root-filesystem.sh +++ b/Meta/build-root-filesystem.sh @@ -10,6 +10,14 @@ utmp_gid=5 window_uid=13 window_gid=13 +CP="cp" + +# cp on macOS does not support the -d option. +# gcp comes with coreutils, which is already a dependency. +if [ "$(uname -s)" = "Darwin" ]; then + CP=gcp +fi + die() { echo "die: $*" exit 1 @@ -25,8 +33,8 @@ fi umask 0022 printf "installing base system... " -cp -PdR "$SERENITY_ROOT"/Base/* mnt/ -cp -PdR Root/* mnt/ +$CP -PdR "$SERENITY_ROOT"/Base/* mnt/ +$CP -PdR Root/* mnt/ # If umask was 027 or similar when the repo was cloned, # file permissions in Base/ are too restrictive. Restore # the permissions needed in the image.