Meta: Ensure the tap device is removed before trying to create it again

Sometimes the tap device isn't destroyed depending on how the script
exits. Running the script again then fails to create the device
again.
This commit is contained in:
Gunnar Beutner 2021-04-29 20:02:43 +02:00 committed by Andreas Kling
parent 4c40151160
commit b861259098
Notes: sideshowbarker 2024-07-18 18:54:26 +09:00

View file

@ -105,6 +105,7 @@ elif [ "$SERENITY_RUN" = "qn" ]; then
-append "${SERENITY_KERNEL_CMDLINE}"
elif [ "$SERENITY_RUN" = "qtap" ]; then
# Meta/run.sh qtap: qemu with tap
sudo ip tuntap del dev tap0 mode tap || true
sudo ip tuntap add dev tap0 mode tap user "$(id -u)"
"$SERENITY_QEMU_BIN" \
$SERENITY_COMMON_QEMU_ARGS \