Enabling Wi-Fi on First boot
Enrico Mioso
mrkiko.rs at gmail.com
Tue Jul 6 05:59:07 PDT 2021
Thanks a lot Alberto!!
I wasn't sure about uci-defaults being the correct way to do it - I was under the impression it could happen that my script gets ran when it's too early and /etc/config/wireless hasn't been generated yet.
If this isn't the case, then I think it's fine!
Thank you all!
On Tue, 6 Jul 2021, Alberto Bursi wrote:
> Date: Tue, 6 Jul 2021 14:36:18
> From: Alberto Bursi <bobafetthotmail at gmail.com>
> To: openwrt-devel at lists.openwrt.org
> Subject: Re: Enabling Wi-Fi on First boot
>
>
>
> On 06/07/21 09:12, Enrico Mioso wrote:
>>
>>
>>
>> On Mon, 5 Jul 2021, Paul Spooren wrote:
>>
>>> Date: Tue, 6 Jul 2021 09:06:14
>>> From: Paul Spooren <mail at aparcar.org>
>>> To: Enrico Mioso <mrkiko.rs at gmail.com>, openwrt-devel at lists.openwrt.org
>>> Subject: Re: Enabling Wi-Fi on First boot
>>>
>>>
>>> On 7/5/21 8:45 PM, Enrico Mioso wrote:
>>>> Hello all!!
>>>>
>>>> I would like to know your opinion on a topic I know has already been
>>>> discussed: enabling Wi-Fi on first boot.
>>>> I would very very much like to see this feature present in OpenWRt:
>>>> because I find myself in a scenario where plugging an Ethernet cable
>>>> after a fresh sysupgrade without keeping settings (due a a major upgrade
>>>> or just to "start clean") could be impractical.
>>> I think you can add uci-default scripts to enable it or do you want a
>>> config option during build time?
>>
>> Hello Paul!!
>>
>> Well, I tought about uci-defaults, but I tough it won't be so easy to
>> implement due to the fact Wi-Fi is probed asynchronously, and on some
>> devices i saw it takes a little bit (Netgear R7800).
>> I would have liked to have something already implemented in OpenWRt, so it
>> could be looked at by more people and have much higher chances of working
>> on all devices.
>>
>> Enrico
>>
>
> The only thing that must be done by a uci-defaults script is to set the wifi
> as enabled in the uci config.
> Afaik all devices ship with a default config for an open wifi network called
> "OpenWrt" for all their radios, but have
>
> option disabled '1'
>
> in both the device and wifi-iface text blocks, which disables the wifi.
>
> The uci-defaults script should just delete that line recursively along the
> whole /etc/config/wifi config file and it can be done with sed.
>
> Since uci-defaults scripts are run before everything else, the device should
> just have all wifi enabled on first boot no matter what wifi hardware it
> actually uses.
>
> You can easily turn this in a package (that only installs a uci-defaults
> script), just look at any other package that sets a uci-default script like
> this
> https://github.com/openwrt/packages/blob/master/net/bcp38/Makefile
> and use it as a template for your own.
>
> Since there are strong opinions are about keeping wifi off by default (last
> time I checked even devices that have no other network interfaces can't have
> a wifi enabled on first boot, forcing users to do a first config through the
> debug UART console or integrate a custom wifi config file in a custom image)
> I do not think many core developers will want to merge this package in core
> repository, but you can try.
>
> I think there should not be much problems if you send your package to
> community packages repository.
> https://github.com/openwrt/packages
>
> -Alberto
>
>>>>
>>>> From an implementation perspective, I don't think this feature needs to
>>>> be present on images we build with builtbots, nor official images at all.
>>>> It may be a config option a user can check when self-building his/her
>>>> images.
>>>> This would allow us to relax the security settings for the moment being,
>>>> and discuss and plan them later on. It seems to me there is the general
>>>> desire for having such a feature.
>>>>
>>>> Thanks a lot!
>>>>
>>>> Enrico
>>>>
>>>> _______________________________________________
>>>> openwrt-devel mailing list
>>>> openwrt-devel at lists.openwrt.org
>>>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>>>
>>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
More information about the openwrt-devel
mailing list