beaglebone startup script weirdness / associating with a WPA access point at boot

Hi folks. I'm about a week into BeagleBone A4 ownership, and still
struggling to get networking set up the way I'd like. I'm running the
distro that it shipped with; other than snapping off R219 to get the
ethernet working, the system is pretty much as it shipped to me.
Using instructions previously posted here (http://groups.google.com/
group/beagleboard/browse_thread/thread/82f84aa6c5cb6fa5) I
successfully built the ipks necessary for the rt2800usb wifi adapter I
have on hand. When SSHed into the device, I can successfully connect
to a WPA2 wifi network using 'ifup wlan0'. Great!

What I can't do is get the interface to come up automatically. Even
more weirdly, I can't seem to get a startup script to run *at all*.
Here's my /etc/network/interfaces: http://pastie.org/3351121

You'll see that, right now, wpa_supplicant is supposed to be launched
by a startup script, wpa.sh (see here: http://pastie.org/3351130) --
and so it is, when I use ifup. If I swap around the comments to use
the wpa-ssid/wpa-psk config in the interfaces file, that works fine,
too -- again, only when I manually run ifup, not at boot. This
behavior remains the same if I change "allow-hotplug wlan0" to "auto
wlan0".

So, alright, maybe I just need to have 'ifup wlan0' run as the last
thing at boot. I put together a very simple script to do this -- see
here: http://pastie.org/3351154 (the "sleep 5" was added as a shot in
the dark, hoping that there might be a race condition w/ the hardware
coming up) -- and put it in /etc/rc.local, chmod +x. The file that the
first line touches never shows up -- not at boot anyway, it shows up
fine if I run the startup script manually from an SSH session.
Alright, maybe Angstrom doesn't respect rc.local. I put the script
into /etc/init.d and symlinked from /etc/rc[2-5].d/S99NETWORK. No
dice -- no file in /home/root, no wlan0, nothing.

Actually, I shouldn't say that *I* did this last step -- my sysadmin,
who has more than a decade of Linux administration experience, did.
So while I'm sure I'm missing *something*, I'm hopeful that it at
least isn't something obvious about the rc.d system.

Apologies if this properly belongs on a list about Angstrom, but
googling around for startup script problems in the BB/Armstrong
communities has yielded surprisingly little. Any thoughts or
suggestions will be much appreciated.

Hi folks. I’m about a week into BeagleBone A4 ownership, and still
struggling to get networking set up the way I’d like. I’m running the
distro that it shipped with; other than snapping off R219 to get the
ethernet working, the system is pretty much as it shipped to me.
Using instructions previously posted here (http://groups.google.com/
group/beagleboard/browse_thread/thread/82f84aa6c5cb6fa5) I
successfully built the ipks necessary for the rt2800usb wifi adapter I
have on hand. When SSHed into the device, I can successfully connect
to a WPA2 wifi network using ‘ifup wlan0’. Great!

What I can’t do is get the interface to come up automatically. Even
more weirdly, I can’t seem to get a startup script to run at all.
Here’s my /etc/network/interfaces: http://pastie.org/3351121

I think this is becoming a VFAQ. That file isn’t used, but instead Connman is used:
http://www.gigamegablog.com/2012/02/06/beaglebone-linux-101-assigning-a-static-ip-address-with-connman/

Thanks! But naturally this brings up the next question: how the heck
can I get connman to recognize the wifi interface? Running the get-
services script as described in the linked blog post only turns up the
ethernet interface (http://pastie.org/3356761). Adding -W wext to the
init.d/connman script doesn't improve matters.

There's also still the question of why my startup scripts are failing
to successfully touch that debug file. I will eventually need to have
a non-wifi-related startup script run; right now I don't understand
why it wouldn't. If I could, perhaps I could just rely on the non-
connman wifi networking options, which I've got working with the
exception of startup at boot.