Meta: Fix build-root-filesystem.sh on macOS

This commit is contained in:
Valtteri Koskivuori 2020-09-20 22:34:14 +03:00 committed by Andreas Kling
parent 03a27bc693
commit f0fdbb1d83
Notes: sideshowbarker 2024-07-19 02:19:09 +09:00

View file

@ -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.