summaryrefslogtreecommitdiff
path: root/Meta/build-root-filesystem.sh
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-08-22 10:11:17 +0300
committerAndreas Kling <kling@serenityos.org>2021-08-22 10:28:13 +0200
commit6f4324e64eb57013f74a82b9cba6a1f915d61b9e (patch)
tree07109cedf23ca78c1c43a0e47f5f7520b09b2946 /Meta/build-root-filesystem.sh
parentf6f429bfbc4c54377a92293c6d6b521b0ca8f532 (diff)
downloadserenity-6f4324e64eb57013f74a82b9cba6a1f915d61b9e.zip
Meta: Add 'copy-src' command to serenity.sh
This command copies the project's source tree to /home/anon/Source/serenity in the built disk image. This will be useful for working on serenity inside serenity :^)
Diffstat (limited to 'Meta/build-root-filesystem.sh')
-rwxr-xr-xMeta/build-root-filesystem.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/Meta/build-root-filesystem.sh b/Meta/build-root-filesystem.sh
index 1660e2f47d..9d9bc52faa 100755
--- a/Meta/build-root-filesystem.sh
+++ b/Meta/build-root-filesystem.sh
@@ -155,6 +155,15 @@ cp -r "$SERENITY_SOURCE_DIR"/Userland/Libraries/LibCpp/Tests/parser mnt/home/ano
cp -r "$SERENITY_SOURCE_DIR"/Userland/Libraries/LibCpp/Tests/preprocessor mnt/home/anon/cpp-tests/preprocessor
cp -r "$SERENITY_SOURCE_DIR"/Userland/Libraries/LibWasm/Tests mnt/home/anon/wasm-tests
cp -r "$SERENITY_SOURCE_DIR"/Userland/Libraries/LibJS/Tests/test-common.js mnt/home/anon/wasm-tests
+
+if [ -n "$SERENITY_COPY_SOURCE" ] ; then
+ printf "\ncopying Serenity's source... "
+ rm -fr mnt/home/anon/Source/serenity
+ mkdir -p mnt/home/anon/Source/serenity
+ git clone --depth=1 file://"$SERENITY_SOURCE_DIR" mnt/home/anon/Source/serenity
+ rm -fr mnt/home/anon/Source/serenity/.git
+fi
+
chmod 700 mnt/root
chmod 700 mnt/home/anon
chmod 700 mnt/home/nona