mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:07:46 +00:00
Meta: Allow running run.sh from any where by setting SERENITY_BUILD
If SERENITY_BUILD is not set or empty, SERENITY_BUILD is treated as if it was set to '.'. `run.sh` will cd to SERENITY_BUILD before running the emulator. Also, export SERENITY_BUILD in `Meta/CLion/run.sh` since we are using it in `Meta/run.sh`. Also, allow using a different bochs configuration file by setting the SERENITY_BOCHSRC variable.
This commit is contained in:
parent
aabb482d5c
commit
1d9791bcdf
2 changed files with 15 additions and 1 deletions
|
@ -7,6 +7,7 @@ export SERENITY_RAM_SIZE
|
||||||
|
|
||||||
# set this to the Build directory in serenity
|
# set this to the Build directory in serenity
|
||||||
: "${SERENITY_BUILD:='/mnt/c/Users/Ragnarok/serenity-project/serenity/Build'}"
|
: "${SERENITY_BUILD:='/mnt/c/Users/Ragnarok/serenity-project/serenity/Build'}"
|
||||||
|
export SERENITY_BUILD
|
||||||
|
|
||||||
cd -P -- "$SERENITY_BUILD" || exit
|
cd -P -- "$SERENITY_BUILD" || exit
|
||||||
make install
|
make install
|
||||||
|
|
15
Meta/run.sh
15
Meta/run.sh
|
@ -3,6 +3,11 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo "die: $*"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
#SERENITY_PACKET_LOGGING_ARG="-object filter-dump,id=hue,netdev=breh,file=e1000.pcap"
|
#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"
|
[ -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
|
export SDL_VIDEO_X11_DGAMOUSE=0
|
||||||
|
|
||||||
|
: "${SERENITY_BUILD:=.}"
|
||||||
|
cd -P -- "$SERENITY_BUILD" || die "Could not cd to \"$SERENITY_BUILD\""
|
||||||
|
|
||||||
if [ "$1" = "b" ]; then
|
if [ "$1" = "b" ]; then
|
||||||
# ./run b: bochs
|
# ./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
|
elif [ "$1" = "qn" ]; then
|
||||||
# ./run qn: qemu without network
|
# ./run qn: qemu without network
|
||||||
"$SERENITY_QEMU_BIN" \
|
"$SERENITY_QEMU_BIN" \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue