-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for simulating wifi #8
Open
Quackdoc
wants to merge
1
commit into
waydroid:lineage-18.1
Choose a base branch
from
warlice:lineage-18.1
base: lineage-18.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,12 +178,35 @@ PRODUCT_COPY_FILES += \ | |
frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \ | ||
frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \ | ||
frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \ | ||
device/generic/goldfish/wifi/simulated_hostapd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/simulated_hostapd.conf \ | ||
device/generic/goldfish/wifi/wpa_supplicant.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant.conf \ | ||
device/generic/goldfish/wifi/WifiConfigStore.xml:data/misc/wifi/WifiConfigStore.xml \ | ||
$(LOCAL_PATH)/init-net.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init-net.sh \ | ||
$(LOCAL_PATH)/init.net.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.net.rc \ | ||
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ | ||
frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \ | ||
frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \ | ||
frameworks/native/data/etc/android.software.freeform_window_management.xml:system/etc/permissions/android.software.freeform_window_management.xml | ||
|
||
# Power | ||
PRODUCT_PACKAGES += \ | ||
[email protected] \ | ||
sh_vendor \ | ||
ip_vendor \ | ||
iw_vendor \ | ||
[email protected] | ||
|
||
PRODUCT_PACKAGES += \ | ||
mac80211_create_radios \ | ||
createns \ | ||
dhcpclient \ | ||
execns \ | ||
hostapd \ | ||
hostapd_nohidl \ | ||
netmgr \ | ||
wifi_forwarder \ | ||
wpa_supplicant | ||
|
||
# Remove unwanted packages | ||
PRODUCT_PACKAGES += \ | ||
RemovePackages | ||
|
@@ -198,7 +221,9 @@ PRODUCT_PACKAGES += \ | |
|
||
# Soong | ||
PRODUCT_SOONG_NAMESPACES += \ | ||
$(LOCAL_PATH) | ||
$(LOCAL_PATH) \ | ||
device/generic/goldfish \ | ||
device/generic/goldfish-opengl \ | ||
|
||
# VNDK | ||
PRODUCT_PACKAGES += \ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/vendor/bin/sh | ||
|
||
|
||
if [ ! -d /sys/class/net/wlan0 ]; then | ||
/system/bin/ifconfig eth0 down | ||
/system/bin/ip link set eth0 name wifi_eth | ||
/system/bin/ifconfig wifi_eth up | ||
/system/bin/ip link add link wifi_eth name wlan0 type virt_wifi | ||
fi | ||
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
on post-fs-data | ||
setprop vold.post_fs_data_done 1 | ||
mkdir /data/vendor/var 0755 root root | ||
mkdir /data/vendor/var/run 0755 root root | ||
mkdir /data/vendor/var/run/netns 0755 root root | ||
start ranchu-net | ||
|
||
on zygote-start | ||
# Create the directories used by the Wireless subsystem | ||
mkdir /data/vendor/wifi 0771 wifi wifi | ||
mkdir /data/vendor/wifi/wpa 0770 wifi wifi | ||
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi | ||
|
||
service ranchu-net /vendor/bin/init-net.sh | ||
class late_start | ||
user root | ||
group root wakelock wifi | ||
oneshot | ||
disabled # Started on post-fs-data | ||
|
||
service emu_hostapd /vendor/bin/execns router /vendor/bin/hostapd_nohidl /data/vendor/wifi/hostapd/hostapd.conf | ||
user root | ||
group root wifi net_raw net_admin | ||
disabled | ||
|
||
service netmgr /vendor/bin/execns router /vendor/bin/netmgr --if-prefix wlan1 --bridge eth0,radio0-peer | ||
user root | ||
group root wifi | ||
disabled | ||
|
||
service wifi_forwarder /vendor/bin/wifi_forwarder | ||
user root | ||
group root wifi | ||
disabled | ||
|
||
service dhcpclient_rtr /vendor/bin/dhcpclient -i radio0 --no-gateway | ||
user root | ||
group root | ||
disabled | ||
|
||
service dhcpclient_wifi /vendor/bin/dhcpclient -i wlan0 --no-gateway | ||
user root | ||
group root | ||
disabled | ||
|
||
on property:vendor.network.bridged=1 | ||
start dhcpclient_rtr | ||
|
||
service dhcpclient_def /vendor/bin/dhcpclient -i eth0 --no-gateway | ||
user root | ||
group root | ||
disabled | ||
|
||
|
||
|
||
|
||
service wpa_supplicant /vendor/bin/hw/wpa_supplicant -Dnl80211 -iwlan0 -g@android:wpa_wlan0 | ||
interface [email protected]::ISupplicant default | ||
interface [email protected]::ISupplicant default | ||
interface [email protected]::ISupplicant default | ||
interface [email protected]::ISupplicant default | ||
socket wpa_wlan0 dgram 660 wifi wifi | ||
group system wifi inet | ||
oneshot | ||
disabled |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs rework.
eth0
like that, people will not be happy to have their main ethernet connection be renamed like that.eth0
.Most distros have nowerdays changed to use
eno1
as default for example...wlan0
.It's better to find an automated way of finding what name the wifi card(s) use.
Maybe something like:
Last but not least, i would prefer it much more to use netdev files to setup this
virt_wifi
link.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides i don't really understand the need for all this renaming of links anyhow 🤷♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that part is to be moved to the host couldn't the virtual wlan setup be handled by the already existing https://github.com/waydroid/waydroid/blob/main/data/scripts/waydroid-net.sh? I'd prefer not adding dependencies on random systemd components for core fixes like "apps not detecting any networking" if that can be avoided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree about the place to move that part.
But strongly disagree with the "random systemd components" with same arguments for usage of non-systemd solutions on a
systemd
based system which most distro's use these days...systemd
stuff, seewaydroid-container.service
😉If they want to be totally politically correct they should implement all this stuff they do now in scripts, inside a compiled C++ binary that directly calls kernel functions...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The init script is different because that's just the entrypoint and easily replicatable anywhere, if other waydroid parts depend on systemd handling something it'll just be broken elsewhere silently