summaryrefslogtreecommitdiff
path: root/Meta/build-root-filesystem.sh
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-07-13 07:48:21 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-13 13:30:29 +0200
commit77795b2c8f10ab2c6d5aaf995d209887ec1b1a17 (patch)
tree5aa8182e7bec9403ef21f9db5636b45ba6c967ec /Meta/build-root-filesystem.sh
parent7347c20fe6893ded480c1128f6228fbf1433d485 (diff)
downloadserenity-77795b2c8f10ab2c6d5aaf995d209887ec1b1a17.zip
Meta: Make sure files are installed with the right UID and GID
Unfortunately we can't just use --chown everywhere because only rsync version 3.1 and newer support it and the default rsync on macOS is 2.6.9. Fixes #8711.
Diffstat (limited to 'Meta/build-root-filesystem.sh')
-rwxr-xr-xMeta/build-root-filesystem.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/Meta/build-root-filesystem.sh b/Meta/build-root-filesystem.sh
index c8a6389d72..922d6d52ef 100755
--- a/Meta/build-root-filesystem.sh
+++ b/Meta/build-root-filesystem.sh
@@ -33,12 +33,19 @@ umask 0022
printf "installing base system... "
if command -v rsync >/dev/null; then
- rsync -aH --inplace "$SERENITY_SOURCE_DIR"/Base/ mnt/
- rsync -aH --inplace Root/ mnt/
+ if rsync --chown 2>&1 | grep "missing argument" >/dev/null; then
+ rsync -aH --chown=0:0 --inplace "$SERENITY_SOURCE_DIR"/Base/ mnt/
+ rsync -aH --chown=0:0 --inplace Root/ mnt/
+ else
+ rsync -aH --inplace "$SERENITY_SOURCE_DIR"/Base/ mnt/
+ rsync -aH --inplace Root/ mnt/
+ chown -R 0:0 mnt/
+ fi
else
echo "Please install rsync to speed up image creation times, falling back to cp for now"
$CP -PdR "$SERENITY_SOURCE_DIR"/Base/* mnt/
$CP -PdR Root/* mnt/
+ chown -R 0:0 mnt/
fi
SERENITY_ARCH="${SERENITY_ARCH:-i686}"
$CP "$SERENITY_SOURCE_DIR"/Toolchain/Local/"$SERENITY_ARCH"/"$SERENITY_ARCH"-pc-serenity/lib/libgcc_s.so mnt/usr/lib/
@@ -88,8 +95,6 @@ if [ -f mnt/bin/utmpupdate ]; then
chmod 2755 mnt/bin/utmpupdate
fi
-chown 0:0 mnt/boot/Kernel
-chown 0:0 mnt/res/kernel.map
chmod 0400 mnt/res/kernel.map
chmod 0400 mnt/boot/Kernel
chmod 600 mnt/etc/shadow
@@ -142,7 +147,6 @@ cp -r "$SERENITY_SOURCE_DIR"/Userland/Libraries/LibJS/Tests/test-common.js mnt/h
chmod 700 mnt/root
chmod 700 mnt/home/anon
chmod 700 mnt/home/nona
-chown -R 0:0 mnt/root
chown -R 100:100 mnt/home/anon
chown -R 200:200 mnt/home/nona
echo "done"