diff --git a/Meta/CLion/run.sh b/Meta/CLion/run.sh index 96ca0e3201..1ded36b877 100755 --- a/Meta/CLion/run.sh +++ b/Meta/CLion/run.sh @@ -7,6 +7,7 @@ export SERENITY_RAM_SIZE # set this to the Build directory in serenity : "${SERENITY_BUILD:='/mnt/c/Users/Ragnarok/serenity-project/serenity/Build'}" +export SERENITY_BUILD cd -P -- "$SERENITY_BUILD" || exit make install diff --git a/Meta/run.sh b/Meta/run.sh index d7ed43d6c0..934960cbaf 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -3,6 +3,11 @@ set -e +die() { + echo "die: $*" + exit 1 +} + #SERENITY_PACKET_LOGGING_ARG="-object filter-dump,id=hue,netdev=breh,file=e1000.pcap" [ -e /dev/kvm ] && [ -r /dev/kvm ] && [ -w /dev/kvm ] && SERENITY_KVM_ARG="-enable-kvm" @@ -47,9 +52,17 @@ $SERENITY_EXTRA_QEMU_ARGS export SDL_VIDEO_X11_DGAMOUSE=0 +: "${SERENITY_BUILD:=.}" +cd -P -- "$SERENITY_BUILD" || die "Could not cd to \"$SERENITY_BUILD\"" + if [ "$1" = "b" ]; then # ./run b: bochs - "$SERENITY_BOCHS_BIN" -q -f "$SERENITY_ROOT/Meta/bochsrc" + [ -z "$SERENITY_BOCHSRC" ] && { + # Make sure that SERENITY_ROOT is set and not empty + [ -z "$SERENITY_ROOT" ] && die 'SERENITY_ROOT not set or empty' + SERENITY_BOCHSRC="$SERENITY_ROOT/Meta/bochsrc" + } + "$SERENITY_BOCHS_BIN" -q -f "$SERENITY_BOCHSRC" elif [ "$1" = "qn" ]; then # ./run qn: qemu without network "$SERENITY_QEMU_BIN" \