On 6/4/11 6:29 PM, Jonas Gorski wrote:
> On 5 June 2011 00:36, Philip Prindeville
> <philipp_s...@redfish-solutions.com> wrote:
>> The alix2 boards include a miniPCI slot; this is typically used for Wifi 
>> cards. Preconfigure wifi.
>>
>> The alix2 boards also contain 2 or 3 Ethernet ports. Provision the first two 
>> as a bridge.
>>
> 
> Ugh... I have several objections to this, but I just saw the goes
> target has the same ones already present.
> 
> First of all, you would achieve the same by directly putting uci
> config files into alix2/base-files/etc/config/ (like the olpc target
> has).
> 
> Secondly:
> 
>> +set wireless.wlan0.type=mac80211
> 
> what if I want to use madwifi?
> 
>> +set wireless.wlan0.hwmode=11g
> 
> So I'm not allowed to use 11n?
> 
>> +set wireless.wlan0.country=US
> 
> What if I'm not in US?
> 
>> +set wireless.@wifi-iface[-1].ssid=typhoon
> 
> What's wrong with Openwrt, the default everywhere else? ;)
> 
>> +set wireless.@wifi-iface[-1].key="passphrase"
> 
> Ugh, vulnerable to a dictionary attack ...
> 
>> +set wireless.@wifi-iface[-1].hidden=0
> 
> This is afaik needless, as 0/false is the default when the key is not present.
> 
> What if I have an alix2 with 2 mini PCI slots and two wifi cards? Then
> my second one won't be visible.
> 
> Also why is wifi /enabled/ by default with a weak password? Security
> wise this is A Bad Idea.
> 
> The network part looks a-okay configuration wise, but I don't like the
> generation at firstboot. Also I'm not sure what happens if I change
> the default network config in menuconfig when building my own image.
> Dynamically setting the network configuration might be acceptable if
> there e.g. would be a check on how many eths are present and then
> assigning the eths to wan and lan.
> 
> 
> Jonas


I was going by the example of one of the other platforms, I forget which. Maybe
target/linux/atheros/base-files/etc/uci-defaults/network ...

I can change the Wifi to be off, and change the SSID. The reason I put values 
was as placekeepers, so that someone getting into /etc/config/wifi would be 
able to see what they needed to change by hand.

I'm not sure there are any Alix's currently in production with 2 miniPCI slots, 
or if there ever have been.

I also decided to do it as a series of mods applied to the standard 
configuration, so that if the "main" canned config changed, I wouldn't have to 
modify the platform configs as well. They would just layer their changes atop 
the main configuration as deltas.

-Philip
Index: target/linux/x86/alix2/base-files/etc/uci-defaults/network
===================================================================
--- target/linux/x86/alix2/base-files/etc/uci-defaults/network  (revision 0)
+++ target/linux/x86/alix2/base-files/etc/uci-defaults/network  (revision 0)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+uci batch <<__EOF__
+
+delete network.lan
+
+set network.lan=interface
+set network.lan.type=bridge
+set network.lan.ifname="eth0 eth1"
+set network.lan.proto=static
+set network.lan.ipaddr="192.168.1.1"
+set network.lan.netmask="255.255.255.0"
+set network.lan.nat=1
+
+commit network
+__EOF__
Index: target/linux/x86/alix2/base-files/etc/uci-defaults/wireless
===================================================================
--- target/linux/x86/alix2/base-files/etc/uci-defaults/wireless (revision 0)
+++ target/linux/x86/alix2/base-files/etc/uci-defaults/wireless (revision 0)
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+[ -f /etc/config/wireless ] || echo "package wireless" > /etc/config/wireless
+
+uci batch <<__EOF__
+
+delete wireless.radio0
+delete wireless.@wifi-iface[0]
+
+set wireless.wlan0=wifi-device
+set wireless.wlan0.type=mac80211
+set wireless.wlan0.phy=phy0
+set wireless.wlan0.channel=auto
+set wireless.wlan0.hwmode=11g
+set wireless.wlan0.country=US
+
+add wireless wifi-iface
+set wireless.@wifi-iface[-1].device=wlan0
+set wireless.@wifi-iface[-1].network=lan
+set wireless.@wifi-iface[-1].mode=ap
+set wireless.@wifi-iface[-1].ssid=Openwrt
+set wireless.@wifi-iface[-1].encryption="psk2+aes"
+set wireless.@wifi-iface[-1].key="passphrase"
+set wireless.@wifi-iface[-1].hidden=0
+set wireless.@wifi-iface[-1].disabled=1
+
+commit wireless
+__EOF__
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to