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

netcardconfig: drop uncommon wireless/WiFi options #12

Merged
merged 1 commit into from
Jul 8, 2021

Conversation

mika
Copy link
Member

@mika mika commented Jun 9, 2021

No longer ask for the following options WiFi:

  • iwconfig
  • iwpriv
  • iwspy
  • wireless-channel
  • wireless-freq
  • wireless-nwid
  • wireless-mode

AFAICT it's unusual to set those options to something other than the
defaults, at least nowadays. So let's drop support for it, minimizing
questions to answer in interactive mode (which also minimizes porting
efforts if we ever rewrite netcardconfig, see
#11).

FTR: according to my tests, wireless-tools seems to do the right™ thing
by default regarding "wireless-mode".

No longer ask for the following options WiFi:

* iwconfig
* iwpriv
* iwspy
* wireless-channel
* wireless-freq
* wireless-nwid
* wireless-mode

AFAICT it's unusual to set those options to something other than the
defaults, at least nowadays. So let's drop support for it, minimizing
questions to answer in interactive mode (which also minimizes porting
efforts if we ever rewrite netcardconfig, see
#11).

FTR: according to my tests, wireless-tools seems to do the right™ thing
by default regarding "wireless-mode".
@mika mika requested review from evgeni, formorer, jkirk and zeha June 9, 2021 12:55
@zeha
Copy link
Member

zeha commented Jun 10, 2021

I know very little about wireless on Linux I'm afraid.

@jkirk
Copy link
Contributor

jkirk commented Jun 30, 2021

Ok. Finally found some time to test your change on an older Lenovo B70-80 notebook. Your changes did work in the end (so +1 by me for your change) but I stumbled over some problems which seem to be unrelated to netcardconfig (and your change).

I booted Grml Daily (per 2021-06-27) and tried to bring up the wireless interface (with your netcardconfig) and the following error was shown:

RTNETLINK answers: Operation not possible due to RF-kill
wlan0     Interface doesn't support scanning : Network is down

After looking around a bit I found this:

❯ apropos rfkill
rfkill (8)           - tool for enabling and disabling wireless devices
systemd-rfkill (8)   - Load and save the RF kill switch state at boot and change
systemd-rfkill.service (8) - Load and save the RF kill switch state at boot and change
systemd-rfkill.socket (8) - Load and save the RF kill switch state at boot and change

❯ rfkill                                 
ID TYPE      DEVICE               SOFT      HARD
 0 wlan      ideapad_wlan      blocked unblocked
 1 bluetooth ideapad_bluetooth blocked unblocked
 2 wlan      phy0              blocked unblocked
 3 bluetooth hci0              blocked unblocked
 
 ❯ systemctl status systemd-rfkill.service
● systemd-rfkill.service - Load/Save RF Kill Switch Status
     Loaded: loaded (/lib/systemd/system/systemd-rfkill.service; static)
     Active: inactive (dead) since Mon 2021-06-28 10:08:51 UTC; 1min 46s ago
TriggeredBy: ● systemd-rfkill.socket
       Docs: man:systemd-rfkill.service(8)
    Process: 3994 ExecStart=/lib/systemd/systemd-rfkill (code=exited, status=0/SUCCESS)
   Main PID: 3994 (code=exited, status=0/SUCCESS)
        CPU: 6ms

Jun 28 10:08:46 grml systemd[1]: Starting Load/Save RF Kill Switch Status...
Jun 28 10:08:46 grml systemd[1]: Started Load/Save RF Kill Switch Status.
Jun 28 10:08:51 grml systemd[1]: systemd-rfkill.service: Succeeded.

After running rfkill unblock 2 I was able to configure the wireless network interface correctly.

JFTR: On my local Debian/bullseye system systemd-rfkil.service is masked:

❯ sudo systemctl status systemd-rfkill.service
● systemd-rfkill.service
    Loaded: masked (Reason: Unit systemd-rfkill.service is masked.)
    Active: inactive (dead)

systemd-rfkill.service(8) states:

systemd-rfkill.service is a service that restores the RF kill switch state at early boot and saves it on each change. On disk, the RF kill switch state is stored in /var/lib/systemd/rfkill/.

I need some more investigation to find out why the wireless interface is blocked after the boot (or actually why not all systems have a block interface after boot), but if it is really systemd-rfkill.services fault, we should maybe disable it as well or add a logic to test for a blocked interface and unblock the device in grml-network/netcardconfig? (I'd create a separate issue then.)

@mika
Copy link
Member Author

mika commented Jul 2, 2021

@jkirk very interesting find! 😮 👍

I'd assume that /dev/rfkill exists on your system and this triggers startup of systemd-rfkill.socket and therefore systemd-rfkill.service execution.

I'm not sure whether we should really mask systemd-rfkill.service and systemd-rfkill.socket via grml-live's /etc/grml/fai/config/scripts/GRMLBASE/15-initsetup though. I'd like to understand first why this happens on your system. :)

Could you please check, whether this snippet would unlock your devices as expected:

if rfkill | grep -w 'blocked' ; then
  echo "Unblocking all devices"
  rfkill unblock all
fi

If so, then we could include this check within netcardconfig to prompt for unblocking all devices.

BTW: there's also the boot option systemd.restore_state=0, though I'm not sure that's useful on a live system as state files shouldn't exist. What's inside /var/lib/systemd/rfkill on fresh startup of this affected system when booting Grml?

@jkirk
Copy link
Contributor

jkirk commented Jul 6, 2021

I came across a Lenovo P15s Gen2 Notebook and this time nothing is listed ad blocked with rfkill (although /dev/rfkill exists). That are the good news.

The bad news are that I was not able to set up the wireless network with grml-network / netcardconfig (to be fair, it does not work with the old netcardconfig as well). No wireless interfaces are listed and the script directly starts with killing the dhclient.

Unfortunately the device is offline and I currently can not connect on to it, but iwconfig does only list lo and eth0.

@mika
Copy link
Member Author

mika commented Jul 8, 2021

Ok, we took a look at aforesaid Lenovo P15s Gen2 Notebook together in person, and the WiFi card isn't supported at all yet (at least by kernel 5.10), so this is unrelated.

I'll merge this PR now, though will look into implementing an rfkill option as well.

@mika mika merged commit b67e23d into master Jul 8, 2021
@mika mika deleted the mika/netcard-wifi-cleanup branch July 8, 2021 06:35
mika added a commit that referenced this pull request Jul 8, 2021
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.

3 participants