Skip to content
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
wants to merge 1 commit into
base: lineage-18.1
Choose a base branch
from

Conversation

Quackdoc
Copy link

@Quackdoc Quackdoc commented Aug 8, 2024

@warlice it will need some testing first

@warlice
Copy link

warlice commented Aug 9, 2024

I think it's need an auto-adjusting mechanizm like detecting the cfg80211 and virt_wifi ko, if exists, set a property into waydroid_base.prop.

@aleasto
Copy link
Member

aleasto commented Aug 10, 2024

This is not working for me:
logcat.txt

$ sudo waydroid shell -- ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wifi_eth@if29: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:f9:d3:03 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::216:3eff:fef9:d303/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0@wifi_eth: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 00:16:3e:f9:d3:03 brd ff:ff:ff:ff:ff:ff

@warlice
Copy link

warlice commented Aug 12, 2024

It lack of an automative action of connecting virtwifi.

@aleasto
Copy link
Member

aleasto commented Aug 12, 2024

I'm not sure I understand.
What do we need to do? Why is it not in this PR? Is it working for you?

Comment on lines +4 to +9
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs rework.

  1. Do NOT rename eth0 like that, people will not be happy to have their main ethernet connection be renamed like that.
    • Not to mention that systems can have different names instead of eth0.
      Most distros have nowerdays changed to use eno1 as default for example...
  2. Not all systems have their wifi named wlan0.
    It's better to find an automated way of finding what name the wifi card(s) use.
    Maybe something like:
    wificards=( $(iwconfig 2>/dev/null | grep 'IEEE 802.11' | cut -d ' ' -f 1) )
    for wifi in "${wificards[@]}"; do
     ...
    done

Last but not least, i would prefer it much more to use netdev files to setup this virt_wifi link.

Copy link

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 🤷‍♀️

Copy link

@JamiKettunen JamiKettunen Nov 21, 2024

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

Copy link

@TriMoon TriMoon Nov 21, 2024

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...

  • Pssttt they already make use of systemd stuff, see waydroid-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...

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

@sujoshua
Copy link

sujoshua commented Jan 6, 2025

Any progress ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants