Is that something that could be added to modprobe.conf to have it work right without any modprobe calls?
> Huh, onehsot services are listed as stopped even though they've run. Do some research, find out I need the `RemainAfterExit` keyword yet. Sure, dependencies are working.
Yeah I've also been burned not having RemainAfterExit=y in a oneshot unit. What's worse, such an unit can get started multiple times.
> Well looking around at dmesg it looks like the problem is that networkmanager is trying to do something with the device at the same time I am. Looks like it's enumerating device capabilities at the same time I'm trying to create a new device?
To be fair such race condition could have happened in any init system.
> Oh well, I'll just add the retry keyword to my service.
Perhaps having a dependency to start your service before network-manager would have solved this.
> Long story short I ended up just writing a traditional shell-script based init script. Maybe I'm thinking about systemd wrong or something.
It's perfectly fine IMO to have small shell script services for such stuff.
Probably some of the problems are due to network-manager being mostly designed/used for desktop use cases. It also likes to take complete control of all the interfaces so calling iw/ifconfig behind it's back will cause tears (as you found out).
I do agree that race conditions caused by parallel service startup really suck in embedded devices. Systemd really could use a "please be as deterministic as possible" mode for embedded (if it already doesn't have).