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
wpa_supplicant usage #397
wpa_supplicant usage #397
Conversation
fi | ||
# lo interface may already be there, so first check for it | ||
if ! grep -q "auto lo" /rootfs/etc/network/interfaces; then | ||
echo "auto lo" >> /rootfs/etc/network/interfaces |
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.
please don't use weird alignment like this
bump |
L870 won’t work because the installed system hasen’t been `apt-get update`d.
wpa_supplicant -B -Dnl80211,wext -c/bootfs/config/wpa_supplicant.conf -i$ifname >& /dev/null || fail | ||
echo "OK" | ||
echo "Starting wpa_supplicant... " | ||
wpa_supplicant -B -Dnl80211 -c/bootfs/config/wpa_supplicant.conf -i$ifname |
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.
are nl80211
and wext
the only two supported modules?
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.
There's also wired
.
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.
But we don't need wpa_supplicant
for wired connections 😉
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.
😋 I meant for wireless... 😊
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.
What's the reason for this change?
The whole idea of -Dnl80211,wext
is to try nl80211
first and if that doesn't work, try wext
.
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.
It doesn't work with -Dnl80211,wext
😕 . It turned out during testing that it only worked if I tried them separately.
@@ -1115,6 +1121,15 @@ if [ -e /bootfs/post-install.txt ]; then | |||
echo "=================================================" | |||
fi | |||
|
|||
# modify installed network settings | |||
if [ -f /rootfs/etc/wpa_supplicant/wpa_supplicant.conf ]; then | |||
if [ $(grep "iface" /rootfs/etc/network/interfaces |grep -v "lo\|eth0" |wc -l) -ne 0 ]; then |
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.
please add spaces after the pipe characters (the actual pipes, not the character in the regex 😉 )
💭 maybe it would be better to check the interface name for |
Ra-link devices get named |
Let's cross that bridge when we get there. |
I was thinking a bit too far ahead... this is a larger part of my
the code as is wouldn't create both wpa-conf entries... but on the other hand (this is where I didn't think it through) you can't really add multiple interfaces anyway, so... never mind 😉 |
groan |
echo "wpa-conf /boot/config/wpa_supplicant.conf" | ||
# eth0 config | ||
echo "" >> /rootfs/etc/network/interfaces | ||
echo "auto $ifname" >> /rootfs/etc/network/interfaces |
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.
With wireless interfaces, you usually also want allow-hotplug $ifname
as wireless devices are more likely to get unplugged and replugged, but also it will give a signal when the device is ready to be used by which the auto
may already have passed.
I do have one more thing, though... if we install using WiFi, we don't create an entry for eth0... I think that in this case we should create an entry with dhcp:
this way the ethernet port will still work if a cable is plugged in... |
I'm not sure where to put it, so I'll just do it here.
Note the |
I have manual in there as well (interestingly, for eth0 as well, as said, taken from the official raspbian)... what is a |
I actually don't know, I just know that I see that all the time and it also always works here. |
I've never used it. So, I hope you don't mind me not adding it. It works fine without. |
Mind you that not adding the |
both `wlan` and `eth0` with `auto` and `hotplug`
Done. |
huh? really? why? how? I NEED ANSWERS!!! 😁 no, but really... how? |
I have no idea. It just does. |
it shouldn't be, AFAIK, if the interface isn't listed (to be brought up) in the |
FWIW I share goranche's skepticism. |
OK. No problem. The |
Next time I will require that you'll squash commits together 😉 I noticed that when you only have a wireless device plugged in, the boot process takes quite a long time because it's waiting for |
Changes:
config/wpa_supplicant.conf
exists AND was used by the installer then copy it to the installed system in/etc/wpa_supplicant/
and add a reference to it in/etc/network/interfaces
.wpa_supplicant
so that it actually works.This commit will allow the user to install AND use the target system in the absence of a wired ethernet connection, but in the presence of a WiFi network.
The user must configure the following (already existing) parameters:
drivers_to_load=
supply the name of the module that must be loaded by the kernel for the hardware (WiFi dongle) used. E.g.:8192cu
.ifname=
supply the non-ethernet interface name. Normally you will usewlan0
here.Additionally user must supply a file (
config/wpa_supplicant.conf
) containing a valid configuration. E.g.:ref: https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf
(Please don't use the password suggested in the example above. It is not secure)