network: added support for configuration of CDC-Ethernet and Android RNDIS network interfaces
This commit is contained in:
parent
b011e2aa40
commit
8740e2a830
@ -57,8 +57,51 @@ _EOF
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# FIXME
|
function cdc_usb() {
|
||||||
DEST_GATEWAY_ZONE=local
|
local CDC_IPADDR=10.99.99.1
|
||||||
|
|
||||||
|
ifconfig usb0 &>/dev/null && {
|
||||||
|
[ -e $network_devices/ifcng-usb0 ] || {
|
||||||
|
[ "$NETWORK_CDC_IPADDR" ] && CDC_IPADDR=$NETWORK_CDC_IPADDR
|
||||||
|
cat > $network_devices/ifcfg-usb0 << _EOF
|
||||||
|
DEVICE=usb0
|
||||||
|
BOOTPROTO=none
|
||||||
|
IPADDR=$CDC_IPADDR
|
||||||
|
ONBOOT=yes
|
||||||
|
NM_CONTROLLED=no
|
||||||
|
_EOF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function android_usb() {
|
||||||
|
local ANDROID_IPADDR=10.99.99.1
|
||||||
|
local ANDROID_ETHADDR=80:00:60:0F:E8:00
|
||||||
|
|
||||||
|
# FIXME: hardcoded values
|
||||||
|
if [ -e /sys/class/android_usb/android0 ]; then
|
||||||
|
[ "$NETWORK_ANDROID_ETHADDR" ] && ANDROID_ETHADDR=$NETWORK_ANDROID_ETHADDR
|
||||||
|
echo 0 > /sys/class/android_usb/android0/enable
|
||||||
|
echo rndis,acm > /sys/class/android_usb/android0/functions
|
||||||
|
echo 2 > /sys/class/android_usb/android0/f_acm/instances
|
||||||
|
echo $ANDROID_ETHADDR > /sys/class/android_usb/android0/f_rndis/ethaddr
|
||||||
|
echo 2d01 > /sys/class/android_usb/android0/idProduct
|
||||||
|
echo 1 > /sys/class/android_usb/android0/enable
|
||||||
|
fi
|
||||||
|
[ -e $network_devices/ifcfg-rndis0 ] || {
|
||||||
|
[ "$NETWORK_ANDROID_IPADDR" ] && ANDROID_IPADDR=$NETWORK_ANDROID_IPADDR
|
||||||
|
cat > $network_devices/ifcfg-rndis0 << _EOF
|
||||||
|
DEVICE=rndis0
|
||||||
|
BOOTPROTO=none
|
||||||
|
IPADDR=$ANDROID_IPADDR
|
||||||
|
ONBOOT=yes
|
||||||
|
NM_CONTROLLED=no
|
||||||
|
_EOF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[ "$NETWORK_CDC_DISABLE" = "1" ] || cdc_usb
|
||||||
|
[ "$NETWORK_ANDROID_DISABLE" = "1" ] || android_usb
|
||||||
|
|
||||||
wlan_ints=()
|
wlan_ints=()
|
||||||
for wlan_int in $(cat /proc/net/wireless 2>/dev/null | sed -n '/[a-z]*[0-9]*:/{s,:.*,,;p}'); do
|
for wlan_int in $(cat /proc/net/wireless 2>/dev/null | sed -n '/[a-z]*[0-9]*:/{s,:.*,,;p}'); do
|
||||||
|
@ -30,6 +30,15 @@ FS_NO_DEV_REMOVE=yes
|
|||||||
# (dialog/auto/off, default: off)
|
# (dialog/auto/off, default: off)
|
||||||
NETWORK_NEWDEVICE=off
|
NETWORK_NEWDEVICE=off
|
||||||
|
|
||||||
|
# network parameters for CDC ethernet interface
|
||||||
|
#NETWORK_CDC_DISABLE=1
|
||||||
|
#NETWORK_CDC_IPADDR=10.99.99.1
|
||||||
|
|
||||||
|
# network parameters for Android rndis ethernet interface
|
||||||
|
#NETWORK_ANDROID_DISABLE=1
|
||||||
|
#NETWORK_ANDROID_IPADDR=10.99.99.1
|
||||||
|
#NETWOKR_ANDROID_ETHADDR=01:02:03:04:05:06
|
||||||
|
|
||||||
# xorg server: automatically add DRI section
|
# xorg server: automatically add DRI section
|
||||||
# (on/off, default: on)
|
# (on/off, default: on)
|
||||||
XORG_ENABLE_DRI=on
|
XORG_ENABLE_DRI=on
|
||||||
|
Loading…
Reference in New Issue
Block a user