1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

Meta: Make rsync a hard dependency and remove the fallback code

Previously we'd fall back to using cp if rsync wasn't available. Not
only is this considerably slower it also breaks when some of the files
in the target directory are symlinks because cp tries to dereference
them.

Fixes #8672.
This commit is contained in:
Gunnar Beutner 2021-07-30 18:22:40 +02:00 committed by Andreas Kling
parent 9ea8aa7ffe
commit dff8b3d2d9

View file

@ -32,7 +32,10 @@ fi
umask 0022 umask 0022
printf "installing base system... " printf "installing base system... "
if command -v rsync >/dev/null; then if ! command -v rsync >/dev/null; then
die "Please install rsync."
fi
if rsync --chown 2>&1 | grep "missing argument" >/dev/null; then 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 "$SERENITY_SOURCE_DIR"/Base/ mnt/
rsync -aH --chown=0:0 --inplace Root/ mnt/ rsync -aH --chown=0:0 --inplace Root/ mnt/
@ -41,12 +44,6 @@ if command -v rsync >/dev/null; then
rsync -aH --inplace Root/ mnt/ rsync -aH --inplace Root/ mnt/
chown -R 0:0 mnt/ chown -R 0:0 mnt/
fi 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}" SERENITY_ARCH="${SERENITY_ARCH:-i686}"
$CP "$SERENITY_SOURCE_DIR"/Toolchain/Local/"$SERENITY_ARCH"/"$SERENITY_ARCH"-pc-serenity/lib/libgcc_s.so mnt/usr/lib/ $CP "$SERENITY_SOURCE_DIR"/Toolchain/Local/"$SERENITY_ARCH"/"$SERENITY_ARCH"-pc-serenity/lib/libgcc_s.so mnt/usr/lib/
# If umask was 027 or similar when the repo was cloned, # If umask was 027 or similar when the repo was cloned,