diff options
author | Gunnar Beutner <gunnar@beutner.name> | 2021-04-23 20:55:42 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-23 22:34:05 +0200 |
commit | 511ffa8d68996473457f655869e0af6987778148 (patch) | |
tree | 21e7aacc390f17bf53ffe7d35f95d73a0a05b996 /Meta/build-root-filesystem.sh | |
parent | 479905be6c9bf6cf5731998dce76d48d609755ee (diff) | |
download | serenity-511ffa8d68996473457f655869e0af6987778148.zip |
Meta: Support using rsync to install the root filesystem
Using rsync is significantly faster when we're using an existing
image because we only have to copy files which are new or have
been updated. This cuts down the image creation time to about
a second or two assuming an old image exists.
Diffstat (limited to 'Meta/build-root-filesystem.sh')
-rwxr-xr-x | Meta/build-root-filesystem.sh | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Meta/build-root-filesystem.sh b/Meta/build-root-filesystem.sh index 455dbc611f..cc922fefbb 100755 --- a/Meta/build-root-filesystem.sh +++ b/Meta/build-root-filesystem.sh @@ -32,9 +32,15 @@ fi umask 0022 printf "installing base system... " -$CP -PdR "$SERENITY_SOURCE_DIR"/Base/* mnt/ +if command -v rsync >/dev/null; then + rsync -aH --inplace "$SERENITY_SOURCE_DIR"/Base/ mnt/ + rsync -aH --inplace Root/ mnt/ +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/ +fi $CP "$SERENITY_SOURCE_DIR"/Toolchain/Local/i686/i686-pc-serenity/lib/libgcc_s.so mnt/usr/lib/ -$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. @@ -108,22 +114,22 @@ chown -R 200:200 mnt/home/nona echo "done" printf "adding some desktop icons..." -ln -s /bin/Browser mnt/home/anon/Desktop/ -ln -s /bin/TextEditor mnt/home/anon/Desktop/ -ln -s /bin/Help mnt/home/anon/Desktop/ -ln -s /home/anon mnt/home/anon/Desktop/Home +ln -sf /bin/Browser mnt/home/anon/Desktop/ +ln -sf /bin/TextEditor mnt/home/anon/Desktop/ +ln -sf /bin/Help mnt/home/anon/Desktop/ +ln -sf /home/anon mnt/home/anon/Desktop/Home echo "done" printf "installing shortcuts... " -ln -s Shell mnt/bin/sh -ln -s test mnt/bin/[ +ln -sf Shell mnt/bin/sh +ln -sf test mnt/bin/[ echo "done" printf "installing 'checksum' variants... " -ln -s checksum mnt/bin/md5sum -ln -s checksum mnt/bin/sha1sum -ln -s checksum mnt/bin/sha256sum -ln -s checksum mnt/bin/sha512sum +ln -sf checksum mnt/bin/md5sum +ln -sf checksum mnt/bin/sha1sum +ln -sf checksum mnt/bin/sha256sum +ln -sf checksum mnt/bin/sha512sum echo "done" # Run local sync script, if it exists |