Merge "Userland support for VM interconnection"
This commit is contained in:
commit
0fcbdb4147
3 changed files with 29 additions and 9 deletions
|
|
@ -45,3 +45,13 @@ esac
|
||||||
# this line doesn't really do anything useful. however without it the
|
# this line doesn't really do anything useful. however without it the
|
||||||
# previous setprop doesn't seem to apply for some really odd reason
|
# previous setprop doesn't seem to apply for some really odd reason
|
||||||
setprop ro.qemu.init.completed 1
|
setprop ro.qemu.init.completed 1
|
||||||
|
|
||||||
|
# set up the second interface (for inter-emulator connections)
|
||||||
|
# if required
|
||||||
|
my_ip=`getprop net.shared_net_ip`
|
||||||
|
case "$my_ip" in
|
||||||
|
"")
|
||||||
|
;;
|
||||||
|
*) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ TOOLS := \
|
||||||
printenv \
|
printenv \
|
||||||
smd \
|
smd \
|
||||||
chmod \
|
chmod \
|
||||||
chown \
|
chown \
|
||||||
newfs_msdos \
|
newfs_msdos \
|
||||||
netstat \
|
netstat \
|
||||||
ioctl \
|
ioctl \
|
||||||
|
|
@ -53,7 +53,7 @@ TOOLS := \
|
||||||
uptime \
|
uptime \
|
||||||
vmstat \
|
vmstat \
|
||||||
nandread \
|
nandread \
|
||||||
ionice
|
ionice
|
||||||
|
|
||||||
LOCAL_SRC_FILES:= \
|
LOCAL_SRC_FILES:= \
|
||||||
toolbox.c \
|
toolbox.c \
|
||||||
|
|
|
||||||
|
|
@ -80,14 +80,24 @@ int route_main(int argc, char *argv[])
|
||||||
|
|
||||||
/* route add -net 192.168.1.2 netmask 255.255.255.0 gw 192.168.1.1 */
|
/* route add -net 192.168.1.2 netmask 255.255.255.0 gw 192.168.1.1 */
|
||||||
if (argc > 7 && !strcmp(argv[2], "-net") &&
|
if (argc > 7 && !strcmp(argv[2], "-net") &&
|
||||||
!strcmp(argv[4], "netmask") && !strcmp(argv[6], "gw")) {
|
!strcmp(argv[4], "netmask")) {
|
||||||
rt.rt_flags = RTF_UP | RTF_GATEWAY;
|
if (!strcmp(argv[6], "gw")) {
|
||||||
if (set_address(argv[3], &rt.rt_dst) &&
|
rt.rt_flags = RTF_UP | RTF_GATEWAY;
|
||||||
set_address(argv[5], &rt.rt_genmask) &&
|
if (set_address(argv[3], &rt.rt_dst) &&
|
||||||
set_address(argv[7], &rt.rt_gateway)) {
|
set_address(argv[5], &rt.rt_genmask) &&
|
||||||
errno = 0;
|
set_address(argv[7], &rt.rt_gateway)) {
|
||||||
|
errno = 0;
|
||||||
|
}
|
||||||
|
goto apply;
|
||||||
|
} else if (!strcmp(argv[6], "dev")) {
|
||||||
|
rt.rt_flags = RTF_UP;
|
||||||
|
rt.rt_dev = argv[7];
|
||||||
|
if (set_address(argv[3], &rt.rt_dst) &&
|
||||||
|
set_address(argv[5], &rt.rt_genmask)) {
|
||||||
|
errno = 0;
|
||||||
|
}
|
||||||
|
goto apply;
|
||||||
}
|
}
|
||||||
goto apply;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue