Fix up wlan_mac.bin to make the driver happy
- Remove : from the MACs in the file: kernel driver does not understand
these
- Remove all but one addresses, so we only set a MAC for wlan0.
Duplicate MACs aren't allowed, and we only have one available for this
purpose.
Change-Id: Ibf0b53c4f360c355eef501af0832889a49be2985
diff --git a/etc/runonce.d/10-set-mac-addresses b/etc/runonce.d/10-set-mac-addresses
index a5dbbe8..893ebd4 100755
--- a/etc/runonce.d/10-set-mac-addresses
+++ b/etc/runonce.d/10-set-mac-addresses
@@ -29,9 +29,6 @@
WIFI_CONFIG_TEMPLATE = '''\
Intf0MacAddress={0}
-Intf1MacAddress={0}
-Intf2MacAddress={0}
-Intf3MacAddress={0}
END
'''
@@ -116,7 +113,7 @@
'''Writes the given MAC address string to the wifi configuration files.'''
try:
with open(WIFI_ADDR_PATH, 'w') as fp:
- fp.write(WIFI_CONFIG_TEMPLATE.format(next_mac))
+ fp.write(WIFI_CONFIG_TEMPLATE.format(next_mac.translate(None, ':')))
return True
except Exception as e:
print('Error writing wifi configuration to %s: %s' % (WIFI_ADDR_PATH, e))