mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 21:10:30 +00:00
run: Only enable KVM if /dev/kvm is r/w for the current user
This commit is contained in:
parent
50d937152a
commit
e4c80961d9
Notes:
sideshowbarker
2024-07-19 11:23:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e4c80961d96
1 changed files with 6 additions and 4 deletions
10
Kernel/run
10
Kernel/run
|
@ -1,5 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -e /dev/kvm -a -r /dev/kvm -a -w /dev/kvm ] && SERENITY_KVM_ARG="-enable-kvm"
|
||||
|
||||
[ -z "$SERENITY_QEMU_BIN" ] && SERENITY_QEMU_BIN="qemu-system-i386"
|
||||
|
||||
[ -z "$SERENITY_KERNEL_CMDLINE" ] && SERENITY_KERNEL_CMDLINE="hello"
|
||||
|
@ -33,7 +35,7 @@ elif [ "$1" = "qtap" ]; then
|
|||
# ./run qtap: qemu with tap
|
||||
sudo $SERENITY_QEMU_BIN \
|
||||
$SERENITY_COMMON_QEMU_ARGS \
|
||||
-enable-kvm \
|
||||
$SERENITY_KVM_ARG \
|
||||
-object filter-dump,id=hue,netdev=br0,file=e1000.pcap \
|
||||
-netdev tap,ifname=tap0,id=br0 \
|
||||
-device e1000,netdev=br0 \
|
||||
|
@ -43,7 +45,7 @@ elif [ "$1" = "qgrub" ]; then
|
|||
# ./run qgrub: qemu with grub
|
||||
$SERENITY_QEMU_BIN \
|
||||
$SERENITY_COMMON_QEMU_ARGS \
|
||||
-enable-kvm \
|
||||
$SERENITY_KVM_ARG \
|
||||
-object filter-dump,id=hue,netdev=breh,file=e1000.pcap \
|
||||
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
|
||||
-device e1000,netdev=breh
|
||||
|
@ -58,10 +60,10 @@ else
|
|||
# ./run: qemu with user networking
|
||||
$SERENITY_QEMU_BIN \
|
||||
$SERENITY_COMMON_QEMU_ARGS \
|
||||
-enable-kvm \
|
||||
$SERENITY_KVM_ARG \
|
||||
-object filter-dump,id=hue,netdev=breh,file=e1000.pcap \
|
||||
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
|
||||
-device e1000,netdev=breh \
|
||||
-kernel kernel \
|
||||
-append "${SERENITY_KERNEL_CMDLINE}"
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue