Created
November 13, 2015 15:07
-
-
Save kamidzi/21fabb0221b8a7b82fce to your computer and use it in GitHub Desktop.
Patch to qemu-ifup for uefi pxe testing with BCPC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /etc/qemu-ifup 2015-10-23 09:03:57.000000000 +0000 | |
+++ /usr/local/share/qemu/qemu-ifup 2015-11-12 19:35:15.293392567 +0000 | |
@@ -3,6 +3,8 @@ | |
# The idea is to add the tap device to the same bridge | |
# as we have default routing to. | |
+exec 2>>/var/log/qemu.log | |
+set -x | |
# in order to be able to find brctl | |
PATH=$PATH:/sbin:/usr/sbin | |
ip=$(which ip) | |
@@ -18,8 +20,9 @@ | |
ifconfig "$1" 0.0.0.0 up | |
fi | |
-switch=$(ip route ls | \ | |
- awk '/^default / { | |
+dhcp_server=10.0.100.3 | |
+switch=$(ip route get $dhcp_server | \ | |
+ awk '{ | |
for(i=0;i<NF;i++) { if ($i == "dev") { print $(i+1); next; } } | |
}' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment